ÿØÿà JFIF ` ` ÿþ
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 : |
<? include "../include/top_proc.html"; if(!$g_uid) exit; // 상품정보 $arr = good_list(" and g_uid='{$g_uid}' "); $row_good = $arr[0]; // 대리점 $data_member = member_fetch(" and mb_level='12' and del_flag='N' "); // 수정모드 $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']; } ?> <? ## 데이투어>단독투어 if( $row_good['tab']=="D" && $row_good['gdt']=="pe") { ?> <div style="height:300px; width:300px;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="59%">거래처명</th> <th width="32%">할인액(%)</th> </tr> <? 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> <td style="text-align:right;" height="28"><?=$arr_t['bz_agent_comm2']?><?=$arr_t['bz_agent_comm_unit']?> </td> </tr> <? } ?> </table> </div> <div style="width:646px;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_money1 = parseFloat($("#frmdate input[name='d_money1']").val().replace(/,/g,'')); var price_adult=0 ; if(comm_type=="A") { // 정액제 price_adult = Math.round(d_money1 - comm); }else if(comm_type=="B"){ // 정율제 price_adult = d_money1 - Math.round(d_money1*(comm/100)); }else return; price_adult = (price_adult<0) ? 0:price_adult; 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:300px;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="58%">거래처명</th> <th width="32%">할인액(%)</th> </tr> <? 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 class="ls-1" height="28"><?=$arr_t['bz_corp_nm']?></td> <td style="text-align:right;" height="28"><?=$arr_t['bz_agent_comm2']?><?=$arr_t['bz_agent_comm_unit']?> </td> </tr> <? } ?> </table> </div> <div style="width:606px;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="26%">거래처명</th> <th width="16%">성인</th> <th width="16%">소인</th> <th width="16%">유아</th> <th width="16%">영아</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><input name="agent_price_child_ar[]" class="input_text" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" type="text" size="11" value="<?=number_format($v['child_price'])?>"></td> <td><input name="agent_price_baby_ar[]" class="input_text" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" type="text" size="11" value="<?=number_format($v['baby_price'])?>"></td> <td><input name="agent_price_infant_ar[]" class="input_text" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" type="text" size="11" value="<?=number_format($v['infant_price'])?>"></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가격은 TK판매가(B2C)를 기준으로 자동입력 됩니다.<br>※해당 거래처을 체크 하신후, 거래처 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 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,'')); var d_money7 = parseFloat($("#frmdate input[name='d_money7']").val().replace(/,/g,'')); var price_adult=0 , price_child=0 , baby_price=0 , infant_price=0; if(comm_type=="A") { // 정액제 price_adult = Math.round(d_money1 - comm); price_child = Math.round(d_money2 - comm); price_baby = Math.round(d_money3 - comm); price_infant = Math.round(d_money7 - comm); }else if(comm_type=="B"){ // 정율제 price_adult = d_money1 - Math.round(d_money1*(comm/100)); price_child = d_money2 - Math.round(d_money2*(comm/100)); price_baby = d_money3 - Math.round(d_money3*(comm/100)); price_infant = d_money7 - Math.round(d_money7*(comm/100)); }else return; price_adult = (price_adult<0) ? 0:price_adult; price_child = (price_child<0) ? 0:price_child; price_baby = (price_baby<0) ? 0:price_baby; price_infant = (price_infant<0) ? 0:price_infant; price_adult = number_format(price_adult.toString()); price_child = number_format(price_child.toString()); price_baby = number_format(price_baby.toString()); price_infant = number_format(price_infant.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><input type='text' name='agent_price_child_ar[]' onKeyDown='ChkNum(this,event);' size='11' value='"+price_child+"' class='input_text' onblur='this.value=comma(this.value)'></td>"; str = str + "<td><input type='text' name='agent_price_baby_ar[]' onKeyDown='ChkNum(this,event);' size='11' value='"+price_baby+"' class='input_text' onblur='this.value=comma(this.value)'></td>"; str = str + "<td><input type='text' name='agent_price_infant_ar[]' onKeyDown='ChkNum(this,event);' size='11' value='"+price_infant+"' 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>"; 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(); } }); } }); }); </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"); } }); }); }); </script>