-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrepeat_check.php
executable file
·63 lines (52 loc) · 1.52 KB
/
repeat_check.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
session_start();
echo '<html>';
echo '<head>';
echo '</head>';
echo '<body>';
//echo '<pre>';
//print_r($GLOBALS);
//echo '</pre>';
include 'common.php';
function read_data()
{
echo '<table border=1>
<form method=post action=repeat_check.php>';
echo '<tr>';
echo '<td>sample_id</td>';
echo '<td><input type=text name=sample_id ></td>';
echo '<td>code</td>';
echo '<td><input type=text name=code ></td>';
echo '<td>result</td>';
echo '<td><input type=text name=result ></td>';
echo '<td>analysis_time</td>';
echo '<td><input type=text name=analysis_time value=\''.strftime('%Y-%m-%d %H:%M:%S').'\' ></td>';
echo '</tr>';
echo '<tr><td align=center><button type=submit name=submit>submit</button></td></tr>';
echo '</form></table>';
}
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();
}
}
if(!login_varify())
{
exit();
}
main_menu();
if(isset($_POST['submit']))
{
insert_repeat($_POST['sample_id'],$_POST['code'],$_POST['result'],$_POST['analysis_time']);
}
read_data();
view_data(16);
?>