-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwireless.php
More file actions
86 lines (70 loc) · 2.33 KB
/
Copy pathwireless.php
File metadata and controls
86 lines (70 loc) · 2.33 KB
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
<?php
echo "<html>";
echo "<head>";
echo "<title>AutoNet\\ Wireless Information</title>";
echo "</head>";
echo "<body bgcolor=#009999 lang=EN-US style='tab-interval:.5in'>";
echo "<P fontsize=15 align=center> AutoNet\\ Wireless Information </p>";
echo "<br>";
echo "<br>";
/*$gotvar=$_GET['type'];
//echo $gotvar;
if ($gotvar=='sum') summary();
if ($gotvar=='full') full();
*/
//old_new();
form2();
//form();
function form2(){
echo "<BR><BR><BR>";
echo "<table border=1 align = center>";
echo "<tr>";
echo "<td>Building Name</td><td>Floor</td><td>Planned Number of Access Points</td><td>Installed Access Points</td><td> Get Info </td>";
echo "</tr>";
$host="127.0.0.1";
$user="root";
$password="rezasql";
# Connect to MySQL server
$conn = mysql_connect($host,$user,$password)
or die(mysql_error());
# Select the database
mysql_select_db("", $conn)
or die(mysql_error());
# Send SQL query
// $sql="select bld_newname, floor,old_name from Wireless group by 1,2 order by 1,2,3";
$sql="select bld, level, aps from wireless_plan order by 1,2";
// echo "<R> $sql<BR>";
$result = mysql_query($sql)
or die(mysql_error());
while ($row=mysql_fetch_assoc($result)){
echo "<tr><form name=form2 method=get action=wirelessinf.php>";
echo "<td><input name=bld type=text READONLY value=".$row['bld']."></td>";
echo "<td><input name=level type=text READONLY value=".$row['level']."></td>";
echo "<td>".$row['aps']."</td>";
getinstalled($row['bld'],$row['level']);
echo "<td><input type=submit value=GetInfo></td>";
echo "</tr></form>";
}
}
function getinstalled($bld,$level){
$host="127.0.0.1";
$user="root";
$password="rezasql";
# Connect to MySQL server
$conn = mysql_connect($host,$user,$password)
or die(mysql_error());
# Select the database
mysql_select_db("", $conn)
or die(mysql_error());
# Send SQL query
// $sql="select bld_newname, floor,old_name from Wireless group by 1,2 order by 1,2,3";
$sql="select count(*) as cnt from wireless_ap where bld='".$bld."' and level='".$level."'";
// echo "<R> $sql<BR>";
$result2 = mysql_query($sql)
or die(mysql_error());
$row=mysql_fetch_assoc($result2);
echo "<td>".$row['cnt']."</td>";
}
echo "</body>";
echo "</html>";
?>