-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrep_customer_group.php
50 lines (44 loc) · 1.46 KB
/
rep_customer_group.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
// $flagNoAuth = true;
require ('common/auth.php');
require ('classes/reports.class.php');
$oBudget = new Budget($budget_scenario);
$pc = $_GET['pc']?(integer)$_GET['pc']:$arrUsrData['usrProfitID'];
$sql = "SELECT customer_group_code, cntTitle, SUM(".$oBudget->getThisYTDSQL('ytd').") as YTD
FROM reg_master
LEFT JOIN common_db.tbl_counterparty ON cntID=customer_group_code
WHERE
scenario IN ('{$arrSetup['stpFYEID']}','{$arrSetup['stpScenarioID']}')
AND company={$company}
AND (pc={$pc} OR bdv={$pc})
".Reports::GOP_FILTER."
GROUP BY customer_group_code
ORDER BY YTD DESC
LIMIT 50
";
$rs = $oSQL->q($sql);
while ($rw = $oSQL->f($rs)){
$arrJQCloud[] = Array('text'=>$rw['cntTitle'],'weight'=>(integer)$rw['YTD'],'link'=>"rep_sales_kpi_new.php?cntID={$rw['customer_group_code']}");
}
$arrJS[] = "../common/jquery/jQCloud/jqcloud/jqcloud-1.0.4.min.js";
$arrCSS[] = "../common/jquery/jQCloud/jqcloud/jqcloud.css";
include ('includes/inc-frame_top.php');
?>
<div id='cloud' style='width:1900px; height: 900px;'></div>
<script>
$(document).ready(function(){
var width = $('body').css('width');
var height = $('body').css('height')/2;
$('#cloud').css({'width':width,'height':height});
var words = <?php echo json_encode($arrJQCloud); ?>;
$('#cloud').jQCloud(words,{
autoResize: true,
fontSize: {
from: 6,
to: 72
}
});
});
</script>
<?php
include ('includes/inc-frame_bottom.php');