bea
Active Member
Hi,
I think I'm missing some steps with F3. The Wiki for PHP is confusing me..F3.0, F3.1, F3.2...
I've managed to get a new record, on save, but without element $machine and $status from previous record like in my F2 spript.
I need some scripts to write a new record into the same table, also into another one (later).
I would appreciate any help
Cheers,
Bianka
I think I'm missing some steps with F3. The Wiki for PHP is confusing me..F3.0, F3.1, F3.2...
I've managed to get a new record, on save, but without element $machine and $status from previous record like in my F2 spript.
I need some scripts to write a new record into the same table, also into another one (later).
I would appreciate any help
Cheers,
Bianka
PHP:
<?php
$db = JFactory::getDbo();
$machine = (int)"{fab_cp1_line_tour___machine}";
$status = JRequest::getVar('fab_cp1_line_tour___status_raw');
if($status[0] == 2) {
$query = $db->getQuery(true);
$query->insert('fab_cp1_line_tour')
->set('machine = ' . $db->quote('{fab_cp1_line_tour___machine}'))
->set('status = ' . $db->quote('{fab_cp1_line_tour___status}'));
$db->setQuery($query);
$db->execute();
$id = $db->insertid();
}
?>
PHP:
<?php
// Fabrik 2.0!!!
defined('_JEXEC') or die();
//Generiert neues Dokument
$status = JRequest::getVar('fab_min_shiftreport___done_raw');
$report = JRequest::getVar('fab_min_shiftreport___report');
$report = $report[0];
if($report[0] != 2 && $status[0] == 2) {
$db =& JFactory::getDBO();
$date =& JFactory::getDate();
$myuser =& JFactory::getUser();
$done = 1;
$report_new = 0;
$info = $db->Quote($formModel->_formData['comment_raw']);
$db->setQuery("INSERT INTO fab_min_shiftreport(done,report,info1)
VALUES ($done,$report_new,$info)");
$db->query();
}
?>
Last edited: