$link = start_nchsls();
    if (!($search_result = mysql_query($search_str, $link))) {
        echo mysql_error();
    }
    echo '<form method=post>';
    echo '<table border=1 bgcolor=lightblue>';
    echo '<tr><td><input type=submit name=critical value=save></td></tr>';
    while ($ar = mysql_fetch_assoc($search_result)) {
        prompt_critical_reportable($ar['sample_id']);
    }
    echo '</table>';
    echo '</form>';
} else {
    echo '<h1>No coditions are given for selecting records</h1>';
}
/*
            [critical] => save
           [result_1005_102907] => 2012-10-09 09:25:30=>root=>TO_XYZ
           [result_1005_102922] => 2012-10-09 09:25:05=>root=>TO_XYZ
           [result_1005_102934] => 2012-09-27 16:50:01=>root=>Not Done
           [result_1005_102952] => 2012-10-09 09:25:05=>root=>TO_XYZ
*/
if (isset($_POST['critical'])) {
    foreach ($_POST as $key => $value) {
        if ($key != 'critical') {
            $expl = explode('_', $key);
            save_single_examination($expl[2], $expl[1], $value);
            echo $key . '=>' . $value . '<br>';
        }
    }
}
Beispiel #2
0
function update_cross_reference($sample_id)
{
    $sql = 'select * from attachment where sample_id=\'' . $sample_id . '\'';
    //echo $sql;
    $link = start_nchsls();
    if (!($result = mysql_query($sql, $link))) {
        return FALSE;
    }
    $str = '';
    while ($array = mysql_fetch_assoc($result)) {
        $str = $str . ',' . $array['attachment_id'];
    }
    insert_single_examination($sample_id, 1008);
    save_single_examination($sample_id, 1008, $str);
}
Beispiel #3
0
function check_critical_reporting($sample_id)
{
    insert_single_examination($sample_id, 1005);
    $result = get_examination_result_id(1005, $sample_id);
    if (strlen($result == 0)) {
        save_single_examination($sample_id, 1005, strftime('%Y-%m-%d %H:%M:%S') . '=>' . $_SESSION['login'] . '=>TO_XYZ');
        return 8;
        //incomplate reporting
    } else {
        if (substr($result, -6, 6) != 'TO_XYZ') {
            return 0;
        } else {
            save_single_examination($sample_id, 1005, strftime('%Y-%m-%d %H:%M:%S') . '=>' . $_SESSION['login'] . '=>TO_XYZ');
            return 8;
            //incomplate reporting
        }
    }
}