-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathticker.php
34 lines (29 loc) · 823 Bytes
/
ticker.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
<?php
require_once 'inc/standard.php';
foreach ($_GET as $key => $value) {
//echo '$user[\''.$key.'\'] = '.$value.';<br>';
$scan[$key] = trim(strip_tags($value));
}
$limit = ($_GET['view'] == 'all') ? '':'LIMIT 5';
if($scan['eid'])
{
$sql = 'SELECT barcodes.barcode, scans.*, users.name, users.ucinetid, users.major, users.level
FROM scans
LEFT JOIN barcodes
LEFT JOIN users
ON barcodes.ucinetid = users.ucinetid
ON barcodes.barcode = scans.barcode
WHERE scans.eid = "'.$scan['eid'].'"
ORDER BY scans.date DESC, scans.time DESC
'.$limit;
$DB->query($sql);
$output['scans'] = $DB->resultToArray();
}
else
{
$output['message']['text'] = "No Event Id Provided";
$output['message']['status'] = "error";
}
$DB->close();
echo json_encode($output);
?>