-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdb.php
More file actions
40 lines (31 loc) · 973 Bytes
/
db.php
File metadata and controls
40 lines (31 loc) · 973 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
37
38
39
40
<?php
/**
* By Tronsoftware tron@3tech.com.ar.
*/
$DeviceStatus[1]['class'] = 'success';
$DeviceStatus[1]['icon'] = 'glyphicon-screenshot';
$DeviceStatus[1]['marker'] = 'greenIcon';
$DeviceStatus[2]['class'] = 'info';
$DeviceStatus[2]['icon'] = 'glyphicon-ok-circle';
$DeviceStatus[2]['marker'] = 'blueIcon';
$DeviceStatus[3]['class'] = 'warning';
$DeviceStatus[3]['icon'] = 'glyphicon-remove-circle';
$DeviceStatus[3]['marker'] = 'yelowIcon';
$DeviceStatus[4]['class'] = 'danger';
$DeviceStatus[4]['icon'] = 'glyphicon-ban-circle';
$DeviceStatus[4]['marker'] = 'redIcon';
$hostname = 'localhost';
$username = 'user';
$password = 'pass';
$dbname = 'gts';
try {
$dbh = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password);
$sql = $dbh->prepare("SELECT * FROM Device");
if($sql->execute()) {
$sql->setFetchMode(PDO::FETCH_ASSOC);
}
}
catch(Exception $error) {
echo '<p>', $error->getMessage(), '</p>';
}
?>