예제 #1
0
        $pdata[$row['paramater_name']] = $row['parameter_value'];
    }
}
if (!empty($pdata)) {
    $allow_update = TRUE;
} else {
    $allow_update = FALSE;
}
# Load the date formatter
include_once $root_path . 'include/inc_date_format_functions.php';
if ($mode == 'save') {
    $nbuf = array();
    //Prepare parameter values
    //gjergji
    while (list($z, $y) = each($_POST)) {
        if ($result_tests = $lab_obj->GetTestsToDo($job_id)) {
            while ($row_tests = $result_tests->FetchRow()) {
                if ($z == $row_tests['paramater_name']) {
                    $nbuf[$z] = $y;
                }
            }
        }
    }
    $dbuf['job_id'] = $job_id;
    $dbuf['encounter_nr'] = $encounter_nr;
    if ($allow_update == TRUE) {
        $dbuf['modify_id'] = $_SESSION['sess_user_name'];
        $dbuf['modify_time'] = date('YmdHis');
        # Recheck the date, ! bug pat	$dbuf['modify_id']=$_SESSION['sess_user_name'];
        if ($_POST['std_date'] == DBF_NODATE) {
            $dbuf['test_date'] = date('Y-m-d');
예제 #2
0
//pull out test date/time from form input; if not set default to current dates
if (isset($_POST['test_date']) && $_POST['test_date'] != DBF_NODATE && !empty($_POST['test_date'])) {
    $exam_date = formatDate2STD($_POST['test_date'], $date_format);
} else {
    $exam_date = date('Y-m-d');
}
if (isset($_POST['test_time']) && !empty($_POST['test_time'])) {
    $exam_time = $_POST['test_time'];
} else {
    $exam_time = date('H:i:s');
}
if ($mode == 'save') {
    $nbuf = array();
    //Prepare parameter values
    while (list($z, $y) = each($_POST)) {
        if ($result_tests = $lab_obj->GetTestsToDo($job_id, $encounter_nr)) {
            while ($row_tests = $result_tests->FetchRow()) {
                if ($z == $row_tests['paramater_name']) {
                    $nbuf[$z] = $y;
                }
            }
        }
    }
    $dbuf['job_id'] = $job_id;
    $dbuf['encounter_nr'] = $encounter_nr;
    if ($allow_update == TRUE) {
        //this is a save of test that already has some data entered
        //in this case, delete old values and re-insert new ones
        $dbuf['modify_id'] = $_SESSION['sess_user_name'];
        $dbuf['modify_time'] = date('YmdHis');
        $lab_obj_sub->deleteOldValues($batch_nr, $encounter_nr);