-
Notifications
You must be signed in to change notification settings - Fork 3
/
GidsVsSOC.php
37 lines (27 loc) · 943 Bytes
/
GidsVsSOC.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
<?php
require_once('connect.php');
session_start();
/* Not logged in: return blank data */
if(!isset($_SESSION['users_id']) || $_SESSION['users_id'] == 0) {
echo "date,gids,soc\n";
die();
}
$startString = "";
$endString = "";
$start = $_REQUEST['start'];
$end = $_REQUEST['end'];
if($start != null) {
$startString = " and leaflogs_timestamp >= '" . $start . "'";
}
if($end != null) {
$endString = " and leaflogs_timestamp <= '" . $end . "'";
}
$queryResult = mysql_query("select leaflogs_timestamp, leaflogs_gids, leaflogs_soc from leaflogs where leaflogs_user_id= " . $_SESSION['users_id'] . $startString . $endString . " order by leaflogs_timestamp");
if(!$queryResult) {
die("Query failed: " . mysql_error());
}
echo "date,gids,soc\n";
while($record = mysql_fetch_array($queryResult)) {
echo $record[0] . "," . $record[1] . "," . $record[2] . "\n";
}
?>