ÿØÿà 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/erp/ |
Upload File : |
<?php /* * * 상품 예약 > Estimate ajax * */ include "../include/top_proc.html"; // 신규예약 if(!$SqlType) $SqlType="res_ins"; // 상품정보 if ( $a_idx ) { $sql = "select * from TB_ERP_ALL where a_idx='{$a_idx}'"; $rs = db_query($sql); $row = db_fetch_array($rs) ; } $require_num_comma = " style=\"ime-mode:inactive;text-align:right\" onblur=\"this.value=calcu_esti(this.value)\" onKeyDown=\"ChkNum(this,event);\" "; // 가격입력시에 콤마+숫자필수 ?> <style> .setting_write tr.last, .setting_write td.last {border-bottom:#000 solid 2px;} </style> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top"> <div class="pop_title"><div class="lo_left">생성일차</div> </td> </tr> <tr> <td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="setting_write"> <tbody> <tr> <th width="70">생성일차</th> <td> <select name="date_num" id="date_num" class="" style="width:150px;" onchange="create_dateform();"> <option value="">==일차선택==</option> <?for ($i=1 ; $i<=14 ; $i++){?> <option value="<?=$i?>"><?=$i?>일</option> <?}?> </select> </td> </tr> </tbody> </table> </td> </tr> <tr> <td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="setting_write item_addon_price_box"> <colgroup> <col style=" width:10%" /> <col style=" width:10%" /> <col style=" width:2%" /> <col style=" width:2%" /> <col style=" width:48%" /> <col style=" width:7%" /> <col style=" width:7%" /> <col style=" width:7%" /> <col style=" width:7%" /> </colgroup> <thead> <tr> <th>Date</th> <th>Place</th> <th colspan="2">Time</th> <th>Itinerary</th> <th>Meals</th> <th class="bg_sky">항목</th> <th class="bg_sky">지출비용</th> <th class="bg_sky">판매비용</th> </tr> </thead> <tbody> </tbody> </table> </td> </tr> <tr> <td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="setting_write"> <colgroup> <col style=" width:19.8%" /> <col /> </colgroup> <tr> <th>Remarks</th> <td><textarea name="remarks" style="width:90%;height:100px"></textarea></td> </tr> </table> </td> </tr> <tr> <td valign="top" align="right"> <p> </p> <table width="30%" border="0" cellspacing="0" cellpadding="0" class="setting_write"> <colgroup> <col style=" width:60%" /> <col style=" width:20%" /> <col style=" width:20%" /> </colgroup> <tr> <th style="text-align:right;padding-right:10px">합계</th> <td style="text-align:right;padding-right:10px"><span id="esti_total_buy_price"></span></td> <td style="text-align:right;padding-right:10px"><span id="esti_total_sell_price"></span></td> </tr> <tr> <th style="text-align:right;padding-right:10px;color:red;font-weight:bold">회사수익</th> <td colspan="2" style="text-align:right;padding-right:10px;color:red;font-weight:bold"> <span id="esti_profit"></span> </td> </tr> </thead> <tbody> </tbody> </table> </td> </tr> </table> <script type="text/javascript"> // 생성일자 추가 function create_dateform() { // 생성일자 추가 스크립트 var html_addon_price =''; var date_num = $("#frm_reserv_good select[name='date_num']").val(); //선택된 일자 갯수 var date_num_count = parseInt('0'); $('input[name^="date_num_arr"]').each(function() { date_num_count = parseInt($(this).val()); }); if(date_num > date_num_count) { //++ var date_add = parseInt(date_num) - parseInt(date_num_count); var date_num2 = date_num_count + 1; for(var i=date_num2;i<=date_num;i++) { html_addon_price += '<tr>'; html_addon_price += ' <td rowspan="11" class="last" style="text-align:center">'+i+' Day<br><input name="day'+i+'" class="input_text"></td>'; html_addon_price += ' <td><input name="day'+i+'_place_arr[]" type="text" class="input_text" ></td>'; html_addon_price += ' <td><input name="day'+i+'_time_start_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_time_end_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_info_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_food_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_item_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_buy_arr[]" id="day'+i+'_buy1" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += ' <td><input name="day'+i+'_sell_arr[]" id="day'+i+'_sell1" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += '</tr>'; html_addon_price += '<tr>'; html_addon_price += ' <td><input name="day'+i+'_place_arr[]" type="text" class="input_text" ></td>'; html_addon_price += ' <td><input name="day'+i+'_time_start_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_time_end_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_info_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_food_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_item_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_buy_arr[]" id="day'+i+'_buy2" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += ' <td><input name="day'+i+'_sell_arr[]" id="day'+i+'_sell2" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += '</tr>'; html_addon_price += '<tr>'; html_addon_price += ' <td><input name="day'+i+'_place_arr[]" type="text" class="input_text" ></td>'; html_addon_price += ' <td><input name="day'+i+'_time_start_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_time_end_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_info_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_food_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_item_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_buy_arr[]" id="day'+i+'_buy3" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += ' <td><input name="day'+i+'_sell_arr[]" id="day'+i+'_sell3" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += '</tr>'; html_addon_price += '<tr>'; html_addon_price += ' <td><input name="day'+i+'_place_arr[]" type="text" class="input_text" ></td>'; html_addon_price += ' <td><input name="day'+i+'_time_start_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_time_end_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_info_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_food_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_item_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_buy_arr[]" id="day'+i+'_buy4" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += ' <td><input name="day'+i+'_sell_arr[]" id="day'+i+'_sell4" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += '</tr>'; html_addon_price += '<tr>'; html_addon_price += ' <td><input name="day'+i+'_place_arr[]" type="text" class="input_text" ></td>'; html_addon_price += ' <td><input name="day'+i+'_time_start_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_time_end_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_info_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_food_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_item_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_buy_arr[]" id="day'+i+'_buy5" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += ' <td><input name="day'+i+'_sell_arr[]" id="day'+i+'_sell5" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += '</tr>'; html_addon_price += '<tr>'; html_addon_price += ' <td><input name="day'+i+'_place_arr[]" type="text" class="input_text" ></td>'; html_addon_price += ' <td><input name="day'+i+'_time_start_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_time_end_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_info_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_food_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_item_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_buy_arr[]" id="day'+i+'_buy6" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += ' <td><input name="day'+i+'_sell_arr[]" id="day'+i+'_sell6" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += '</tr>'; html_addon_price += '<tr>'; html_addon_price += ' <td><input name="day'+i+'_place_arr[]" type="text" class="input_text" ></td>'; html_addon_price += ' <td><input name="day'+i+'_time_start_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_time_end_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_info_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_food_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_item_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_buy_arr[]" id="day'+i+'_buy7" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += ' <td><input name="day'+i+'_sell_arr[]" id="day'+i+'_sell7" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += '</tr>'; html_addon_price += '<tr>'; html_addon_price += ' <td><input name="day'+i+'_place_arr[]" type="text" class="input_text" ></td>'; html_addon_price += ' <td><input name="day'+i+'_time_start_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_time_end_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_info_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_food_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_item_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_buy_arr[]" id="day'+i+'_buy8" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += ' <td><input name="day'+i+'_sell_arr[]" id="day'+i+'_sell8" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += '</tr>'; html_addon_price += '<tr>'; html_addon_price += ' <td><input name="day'+i+'_place_arr[]" type="text" class="input_text" ></td>'; html_addon_price += ' <td><input name="day'+i+'_time_start_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_time_end_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_info_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_food_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_item_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_buy_arr[]" id="day'+i+'_buy9" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += ' <td><input name="day'+i+'_sell_arr[]" id="day'+i+'_sell9" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += '</tr>'; html_addon_price += '<tr>'; html_addon_price += ' <td><input name="day'+i+'_place_arr[]" type="text" class="input_text" ></td>'; html_addon_price += ' <td><input name="day'+i+'_time_start_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_time_end_arr[]" class="input_text" style="width:50px"></td>'; html_addon_price += ' <td><input name="day'+i+'_info_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_food_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_item_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="day'+i+'_buy_arr[]" id="day'+i+'_buy10" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += ' <td><input name="day'+i+'_sell_arr[]" id="day'+i+'_sell10" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += '</tr>'; html_addon_price += '<tr class="last">'; html_addon_price += ' <td> </td>'; html_addon_price += ' <td colspan=2>HOTEL Information</td>'; html_addon_price += ' <td><input name="hotel'+i+'_info_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td> </td>'; html_addon_price += ' <td><input name="hotel'+i+'_item_arr[]" class="input_text" style="width:100%"></td>'; html_addon_price += ' <td><input name="hotel'+i+'_buy_arr[]" id="hotel'+i+'_buy" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += ' <td><input name="hotel'+i+'_sell_arr[]" id="hotel'+i+'_sell" class="input_rtext" value="0" style="width:100%" <?=$require_num_comma;?>></td>'; html_addon_price += '<input type="hidden" name="date_num_arr[]" value="'+i+'">'; html_addon_price += '</tr>'; } $(".item_addon_price_box tbody").append(html_addon_price); } else { //-- //document.frm_reserv_good.elements['date_num_arr[]'].val() var date_num_count_tr = parseInt(date_num_count) * 11; var date_num_tr = parseInt(date_num) * 11; for(var i=date_num_count_tr; i>date_num_tr; i--) { $(".item_addon_price_box tr:eq("+i+")").remove(); } } } //합계 계산하기 function calcu_esti(val) { var date_num = $("#frm_reserv_good select[name='date_num']").val(); //선택된 일자 갯수 var total_day_buy = "0"; //각 상품 입금가 합계 var total_day_sell = "0"; //각 상품 판매가 합계 var total_hotel_buy = "0"; //각 호텔 입금가 합계 var total_hotel_sell = "0"; //각 호텔 판매가 합계 var total_buy_price = "0"; //상품 total입금가 + 호텔 total입금가 var total_sell_price = "0"; //상품 total판매가 + 호텔 total판매가 for(var i=1;i<=date_num;i++) { for(var j=1;j<=10;j++) { var each_day_buy = replaceComma($("#day"+i+"_buy"+j).val()); var each_day_sell = replaceComma($("#day"+i+"_sell"+j).val()); total_day_buy = parseInt(total_day_buy) + parseInt(each_day_buy); total_day_sell = parseInt(total_day_sell) + parseInt(each_day_sell); } var each_hotel_buy = replaceComma($("#hotel"+i+"_buy").val()); var each_hotel_sell = replaceComma($("#hotel"+i+"_sell").val()); total_hotel_buy = parseInt(total_hotel_buy) + parseInt(each_hotel_buy); total_hotel_sell = parseInt(total_hotel_sell) + parseInt(each_hotel_sell); } var total_buy_price = parseInt(total_day_buy) + parseInt(total_hotel_buy); var total_sell_price = parseInt(total_day_sell) + parseInt(total_hotel_sell); var esti_profit = parseInt(total_sell_price) - parseInt(total_buy_price); $("#esti_total_buy_price").html("₩ "+number_format(total_buy_price.toString())); $("#esti_total_sell_price").html("₩ "+number_format(total_sell_price.toString())); $("#esti_profit").html("₩ "+number_format(esti_profit.toString())); //comma val = get_number(val); if(val.length <= 3) return val; var loop = Math.ceil(val.length / 3); var offset = val.length % 3; if((val.length % 3)==0){ offset = 3; } var ret = val.substring(0, offset); for(i=1;i<loop;i++){ ret += "," + val.substring(offset, offset+3); offset += 3; } return ret; } </script>