ÿØÿà 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/toadmin/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; // 거래처 미사용 ///////////////////////////////////////////////////////// //테이블명 $table = "TB_RES_GOOD"; // 검색 설정 $sql_where = ""; $sql_where .= " and producer_id='{$TO_MB['mb_id']}'"; //공급처 //$sql_where .= " and order_state in('B', 'C', 'D', 'E', 'F')"; // 취소 G H //배열에 저장 $data = array(); $sql = "select * from {$table} as res where 1 {$sql_where} "; $rs = db_query($sql); $total_count = $total_price = 0; // 기본 판매처 리스트 $agent_price = array( "kkday" => 0, "klook" => 0, "trip.com" => 0, "tkplace" => 0, "naver" => 0, "tourboss" => 0, "coupang" => 0, "tmon" => 0 ); $total_inwon = $total_inwon_cancel = 0; for($i=0 ; $row = db_fetch_array($rs) ; $i++) { // 매출액 price / 인원 inwon / 건 count // 여행인원 $sql = "SELECT COUNT(seq) AS inwon FROM TB_RES_GOOD_PERSON WHERE res_no='".$row['res_no']."' "; $person_data = db_fetch($sql); $row['inwon'] = $person_data['inwon']; if($row['order_state'] != 'H') { // 공급가 합계 $total_price += $row['buy_total']; // 총 인원 $total_inwon += $row['inwon']; // 연별 합계 $y = substr($row['ev_start'], 0, 4); // YYYY $year_inwon[$y] += $row['inwon']; $year_count[$y] += 1; $year_price[$y] += $row['buy_total'];; // 월별 합계 $ym = substr($row['ev_start'], 0, 7); // YYYY-mm $month_inwon[$ym] += $row['inwon']; $month_count[$ym] += 1; // 판매처별 통계 (연간) if($y == date('Y')){ $agent_price[$row['agent_id']] += $row['buy_total']; } } else { // 총 인원 $total_inwon_cancel += $row['inwon']; } } // 예약취소율 $total_inwon_rate = round(($total_inwon / $total_inwon_cancel), 1); // 이달의 예약인원 $this_month_inwon = $month_inwon[date('Y-m')]; // 매출성장가능성 (연간 2배씩 상승) for($i = 0; $i < 4; $i++){ $year_title[] = date('Y') + $i; $year_value[] = $year_price[date('Y')] * pow(2, $i); } $year_title_str = "\"" . implode("\",\"", $year_title) . "\""; $year_value_str = implode(",", $year_value); // 판매처별 데이터 foreach($agent_price as $k => $v){ $row_agent = get_member($k); if($row_agent['bz_cd'] == 'MAGN001') { // 국내 $home_inwon[$row_agent['bz_corp_nm']] = round($v / 10000); } else { // 해외 $oversea_inwon[$row_agent['bz_corp_nm']] = round($v / 10000); } } // 국내 판매처 연간 매출순위 arsort($home_inwon); foreach($home_inwon as $k => $v){ $home_title[] = $k; $home_value[] = $v; } $home_title_str = "\"" . implode("\",\"", $home_title) . "\""; $home_value_str = implode(",", $home_value); // 해외 판매처 연간 매출순위 arsort($oversea_inwon); foreach($oversea_inwon as $k => $v){ $oversea_title[] = $k; $oversea_value[] = $v; } $oversea_title_str = "\"" . implode("\",\"", $oversea_title) . "\""; $oversea_value_str = implode(",", $oversea_value); ?> <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> <!-- https://chartjs-plugin-datalabels.netlify.app/ --> <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> <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"> <span class="cir_title">총 예약인원</span> <?=number_format($total_inwon)?>명 </li> <li class="rep_circle box_shadow"> <span class="cir_title">총 취소인원</span> <?=number_format($total_inwon_cancel)?>명 </li> <li class="rep_circle box_shadow" style="color:#FF8152;"> <span class="cir_title">예약 취소율</span> <?=$total_inwon_rate?>% </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"> var ctx = document.getElementById("myChart1").getContext('2d'); var myChart = new Chart(ctx, { type: 'bar', data: { labels: [<?=$year_title_str?>], datasets: [{ barThickness: 25, label: '매출성장가능성 (결제금액 기준)', data: [<?=$year_value_str?>], 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: [<?=$home_title_str?>], datasets: [{ barThickness: 25, label: '국내 판매처 연간 매출순위 (만원)', data: [<?=$home_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) { console.log(context); var value = context.dataset.data[context.dataIndex]; return value > 100 ? 1:0; } } } } }); var ctx3 = document.getElementById("myChart3").getContext('2d'); var myChart = new Chart(ctx3, { type: 'bar', data: { labels: [<?=$oversea_title_str?>], datasets: [{ barThickness: 25, label: '해외 판매처 연간 매출순위 (만원)', data: [<?=$oversea_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; } } } } }); </script> <? include "../include/footer.html" ?>