function insert_repeat($sample_id, $code, $result, $analysis_time) { $link = start_nchsls(); $all_data = get_all_data_of_examination($code, $sample_id); $sql = 'insert into repeat_examination (sample_id,code,analysis_time,result,previous_result,previous_result_analysis_time) values(\'' . $sample_id . '\',\'' . $code . '\',\'' . $analysis_time . '\',\'' . $result . '\',\'' . $all_data['result'] . '\',\'' . $all_data['sample_receipt_time'] . '\')'; //echo $sql; if (!mysql_query($sql, $link)) { echo mysql_error(); } }
function get_chronology_of_an_examination($code, $sample_id) { $chronology = FALSE; if ($sample_id_array = get_all_sample_id_from_sample_id($sample_id)) { foreach ($sample_id_array as $key => $value) { $chronology[$value] = get_all_data_of_examination($code, $value); } return $chronology; } return FALSE; }