-
Notifications
You must be signed in to change notification settings - Fork 1
/
getdevice.php
47 lines (45 loc) · 1.14 KB
/
getdevice.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
<?
include("bd.php");
$id_device = trim(htmlspecialchars(stripslashes($_GET['id_device'])));
if ($id_device!='')
{
$sql = "SELECT * FROM lightpoint_device WHERE id_device='$id_device'";
$result = mysql_query($sql,$db);
$myrow = mysql_fetch_array($result);
if (!empty($myrow['id_device']))
{
echo $myrow['id_device'].'<br>';
echo $myrow['device_name'].'<br>';
echo $myrow['version_device'].'<br>';
echo $myrow['id_group_device'].'<br>';
echo $myrow['serial'].'<br>';
echo $myrow['id_user'];
}
} else
{
$sql = "SELECT * FROM lightpoint_device";
$result = mysql_query($sql,$db);
while($myrow = mysql_fetch_array($result))
{
echo $myrow['id_device'].'<br>';
echo $myrow['device_name'].'<br>';
echo $myrow['version_device'].'<br>';
echo $myrow['id_group_device'].'<br>';
echo $myrow['serial'].'<br>';
echo $myrow['id_user'].'<br>';
}
}
function getdeviceinfo($id_device)
{
if ($id_device!='')
{
$sql = "SELECT * FROM lightpoint_device WHERE id_device='$id_device'";
$result = mysql_query($sql,$db);
} else
{
$sql = "SELECT * FROM lightpoint_device";
$result = mysql_query($sql,$db);
}
return $result;
}
?>