-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.php
More file actions
36 lines (33 loc) · 881 Bytes
/
list.php
File metadata and controls
36 lines (33 loc) · 881 Bytes
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
<?php
include "db.php";
$dbcon = new dbcon();
$con = $dbcon->connect();
$query = "select distinct host,port from host";
$stmt = $con->prepare($query);
$stmt->execute();
$res = $stmt->fetchAll(PDO::FETCH_ASSOC);
if(count($res)) {
$html = '<table class="table table-striped">
<thead>
<tr>
<th style="text-align:center">Host Name</th>
<th style="text-align:center">Port</th>
<th style="text-align:center">Currnt Status</th>
</tr>
</thead>
<tbody>';
foreach($res as $key=>$value) {
$html.='<tr class="row_value">
<td class="host">'.$value['host'].'</td>
<td class="port">'.$value['port'].'</td>
<td class="status"><img src="/ping/img/dot_loader.gif"></img></td>
</tr>';
}
$html.='</tbody>
</table>';
}
else {
$html = 'Host name not available.. please add';
}
print $html;
?>