-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrep_source.php
37 lines (33 loc) · 1.16 KB
/
rep_source.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
<?php
$flagNoAuth =true;
require ('common/auth.php');
require ('classes/reports.class.php');
include ('includes/inc-frame_top.php');
if (isset($_POST['budget_scenario'])){
$budget_scenario = $_POST['budget_scenario'];
}
if (isset($_POST['customer'])){
$sqlWhere = " AND customer=".$oSQL->e($_POST['customer']);
}
if (isset($_POST['activity'])){
$sqlWhere = " AND activity=".$oSQL->e($_POST['activity']);
}
if ($_POST['pccGUID']=='all' || $_POST['pccGUID']=='undefined' || !isset($_POST['pccGUID'])){
$strPCFilter = '';
} else {
$strPCFilter = " AND pccGUID=".$oSQL->e($_POST['pccGUID']);
}
$sql = "SELECT *,SUM(`Jan`+`Feb`+`Mar`+`Apr`+`May`+`Jun`+`Jul`+`Aug`+`Sep`+`Oct`+`Nov`+`Dec`+`Jan_1`+`Feb_1`+`Mar_1`) as amount FROM reg_master
JOIN vw_journal ON guid=source
LEFT JOIN stbl_user ON usrID=edit_by
WHERE item=".$oSQL->e($_POST['item'])." $strPCFilter $sqlWhere AND vw_journal.scenario='$budget_scenario'
GROUP BY guid
ORDER BY timestamp DESC";
echo '<pre>',$sql,'</pre>';
$rs =$oSQL->q($sql);
while ($rw=$oSQL->f($rs)){
$data[] = $rw;
}
Reports::getJournalEntries($data);
include ('includes/inc-frame_bottom.php');
?>