$description = stripslashes($_POST['ReportName']); $rowSeq = $_POST['rowSeq']; $SeqNum = (int) $_POST['SeqNum']; $EntryType = $_POST['EntryType']; switch ($todo) { case 'up': if ($rowSeq != 1) { $success = ChangeSequence($rowSeq, $EntryType, 'up'); } $FormParams = PrepStep('6'); break; case 'down': $sql = "select seqnum from " . TABLE_REPORT_FIELDS . " \r\n\t\t\t\t\twhere reportid = " . $ReportID . " and entrytype = '" . $EntryType . "'"; $result = $db->Execute($sql); if ($rowSeq < $result->Recordcount()) { $success = ChangeSequence($rowSeq, $EntryType, 'down'); } $FormParams = PrepStep('6'); break; case 'edit': $OverrideDefaults = true; // pre fill form with the field to edit and change button name $sql = "select * from " . TABLE_REPORT_FIELDS . " \r\n\t\t\t\t\twhere reportid = " . $ReportID . " and entrytype = '" . $EntryType . "' and seqnum = " . $rowSeq; $result = $db->Execute($sql); $NewDefaults['defaults'] = $result->fields; $NewDefaults['defaults']['params'] = unserialize($result->fields['params']); // $NewDefaults['defaults']['params'] = $temp_params[0]; // $NewDefaults['defaults']['minvalue'] = $temp_params[2]; // $NewDefaults['defaults']['maxvalue'] = $temp_params[3]; $NewDefaults['defaults']['buttonvalue'] = TEXT_CHANGE; $FormParams = PrepStep('6');
// then a sequence image button was pushed $SeqNum = $_POST['SeqNum']; //fetch the sequence number $EntryType = $_POST['EntryType']; //fetch the entry type if (isset($_POST['up_x'])) { // the shift up button was pushed if ($SeqNum != 1) { $success = ChangeSequence($_POST['SeqNum'], $EntryType, 'up'); } } elseif (isset($_POST['dn_x'])) { // the shift down button was pushed $sql = "SELECT seqnum FROM " . DBRptFields . " WHERE reportid = " . $ReportID . " AND entrytype = '" . $EntryType . "';"; $Result = DB_query($sql, $db, '', '', false, true); if ($SeqNum < DB_num_rows($Result)) { $success = ChangeSequence($_POST['SeqNum'], $EntryType, 'down'); } } elseif (isset($_POST['ed_x'])) { // the sequence edit button was pushed $OverrideDefaults = true; // pre fill form with the field to edit and change button name $sql = "SELECT * FROM " . DBRptFields . "\n\t\t\t\t\tWHERE reportid = " . $ReportID . " AND entrytype = '" . $EntryType . "' AND seqnum=" . $SeqNum . ";"; $Result = DB_query($sql, $db, '', '', false, true); $NewDefaults['defaults'] = DB_fetch_array($Result); $NewDefaults['defaults']['buttonvalue'] = RPT_BTN_CHANGE; } elseif (isset($_POST['rm_x'])) { // the sequence remove button was pushed $success = DeleteSequence($_POST['SeqNum'], $EntryType); } $reportname = $_POST['ReportName']; $FormParams = PrepStep('6');
break; } } $ReportID = $_POST['ReportID']; // fetch the report id if (isset($_POST['up' . $SeqNum . '_x'])) { // the shift up button was pushed, check for not at first sequence if ($SeqNum != 1) { $success = ChangeSequence($ReportID, $SeqNum, 'fieldlist', 'up'); } } elseif (isset($_POST['dn' . $SeqNum . '_x'])) { // the shift down button was pushed $sql = "SELECT seqnum FROM " . DBRptFields . "\n\t\t\t\t\t\tWHERE reportid = '" . $ReportID . "' AND entrytype = 'fieldlist';"; $Result = DB_query($sql, $db, '', '', false, true); if ($SeqNum < DB_num_rows($Result)) { $success = ChangeSequence($ReportID, $SeqNum, 'fieldlist', 'down'); } } // Overrride stored settings with current selected values $Prefs = FetchReportDetails($_POST['ReportID']); // fetch the current settings if (isset($_POST['FilterForm']) or isset($_POST['PageForm'])) { // then we're here from a filter or page form, also read any updtes from the forms. $Prefs = ReadPostData($ReportID, $Prefs); } // reload information to display form $Title = RPT_CRITERIA; $IncludePage = 'forms/ReportsFilter.html'; } else { // a submit button was pressed, find out which one $ReportID = $_POST['ReportID'];