ÿØÿà JFIF ` ` ÿþ
Server : Apache System : Linux ruga7-004.fmcity.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : tkt_travelbus ( 1137) PHP Version : 7.0.0p1 Disable Function : mysql_pconnect Directory : /tkt_travelbus/www/admin/agent_info/ |
Upload File : |
<? include "../../Lib/config.php"; if( ($_COOKIE['MemberLevel'] == $cf['agent_level'] || $_COOKIE['MemberLevel'] == $cf['trade_level']) ) { include "../include/top_agent.html"; } else { include "../include/top.html"; $b2b_not_mode = true; //대리점 또는 공급처 외 } if($agent_mode) exit; // 거래처 미사용 $bus_corp = getBusCorpInfo($TK_MEMBER['mb_id']); $bc_idx_s = $bus_corp['bc_idx']; $tableName = "TB_ERP_BUS"; //총 매출액 $sql = "SELECT SUM(total_buy_price) AS totalBuyPrice FROM {$tableName} WHERE bc_idx = {$bc_idx_s}"; $totalBuyPrice = db_fetch($sql); $totalBuyPrice = $totalBuyPrice['totalBuyPrice']; //총 예약건 $sql = "SELECT count(*) AS totalResCnt FROM {$tableName} WHERE bc_idx = {$bc_idx_s}"; $totalResCnt = db_fetch($sql); $totalResCnt = $totalResCnt['totalResCnt']; $thisMonth = date('Y-m'); //이달의 예약건 $sql = "SELECT count(*) AS thisMonthResCnt FROM {$tableName} WHERE bc_idx = {$bc_idx_s} AND start_date LIKE '{$thisMonth}%' "; $thisMonthResCnt = db_fetch($sql); $thisMonthResCnt = $thisMonthResCnt['thisMonthResCnt']; $graphResData = array(); //통계 그래프용 월별 키값 넣기 $thisYear = date("Y"); for($i = 1; $i <= 12; $i++){ $ii = $i; if(strlen($i) == 1){ $ii = '0'.$i; } $graphResData[$thisYear.'-'.$ii] = 0; } //올해 월별 예약건 $sql = "SELECT * FROM {$tableName} WHERE bc_idx = {$bc_idx_s} AND start_date LIKE '{$thisYear}-%'"; $thisYearResCnt = db_query($sql); while($rowData = db_fetch_array($thisYearResCnt)){ $startDate = explode(" ",$rowData['start_date']); $startDate = $startDate[0]; $startDate = explode("-", $startDate); $startDate = $startDate[0].'-'.$startDate[1]; $graphResData[$startDate] += 1; } ?> <style> .rep_block { position:relative; display:block; float:left; background-color:#FFF; border-radius:10px; margin-bottom:10px; padding:10px 50px; box-sizing: border-box; } .rep_block li { position:relative; display:block; float:left; margin:40px; width:260px; height:260px; box-sizing: border-box; } .rep_circle { display:block; border-radius:130px; padding-top:90px; text-align:center; font-size:35px; line-height:30px; font-weight:900; color:#5AC8DB; } .cir_title { display:block; margin-bottom:15px; font-size:24px; color:#333; } </style> <?php $idx = 1; foreach($graphResData as $key => $value){ ?> <input type="hidden" id="graphMonth<?=$idx?>" value="<?=$value?>" /> <?php $idx += 1; } //성장가능성 $nowYear = date("Y"); $untilYear = $nowYear + 3; $expectedSalesYearLabel = array(); $expectedSalesYearAmount = array(); $idx = 1; $expectedSalesYearAmountBase = $totalBuyPrice; for($i = $nowYear; $i <= $untilYear; $i++){ $expectedSalesYearAmountBase = $expectedSalesYearAmountBase * $idx; array_push($expectedSalesYearLabel, $i); array_push($expectedSalesYearAmount, $expectedSalesYearAmountBase); if($idx == 2){ }else{ $idx += 1; } } ?> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2.0.0"></script> <?php $idx = 1; foreach($expectedSalesYearLabel as $item){ ?> <input type="hidden" id="expectedSalesYearLabel<?=$idx?>" value="<?=$item?>" /> <?php $idx += 1; } ?> <?php $idx = 1; foreach($expectedSalesYearAmount as $item){ ?> <input type="hidden" id="expectedSalesYearAmount<?=$idx?>" value="<?=$item?>" /> <?php $idx += 1; } ?> <div class="contents_wrap" > <div class="contents_wrap_in" style="background-color:#EEEEEE;"> <div class="title"> <strong><?=_e('예약현황');?></strong> </div> <div class="contents_detail"> <div id="Content_box" style="margin-top:10px;"> <div style="display:block; width:100%;"> <div class="rep_block" style="width:100%;"> <li class="rep_circle box_shadow" style="font-size:30px;"> <span class="cir_title">총 매출액</span> <?=number_format($totalBuyPrice)?>원 </li> <li class="rep_circle box_shadow"> <span class="cir_title">총 예약건</span> <?=number_format($totalResCnt)?>건 </li> <li class="rep_circle box_shadow"> <span class="cir_title">이달의 예약건</span> <?=number_format($thisMonthResCnt)?>건 </li> <li style="width:400px;"> <canvas id="myChart1" width="400" height="400"></canvas> </li> </div> <div class="rep_block" style="width:50%; margin-right:5px;"> <canvas id="myChart2" width="800" height="350"></canvas> </div> <div class="rep_block" style="width:calc(50% - 10px); margin-left:5px;"> <canvas id="myChart3" width="800" height="350"></canvas> </div> </div> </div> </div> </div> </div> <script type="text/javascript"> expectedSalesYearLabel = new Array(); expectedSalesYearAmount = new Array(); for(i = 1; i <= 4; i++){ expectedSalesYearLabel.push(document.getElementById('expectedSalesYearLabel' + i).value); expectedSalesYearAmount.push(document.getElementById('expectedSalesYearAmount' + i).value); } // console.log(expectedSalesYearLabel); // console.log(expectedSalesYearAmount); var ctx = document.getElementById("myChart1").getContext('2d'); var myChart = new Chart(ctx, { type: 'bar', data: { labels: expectedSalesYearLabel, datasets: [{ barThickness: 25, label: '매출성장가능성 (매출액 기준)', data: expectedSalesYearAmount, backgroundColor: [ '#5AC8DB' ] }] }, options: { maintainAspectRatio: false, scales: { x: { grid:{ display:false } }, y: { } }, plugins: { legend: { labels: { font: {size: 14}, padding : 20, boxWidth : 15 } } } } }); var ctx2 = document.getElementById("myChart2").getContext('2d'); var myChart = new Chart(ctx2, { type: 'bar', data: { labels: [<?=$nat_title_str?>], datasets: [{ barThickness: 25, label: '연간 국적별 예약분석 (건)', data: [<?=$nat_value_str?>], backgroundColor: [ '#5AC8DB' ] }] }, plugins: [ChartDataLabels], options: { maintainAspectRatio: false, indexAxis: 'y', scales: { x: { }, y: { grid:{ display:false } } }, plugins: { legend: { labels: { font: {size: 14}, padding : 20, boxWidth : 15 } }, datalabels: { color: '#FFF', anchor: 'end', align: 'start', offset: 10, formatter: function(value, context) { return number_format(value); }, display: function(context) { var value = context.dataset.data[context.dataIndex]; return value > 100 ? 1:0; } } } } }); var nowDate = new Date; var thisYear = nowDate.getFullYear(); // 연도 thisDateList = new Array(); for(i = 1; i <= 12; i++){ ii = i.toString(); if(ii.length == 1){ ii = '0' + ii; } thisDateList.push(thisYear + '-' + ii); } graphData = new Array(); maxResCnt = ''; for(i = 1; i <= 12; i++){ graphValue = document.getElementById('graphMonth'+i).value; if(maxResCnt == ''){ maxResCnt = graphValue; }else{ if(graphValue > maxResCnt){ maxResCnt = graphValue; } } graphData.push(graphValue); } bgColorArr = new Array(); for(i = 0; i < 11; i++){ bgColorArr.push('#5AC8DB'); } maxResIdx = graphData.indexOf(maxResCnt); bgColorArr[maxResIdx] = '#FF8152'; var ctx3 = document.getElementById("myChart3").getContext('2d'); var myChart = new Chart(ctx3, { type: 'bar', data: { labels: thisDateList, datasets: [{ barThickness: 25, label: '월별 예약 현황 (건)', data: graphData, backgroundColor: bgColorArr }] }, plugins: [ChartDataLabels], options: { maintainAspectRatio: false, scales: { x: { grid:{ display:false } }, y: { } }, plugins: { legend: { labels: { font: {size: 14}, padding : 20, boxWidth : 15 } }, datalabels: { color: '#FFF', font : { size : 9 }, anchor: 'end', align: 'start', offset: 10, formatter: function(value, context) { return number_format(value); }, display: function(context) { console.log(Chart.scales); var value = context.dataset.data[context.dataIndex]; return value > 10 ? 1:0; } } } } }); </script> <? include "../include/footer.html" ?>