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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

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

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

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

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

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




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

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


$sql="
		SELECT a.admin_id,a.admin_nm,a.emp_depart_cd,COUNT(a.res_no) AS res_cnt,
					 SUM(a.sales_total_cost) total_cost,SUM(a.sales_total) total,IF(SUM(b.bank_input)>0,SUM(b.bank_input),0) input,
					 SUM(a.sales_total)-IF(SUM(b.bank_input)>0,SUM(b.bank_input),0) pre  
		FROM (	
			SELECT r.*,m.emp_depart_cd FROM (
				 (SELECT 
								res_no,left(rental_dt,10) as rental_dt,left(ins_dt,10) as ins_dt,res_daesu,car_nm,agent_corp_nm,res_cust_hp,res_cust_nm,
								rental_cidx_nm,admin_id,admin_nm,sales_total_cost,sales_total  
				 FROM TB_RES_RENTCAR WHERE admin_id IS NOT NULL AND admin_id <> '' AND left({$date_s},10) BETWEEN '{$key_date2_s}' AND '{$key_date3_s}' and res_stat_cd='C' ) r,
				 (SELECT mb_id,emp_depart_cd FROM TB_MEMBER WHERE mb_level < 10 ) m 
			 )  WHERE m.mb_id=r.admin_id
					) a,
				 (SELECT res_no, SUM(bank_plus) AS bank_input FROM TB_ACCOUNT_CUSTOMER WHERE delflag='N' GROUP BY res_no) b 
		WHERE a.res_no=b.res_no  AND a.emp_depart_cd IS NOT NULL AND a.emp_depart_cd <> ''
		GROUP BY a.admin_nm
		ORDER BY a.{$date_s} 
";

$rs = db_query($sql);

$data = db_fetch_all($rs);

$total = count($data);
?>
    <div class="contents_wrap">
    <div class="contents_wrap_in">
    	<div class="title">담당자별 매출현황</div>
      <div class="contents_detail">

      <ul class="register_tab">
				<li><a href="../calculate/car_period.html">기간별 매출</a></li>
				<li><a href="../calculate/car_prepay.html">미수금 현황</a></li>
				<li class="on"><a href="../calculate/car_admin.html">담당자별 매출</a></li>
				<li><a href="../calculate/car_depart.html">부서별 매출</a></li>
				<li><a href="../calculate/car_brench.html">지점별 매출</a></li>
				<li><a href="../calculate/car_agent.html">대리점별 매출</a></li>
			</ul>


      <div class="top_txt_s">
      	<div class="bar_wrap">
      	<p class="search_result_txt lo_left"><span><?=$total?></span> 건이 검색되었습니다.</p>
        <div class="btn_excel">
        <img src="../image/btn/btn_print.gif" alt="인쇄하기" style="cursor:pointer;" onclick="page_print('print_div');" />
        </div>
        </div>
      </div>
      <div class="calculate_wrap">
			<!-- 폼 -->
			<form name="frm_search" id="frm_search" method="get" style="margin:0px;padding:0px;">
      	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="t_r_register" >
        <thead>
        <tr>
      	<td colspan="2" class="t_top_line"></td>
      	</tr>
        <tr>
      	<td colspan="2" class="top_txt2">담당자별 매출현황</td>
      	</tr>
        </thead>
        <tbody>
			<tr>
			<th width="80">대여기간</th>
			<td class="input_lo">
			<div class="lo_left"  style="margin-top:7px;">
			<select name="date_s">
				<option value="rental_dt" <?=($date_s=="rental_dt")?"selected":""?>>출발일</option>
				<option value="ins_dt" <?=($date_s=="ins_dt")?"selected":""?>>예약일</option>
			</select>
			</div>
			<ul class="btn_day lo_left">
				<li style="cursor:pointer;" onClick="$('#key_date2_s').val('<?=date("Y-m")?>-01');$('#key_date3_s').val('<?=date("Y-m-d")?>');">이번달</li>
				<li style="cursor:pointer;" onClick="$('#key_date2_s').val('<?=date("Y-m",strtotime(" -1 month"))?>-01');$('#key_date3_s').val('<?=date("Y-m",strtotime(" -1 month"))?>-31');">지난달</li>
			</ul>
			<div class="lo_left" style="margin-top:7px;">
				<div class="lo_left calendar_wrap">
					<input name="key_date2_s" id="key_date2_s" type="text" class="calendar_input" size="12" onclick="AjaxCal(this,event);" value="<?=$key_date2_s?>" readonly/>
				</div> <span class="lo_left prl5">~</span> 
				<div class="lo_left calendar_wrap">
					<input name="key_date3_s" id="key_date3_s" type="text" class="calendar_input" size="12" onclick="AjaxCal(this,event);" value="<?=$key_date3_s?>" readonly/> 
				</div>
				<input type="image" src="../image/btn/btn_search.gif" align="top" alt="검색" class="input_img" />
			</div>
			</td>
			</tr>

				</tbody>
				</table>
			</form>
			<!-- /폼 -->
				<!-- print area -->
				<DIV id="print_div">
				<table width="100%" border="0" cellspacing="0" cellpadding="0" class="t_c_list2 mt20" >
        <colgroup>
        <col style=" width:100px" />
				<col />
        <col style=" width:60px" />
        <col style=" width:100px" />
        <col style=" width:100px" />
        <col style=" width:100px" />
        <col style=" width:100px" />
        <col style=" width:100px" />
        </colgroup>
        <thead>
        <tr>
      	<td colspan="10" class="t_top_line"></td>
      	</tr>
      	<tr>
      	<th scope="col">담당자명</th>
				<th scope="col">부서명</th>
      	<th scope="col">예약건수</th>
      	<th scope="col">판매가</th>
      	<th scope="col">판매원가</th>
				<th scope="col">판매수익</th>
      	<th scope="col">입금</th>
      	<th scope="col">미입금</th>
      	</tr>
        </thead>
        <tbody>
				<?
				$res_cnt_tot=0;
				$inwon_tot=0;
				$total_tot=0;
				$input_tot=0;
				$pre_tot=0;
				$cost_tot=0;
				$profit=0;
				$profit_tot=0;
				for($i=0 ; $i < count($data) ; $i++){
					$row = $data[$i];
					
					$tmp_arr = base_codec("CRP","DEPT",$row['emp_depart_cd']);
					$emp_depart_nm = $tmp_arr[0]['cd_nm'];

					$inwon_tot		+=$row['inwon'];
					$total_tot		+=$row['total'];
					$cost_tot			+=$row['total_cost'];
					$input_tot		+=$row['input']; // 입금;
					$pre_tot			+=$row['pre']; // 미입금
					$profit = (int)$row['total'] - (int)$row['total_cost']; // 수익->판매금액-판매원가
					$profit_tot += $profit;

					$res_cnt_tot += $row['res_cnt'];
				?>
      	<tr height="30">
				<td class="t_contents"><?=$row['admin_nm']?></td>
      	<td><?=$emp_depart_nm?></td>
				<td><?=$row['res_cnt']?></td>
      	<td style="text-align:right;"><?=number_format($row['total'])?></td>
				<td style="text-align:right;"><?=number_format($row['total_cost'])?></td>
				<td style="text-align:right;"><?=number_format($profit)?></td>
      	<td style="text-align:right;"><?=number_format($row['input'])?></td>
      	<td style="text-align:right;"><?=number_format($row['pre'])?></td>
      	</tr>
				<?
				}
				?>
      	<tr style="font-weight:bold;"  height="30">
      	<td class="t_contents" colspan="2" style="text-align:right;padding-right:20px;">계</td>
				<td><?=$res_cnt_tot?></td>
      	<td style="text-align:right;"><?=number_format($total_tot)?></td>
				<td style="text-align:right;"><?=number_format($cost_tot)?></td>
				<td style="text-align:right;"><?=number_format($profit_tot)?></td>
      	<td style="text-align:right;"><?=number_format($input_tot)?></td>
      	<td style="text-align:right;"><?=number_format($pre_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 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