-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathview_data.php
executable file
·64 lines (50 loc) · 1014 Bytes
/
view_data.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
<?php
session_start();
include 'common.php';
if(!login_varify())
{
exit();
}
main_menu();
function get_sql()
{
$link=start_nchsls();
if(!$result=mysql_query('select * from view_data',$link)){echo mysql_error();}
echo '<form method=post>';
echo '<table border=1><tr><th colspan=20>Select the data to view</th></tr>';
$first_data='yes';
while($array=mysql_fetch_assoc($result))
{
if($first_data=='yes')
{
echo '<tr>';
foreach($array as $key=>$value)
{
echo '<th bgcolor=lightgreen>'.$key.'</th>';
}
echo '</tr>';
$first_data='no';
}
foreach($array as $key=>$value)
{
if($key=='id')
{
echo '<td><input type=submit name=id value=\''.$value.'\'></td>';
}
else
{
echo '<td>'.$value.'</td>';
}
}
echo '</tr>';
}
echo '</table>';
echo '</form>';
}
echo '<h2 style="page-break-before: always;"></h2>';
if(isset($_POST['id']))
{
view_data($_POST['id']);
}
get_sql();
?>