-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathajax.table.php
50 lines (39 loc) · 955 Bytes
/
ajax.table.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
48
49
50
<?php
define('SEP',",");
define('EOR',"\n");
global $plog_level; $plog_level=1;
include 'core/Page.php';
if ( !Session::logged_in() ) Page::Redirect('login');
$getpost=getpost();
$report=intval($getpost['Report']);
$low=$getpost['Low'];
$high=$getpost['High'];
$one_day=false;
if ( strtotime($low) > strtotime($high) ) {
if ( strlen($high) > 0 ) {
$flip=$low;
$low=high;
$high=$flip;
} else {
if ( strlen($low) > 0 ) {
$one_day=true;
} else {
echo 'Unable to generate a report without a valid date.'; var_dump($getpost); die;
}
}
}
if ( strlen($low) == 0 ) {
echo 'Unable to generate a report without a start date.'; var_dump($getpost); die;
}
$output='';
$report_name=CSVReportType::name($report);
global $database;
echo $csv;
$csv=fromcsv($csv);
echo '<table><tr>';
foreach ( $csv as $row ) {
foreach ( $row as $column ) {
echo '<td>'.$column.'</td>';
}
}
echo '</tr></table>';