-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathedit_request.php
executable file
·102 lines (81 loc) · 2.63 KB
/
edit_request.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
<?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($value)
{
echo '<table border=1>
<form method=post action=edit_request.php >';
echo '<tr>';
echo '<td>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.'>'.$value.'</button></td></tr>';
echo '</form></table>';
}
if(!login_varify())
{
exit();
}
main_menu();
if(!isset($_POST['sample_id']) || !isset($_POST['action']))
{
read_sample_id('edit_sample');
}
elseif(isset($_POST['sample_id']) && isset($_POST['action']))
{
if($_POST['action']=='edit_sample')
{
edit_sample($_POST['sample_id'],'edit_request.php ','','no');
}
elseif($_POST['action']=='save_sample')
{
if(!save_sample($_POST))
{
echo 'no sample saved<br>';
}
else
{
edit_sample($_POST['sample_id'],'edit_request.php ','disabled','no');
edit_examination($_POST['sample_id'],'edit_request.php ','');
select_profile($_POST['sample_id'],'edit_request.php ');
select_examination($_POST['sample_id'],'edit_request.php ','');
}
}
elseif($_POST['action']=='profile')
{
insert_profile($_POST['sample_id'],$_POST['profile']);
edit_sample($_POST['sample_id'],'edit_request.php ','disabled','no');
edit_examination($_POST['sample_id'],'edit_request.php ','');
select_profile($_POST['sample_id'],'edit_request.php ');
select_examination($_POST['sample_id'],'edit_request.php ','');
}
elseif($_POST['action']=='save_examination')
{
save_examination($_POST);
edit_sample($_POST['sample_id'],'edit_request.php ','disabled','no');
edit_examination($_POST['sample_id'],'edit_request.php ','disabled');
echo '<form method=post target=_blank action=print_sample_barcode.php>';
echo '<button style="background:lightpink;" type=submit name=list_of_samples value=\''.$_POST['sample_id'].'\''.'>Barcode</button>';
echo '</form>';
select_profile($_POST['sample_id'],'edit_request.php ');
select_examination($_POST['sample_id'],'edit_request.php ','');
}
elseif($_POST['action']=='select_examination')
{
insert_single_examination($_POST['sample_id'],$_POST['id']);
edit_sample($_POST['sample_id'],'edit_request.php ','disabled','no');
edit_examination($_POST['sample_id'],'edit_request.php ','');
select_profile($_POST['sample_id'],'edit_request.php ');
select_examination($_POST['sample_id'],'edit_request.php ','');
}
}
?>