-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrep_monthly_ghq.php
87 lines (69 loc) · 2.57 KB
/
rep_monthly_ghq.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
$flagNoAuth = true;
require ('common/auth.php');
require ('classes/budget.class.php');
require ('classes/reports.class.php');
include ('includes/inc_report_settings.php');
$oBudget = new Budget($budget_scenario);
if ($reference!=$oBudget->reference_scenario->id){
$oReference = new Budget($reference);
$strVsTitle = ' vs '.$oReference->title;
} else {
$reference = $oBudget->reference_scenario->id;
}
if(isset($_GET['currency'])){
$sql = "SELECT * FROM vw_currency WHERE curID={$currency} LIMIT 1";
$rs = $oSQL->q($sql);
$rw = $oSQL->f($rs);
echo '<h2>',$rw["curTitle$strLocal"],'</h2>';
}
// include ('includes/inc_report_ghqfilter.php'); /// filter and tabs for GHQ product
if (isset($_GET['prtGHQ'])){
$filter['prtGHQ'] = urldecode($_GET['prtGHQ']);
}
if (isset($_REQUEST['filter'])){
$user_filter = $_REQUEST['filter'];
$filter = array_merge($filter, $user_filter);
}
$oReport = new Reports(Array('budget_scenario'=>$budget_scenario, 'currency'=>$currency, 'denominator'=>$denominator, 'reference'=>$reference, 'filter'=>$filter));
switch ($_POST['DataAction']){
case 'kpiByCustomer':
$oReport->kpiByCustomerMR();
die();
break;
default:
if(!isset($_GET['prtGHQ'])){
$arrJS[]='js/rep_pnl.js';
// $arrJS[]='js/input_form.js';
$arrActions[] = Array ('title'=>'By customer group','action'=>"?type=customer_group");
$arrActions[] = Array ('title'=>'By customer','action'=>"?type=customer");
$arrActions[] = Array ('title'=>'By activity','action'=>"?type=activity");
// $arrActions[] = Array ('title'=>'By GHQ type','action'=>"?type=ghq");
$arrActions[] = Array ('title'=>'By BDV staff','action'=>"?type=sales");
$arrActions[] = Array ('title'=>'By PC','action'=>"?type=pc");
$arrActions[] = Array ('title'=>'By BDV dept','action'=>"?type=bdv");
?>
<script>
function getDetails(params){
$('#details').detach();
$('<div>',{id:'details'}).load(location.href, params , function(){
$(this).dialog({
'title':'Details for '+params.title,
'modal':true,
'width':'80%'
});
});
}
</script>
<?php
include ('includes/inc-frame_top.php');
echo '<h1>',$arrUsrData["pagTitle$strLocal"],': ',$oBudget->title,$strVsTitle,'</h1>';
include ('includes/inc_report_selectors.php');
echo '<p>',$oBudget->timestamp,'; ',$oBudget->rates,'</p>';
$oBudget::getGHQTabs();
include ('includes/inc-frame_bottom.php');
} else {
$oReport->monthlyReportGHQ($type);
}
}
?>