-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathajaxMicro.php
41 lines (34 loc) · 1.1 KB
/
ajaxMicro.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
<?php
/*
* As a work of the United States government, this project is in the public domain within the United States.
*/
/*
Index for simple, non-security sensitive responses
Date Created: June 6, 2011
*/
error_reporting(E_ERROR);
require_once getenv('APP_LIBS_PATH') . '/loaders/Leaf_autoloader.php';
$action = isset($_GET['a']) ? $_GET['a'] : '';
switch ($action) {
// Get the timestamp of the last action
case 'lastaction':
if (!isset($_GET['recordID']))
{
$res = $db->prepared_query('SELECT time FROM action_history
ORDER BY time DESC
LIMIT 1', array());
echo isset($res[0]['time']) ? $res[0]['time'] : 0;
}
else
{
$vars = array('recordID' => $_GET['recordID']);
$res = $db->prepared_query('SELECT time FROM action_history
WHERE recordID = :recordID
ORDER BY time DESC
LIMIT 1', $vars);
echo isset($res[0]['time']) ? $res[0]['time'] : 0;
}
break;
default:
break;
}