if ($ergebnis = $dept_obj->Transact($sql)) {
         // Load the visual signalling functions
         include_once $root_path . 'include/inc_visual_signalling_fx.php';
         // Set the visual signal
         setEventSignalColor($pn, SIGNAL_COLOR_DIAGNOSTICS_REQUEST);
         header("location:" . $root_path . "modules/laboratory/labor_test_request_aftersave.php?sid=" . $sid . "&lang=" . $lang . "&edit=" . $edit . "&saved=insert&pn=" . $pn . "&station=" . $station . "&user_origin=" . $user_origin . "&status=" . $status . "&target=" . $target . "&dept_nr=" . $dept_nr . "&noresize=" . $noresize . "&batch_nr=" . $batch_nr);
         exit;
     } else {
         echo "<p>{$sql}<p>{$LDDbNoSave}";
         $mode = "";
     }
     break;
     // end of case 'save'
 // end of case 'save'
 case 'update':
     $sql = "UPDATE care_test_request_" . $db_request_table . " SET \n\t\t\t\t\t\t\t\t\t\t\ttesting_dept = '" . $dept_nr . "', \n\t\t\t\t\t\t\t\t\t\t\tvisit = '" . $visit . "', \n\t\t\t\t\t\t\t\t\t\t\torder_patient = '" . $order_patient . "', \n\t\t\t\t\t\t\t\t\t\t\tdiagnosis_quiry = '" . $diagnosis_quiry . "', \n\t\t\t\t\t\t\t\t\t\t\tsend_date = '" . formatDate2Std($send_date, $date_format) . "', \n\t\t\t\t\t\t\t\t\t\t\tsend_doctor = '" . $send_doctor . "', \n\t\t\t\t\t\t\t\t\t\t\tstatus = '" . $status . "', \n\t\t\t\t\t\t\t\t\t\t    history=" . $dept_obj->ConcatHistory("Update: " . date('Y-m-d H:i:s') . " = " . $_SESSION['sess_user_name'] . "\n") . ",\n\t\t\t\t\t\t\t\t\t\t    modify_id = '" . $_SESSION['sess_user_name'] . "',\n\t\t\t\t\t\t\t\t\t\t\tmodify_time='" . date('YmdHis') . "'\n\t\t\t\t\t\t\t\t\t\t\tWHERE batch_nr = '" . $batch_nr . "' ";
     if ($ergebnis = $dept_obj->Transact($sql)) {
         // Load the visual signalling functions
         include_once $root_path . 'include/inc_visual_signalling_fx.php';
         // Set the visual signal
         setEventSignalColor($pn, SIGNAL_COLOR_DIAGNOSTICS_REQUEST);
         //echo $sql;
         header("location:" . $root_path . "modules/laboratory/labor_test_request_aftersave.php?sid=" . $sid . "&lang=" . $lang . "&edit=" . $edit . "&saved=update&pn=" . $pn . "&station=" . $station . "&user_origin=" . $user_origin . "&status=" . $status . "&target=" . $target . "&dept_nr=" . $dept_nr . "&batch_nr=" . $batch_nr . "&noresize=" . $noresize);
         exit;
     } else {
         echo "<p>{$sql}<p>{$LDDbNoSave}";
         $mode = "";
     }
     break;
     // end of case 'save'
     /* If mode is edit, get the stored test request when its status is either "pending" or "draft"
/* Set form to read */
$edit = 0;
/* Set script mode to no edit*/
$db_request_table = $target;
$dept_nr = $subtarget;
//$db->debug=1;
require_once $root_path . 'include/care_api_classes/class_department.php';
$dept_obj = new Department();
/* Here begins the real work */
require_once $root_path . 'include/inc_date_format_functions.php';
if (!isset($mode)) {
    $mode = '';
}
switch ($mode) {
    case 'update':
        $sql = "UPDATE care_test_request_" . $db_request_table . " SET \n                                          result='" . htmlentities(addslashes($result)) . "',\n\t\t\t\t\t\t\t\t\t\t  result_date='" . formatDate2Std($result_date, $date_format) . "',\n\t\t\t\t\t\t\t\t\t\t  result_doctor='" . $result_doctor . "',\n\t\t\t\t\t\t\t\t\t\t   history=" . $dept_obj->ConcatHistory("Update: " . date('Y-m-d H:i:s') . " = " . $_SESSION['sess_user_name'] . "\n") . ",\n\t\t\t\t\t\t\t\t\t\t   modify_id = '" . $_SESSION['sess_user_name'] . "',\n\t\t\t\t\t\t\t\t\t\t   modify_time = '" . date('YmdHis') . "'\n\t\t\t\t\t\t\t\t\t\t   WHERE batch_nr = '" . $batch_nr . "'";
        if ($ergebnis = $dept_obj->Transact($sql)) {
            /* If the findings are succesfully saved, make an entry into the care_nursing_station_patients_diagnostics_report table
             *  for signalling purposes
             */
            signalNewDiagnosticsReportEvent($result_date, 'labor_test_request_printpop.php');
            //echo $sql;
            header("location:" . $thisfile . "?sid={$sid}&lang={$lang}&edit={$edit}&saved=update&pn={$pn}&station={$station}&user_origin={$user_origin}&status={$status}&target={$target}&subtarget={$subtarget}&batch_nr={$batch_nr}&noresize={$noresize}");
            exit;
        } else {
            echo "<p>{$sql}<p>{$LDDbNoSave}";
            $mode = '';
        }
        break;
        // end of case 'save'
    // end of case 'save'
Example #3
0
*/
$lang_tables = array('departments.php');
define('LANG_FILE', 'edp.php');
$local_user = '******';
require_once $root_path . 'include/inc_front_chain_lang.php';
require_once $root_path . 'include/care_api_classes/class_department.php';
$breakfile = 'dept_list_config.php' . URL_APPEND;
if (!isset($mode)) {
    $mode = '';
}
$dept_obj = new Department();
//$db->debug=1;
if ($mode) {
    switch ($mode) {
        case 'update':
            $_POST['history'] = $dept_obj->ConcatHistory("Update: " . date('Y-m-d H:i:s') . " = " . $_SESSION['sess_user_name'] . "\n");
            $_POST['modify_id'] = $_SESSION['sess_user_name'];
            $_POST['modify_time'] = date('YmdHis');
            $dept_obj->setTable('care_department');
            $dept_obj->setDataArray($_POST);
            $dept_obj->where = ' nr=' . $dept_nr;
            if ($dept_obj->updateDataFromInternalArray($dept_nr)) {
                header("location:dept_status_config.php" . URL_REDIRECT_APPEND . "&edit=1&updateok=1&dept_nr={$dept_nr}");
                exit;
            } else {
                echo "{$sql}<br>{$LDDbNoSave}";
            }
            break;
    }
    // end of switch
}