-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathview_scope.php
executable file
·47 lines (41 loc) · 1.38 KB
/
view_scope.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
<?php
//require doctor username and password
//takes $_GET from addressbar
//in future OUTSIDE users may be varified by a mysql table , using $_GET
//use: <IP of server>/view_scope.php?code=GLC
function view_data_doctor($sql)
{
$link=mysql_connect('127.0.0.1','doctor','doctor');
mysql_select_db('biochemistry',$link);
if(!$result_id=mysql_query($sql,$link)){echo mysql_error();}
$array_id=mysql_fetch_assoc($result_id);
$first_data='yes';
if(!$result=mysql_query($sql,$link)){echo mysql_error();}
echo '<table border=1>';
while($array=mysql_fetch_assoc($result))
{
echo '<tr style="background-color:lightgray;"><th>Examination:'.$array['name_of_examination'].'</th><th>Sample:'.$array['sample_type'].'</th><th>Preservative:'.$array['preservative'].'</th></tr>';
foreach($array as $key=>$value)
{
if($key!='result' && $key!='sample_id')
if(strlen($value)>50)
{
echo '<tr><td>'.$key.'</td><td colspan=2><textarea cols=60>'.$value.'</textarea></td></tr>';
}
else
{
echo '<tr><td>'.$key.'</td><td colspan=2><pre>'.$value.'</pre></td></tr>';
}
}
}
echo '</table>';
}
if(isset($_GET['code']))
{
view_data_doctor('select * from scope where id<1000 and code=\''.$_GET['code'].'\' order by name_of_examination');
}
else
{
view_data_doctor('select * from scope where id<1000 order by name_of_examination');
}
?>