-
Notifications
You must be signed in to change notification settings - Fork 2
/
new_request_FS.php
executable file
·108 lines (88 loc) · 2.82 KB
/
new_request_FS.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
session_start();
echo '<html>';
echo '<head>';
echo '</head>';
echo '<body>';
//echo '<pre>';
//print_r($GLOBALS);
//echo '</pre>';
include 'common.php';
function read_sample_id_FS($value)
{
echo '<table border=1>
<form method=post action=new_request_FS.php>';
echo '<tr>';
echo '<td>from_sample_id</td>';
echo '<td><input type=text name=from_sample_id ></td>';
echo '</tr>';
echo '<tr>';
echo '<td>to_sample_id</td>';
echo '<td><input type=text name=sample_id ></td>';
echo '</tr>';
echo '<tr><td colspan=2 align=center><button type=submit name=action value='.$value.'>new_sample Copy [F-S]</-></button></td></tr>';
echo '</form></table>';
}
if(!login_varify())
{
exit();
}
main_menu();
if(!isset($_POST['sample_id']) || !isset($_POST['action']))
{
read_sample_id_FS('new_sample');
}
elseif(isset($_POST['sample_id']) && isset($_POST['action']))
{
if($_POST['action']=='new_sample')
{
$link=start_nchsls();
if(! mysql_query('insert into sample(sample_id,sample_receipt_time,patient_id) values (\''.$_POST['sample_id'].'\',\''.strftime("%Y-%m-%d %H:%M:%S").'\',\'SUR/12/\')',$link))
{
echo mysql_error();
}
else
{
save_sample_FS($_POST['from_sample_id'],$_POST['sample_id']);
edit_sample($_POST['sample_id'],'new_request_FS.php ','','');
}
}
elseif($_POST['action']=='save_sample')
{
if(!save_sample($_POST))
{
echo 'no sample saved<br>';
}
else
{
edit_sample($_POST['sample_id'],'new_request_FS.php ','disabled','no');
select_profile($_POST['sample_id'],'new_request_FS.php ');
select_examination($_POST['sample_id'],'new_request_FS.php ','');
}
}
elseif($_POST['action']=='profile')
{
insert_profile($_POST['sample_id'],$_POST['profile']);
edit_sample($_POST['sample_id'],'new_request_FS.php ','disabled','no');
edit_examination($_POST['sample_id'],'new_request_FS.php ','');
select_profile($_POST['sample_id'],'new_request_FS.php ');
select_examination($_POST['sample_id'],'new_request_FS.php ','');
}
elseif($_POST['action']=='save_examination')
{
save_examination($_POST);
edit_sample($_POST['sample_id'],'new_request_FS.php ','disabled','no');
edit_examination($_POST['sample_id'],'new_request_FS.php ','disabled');
select_profile($_POST['sample_id'],'new_request_FS.php ');
select_examination($_POST['sample_id'],'new_request_FS.php ','');
}
elseif($_POST['action']=='select_examination')
{
insert_single_examination($_POST['sample_id'],$_POST['id']);
edit_sample($_POST['sample_id'],'new_request_FS.php ','disabled','no');
edit_examination($_POST['sample_id'],'new_request_FS.php ','');
select_profile($_POST['sample_id'],'new_request_FS.php ');
select_examination($_POST['sample_id'],'new_request_FS.php ','');
}
}
?>