ÿØÿà 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/toadmin/erp/ |
Upload File : |
<? include "../../Lib/config.php"; if( ($_COOKIE['MemberLevel'] == $cf['agent_level'] || $_COOKIE['MemberLevel'] == $cf['trade_level']) ) { echo "<script>history.back();</script>"; } include "../include/top.html"; include "_common.html"; //테이블명 $table = "TB_ERP_BUS"; // 정렬 if (!$order_by_s OR ($order_by_s=="ins_dt desc")) { $order_by_s = " ins_dt desc, b_idx desc"; } // 보여줄 개수 if(!$list_count_s) $list_count_s = 30; // 연도 기본값 if(!$period_yy_s) $period_yy_s = date('Y'); // 검색 설정 $sql_where = ""; if ($search_key_s and $search_word_s) { $sql_where .= " and {$search_key_s} like '%{$search_word_s}%' "; // 검색어 } if ($bc_idx_s) { $sql_where .= " and bc_idx='{$bc_idx_s}' "; // 버스회사 } if ($mode_period_s) { $sql_where .= " and ( DATE_FORMAT({$mode_period_s},'%Y-%m-%d') >= '{$date_s1}' and DATE_FORMAT({$mode_period_s},'%Y-%m-%d') <= '{$date_s2}' )"; } if ($srh_esti_state) { $sql_where .= " and esti_state='{$srh_esti_state}' "; // 진행상태 } // 전체 개수 $data_gres = db_fetch("SELECT COUNT(b_idx) AS res_gtot FROM {$table} where 1 {$sql_where} "); $total= $data_gres['res_gtot']; // 페이지수 설정 if (!$page) $page = 1; // 페이지 번호 $line = $list_count_s; // 보여줄 갯수 $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=" {$order_by_s} "; // Limit $limit = " $olds , $line "; //if(devCookie()){ // p($schedule_name); if($schedule_name){ $sql_where .= " AND schedule_name LIKE '%{$schedule_name}%' "; } //} $sql = "select * from TB_ERP_BUS where 1 {$sql_where} order by {$sql_order} limit {$limit}"; $rs = db_query($sql); //총견적금액 //$data_amount = db_fetch("select SUM(total_sell_price) as total_price, SUM(total_sell_price - bus_price) as total_profit from {$table} where 1 {$sql_where} "); //$total_price= $data_amount['total_price']; //$total_profit= $data_amount['total_profit']; //if(devCookie()){ //총 공급가 $total_price = 0; $total_profit = 0; //정산완료 총정산금액 $totalCalcuCompletedPrice = 0; //미정산 총정산금액 $totalCalcuNotCompletedPrice = 0; $data_amountSQL = "SELECT * FROM {$table} WHERE 1 {$sql_where}"; $res = db_query($data_amountSQL); while($row = db_fetch_array($res)){ if ($row['esti_state'] == 'Y') { $totalCalcuCompletedPrice += (int) $row['bus_price']; }else{ $totalCalcuNotCompletedPrice += (int) $row['bus_price']; } $total_price += (int) $row['bus_price']; $total_profit += (int) $row['total_sell_price'] - $row['bus_price']; } //} $today = date("Y-m-d H:i:s"); if($order_by_s){ $startDateOrderType = "asc"; $startDateOrderTypeFile = "_asc"; if(strpos($order_by_s,'desc') !== false){ $startDateOrderType = "desc"; $startDateOrderTypeFile = "_desc"; } }else{ $startDateOrderType = ""; $startDateOrderTypeFile = ""; } ?> <style> .busStateColorY{background:#333 !important;color:#fff} .memoSaveBtn{cursor:pointer;display:none;clear: both;float: right;background: midnightblue;color: #fff;width: 30px;padding: 2px;border-radius: 3px;margin-right: 4px;margin-top: 3px;} </style> <div class="contents_wrap"> <div class="contents_wrap_in"> <div class="title"><strong>버스예약 리스트</strong></div> <div class="contents_detail"> <? require_once("bus_list_search.php"); // 검색폼 ?> <div id="Content_box"> <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="" class="c_top_table" style="margin-top:22px; margin-bottom:20px;font-size:14px;position:relative;top:-4px"> <colgroup> <col width="150px" /> <col /> </colgroup> <tbody> <tr class="bot_line" style="height:40px"> <td style="font-size:14px"> <span><a href="javascript:;" class="c_red">검색 <?=$total?>개</a> │ 검색된 예약 (총 정산금액 : <a href="javascript:;" class="c_black_b"><?=number_format($total_price)?>원</a> <?php if($srh_esti_state != 'Y' && $srh_esti_state != 'N'){ ?> │ 정산 금액 : <?=number_format($totalCalcuCompletedPrice)?> 원 │ 미정산 금액 : <?=number_format($totalCalcuNotCompletedPrice)?> 원 <?php } ?> │ 총 회사수익 :<a href="javascript:;" class="c_blue_b"> <?=number_format($total_profit)?>원)</span> </td> </tr> </tbody> </table> <!-- 폼 --> <form name="frm_list" id="frm_list" method="post"> <input type="hidden" name="SqlType" value="chg_esti_state"> <input type="hidden" name="getValue" value="<?=$_SERVER['REQUEST_URI']?>" /> <div class="c_top_sch_wrap"> <p class="c_top_sch_l"> <span>선택된 정산을</span> <select class="mt-3 ml10" name="esti_state" id="" hname="" required> <option value="">---------</option> <option value="N">미정산(예약완료)</option> <option value="Y">정산완료</option> </select> <?php // if(devCookie()){ // $TO_MB['mb_level'] = 3; // } ?> <a href="javascript:;" class="Tbtn gray2 ml5 item_chg_esti_state">일괄처리</a> <span class="ml20">선택된 정산을</span> <?if($TO_MB['mb_level']==1 || $TO_MB['mb_level']==2) {?> <a href="javascript:;" class="Tbtn gray2 ml5 delete_estimate">삭제</a> <? } ?> <a href="javascript:;" class="Tbtn gray2 ml5 cancel_estimate">취소</a> </p> <style> #tourTypeList{float: left;margin-left: 20px;padding:5px 10px;border: 1px solid #aaa;border-radius: 3px !important;padding-top: 4.5px !important;padding-bottom: 4.5px !important;text-align: center;background: #f7f7f7;-webkit-appearance: auto !important;} #tourTypeList ul{float:left;width:100%} #tourTypeList li{float:left} #tourTypeList li div,#tourTypeList li p{float:left} #tourTypeList li div{width:25px;height:17px;border-radius:3px;margin:0 5px;} #tourTypeList li p{font-size:12px;position:relative;top:1px;margin-right:3px;font-weight:400;color:#111} .colorBar{color:#999 !important;} </style> <ul id="tourTypeList"> <?php $idx = 1; foreach($busResColorList as $word => $colorValue){ ?> <li> <div style="background:<?=$colorValue?>"></div> <p><?=$word?></p> <?php if($idx == count($busResColorList)){ }else{ echo "<p class='colorBar'>|</p>"; } ?> </li> <?php $idx +=1; } ?> </ul> <?php $returnUrl = str_replace("?","quququ",$_SERVER['REQUEST_URI']); $returnUrl = str_replace("&","ananan",$returnUrl); ?> <!-- 상품정렬 --> <ul class="c_top_sch_r"> <li><input type="button" class="Tbtn red" value="버스예약등록" onclick="to_dialog.iframe('bus_edit.php?returnUrl=<?=$returnUrl?>','버스예약등록','800','830',true,true,'yes');"> <li><a href="javascript:;" class="Tbtn" onclick="to_excel('<?=urlencode($sql_where)?>','<?=urlencode($sql_order)?>');" ><img src="../image/btn/ico_excel.gif" alt="엑셀" /> 엑셀저장</a></li> <li class="ml10"> <select name="order_by_s" id="order_by_s"> <option value="ins_dt desc" <?=($order_by_s=="ins_dt desc")?"selected":""?>>정산서등록일 ↑</option> <option value="ins_dt" <?=($order_by_s=="ins_dt")?"selected":""?>>정산서등록일 ↓</option> <option value="start_date desc" <?=($order_by_s=="start_date desc")?"selected":""?>>버스운행일 ↑</option> <option value="start_date" <?=($order_by_s=="start_date")?"selected":""?>>버스운행일 ↓</option> </select> </li> <li> <select name="list_count_s" id="list_count_s" > <option value="30" <?=($list_count_s==30) ? "selected" : ""?>>30개 보기</option> <option value="50" <?=($list_count_s==50) ? "selected" : ""?>>50개 보기</option> <option value="70" <?=($list_count_s==70) ? "selected" : ""?>>70개 보기</option> <option value="100" <?=($list_count_s==100) ? "selected" : ""?>>100개 보기</option> </select> </li> </ul><!-- 상품등록 --> </div> <table border="0" cellspacing="0" cellpadding="0" class="t_list" width="100%"> <thead> <tr> <th style="width:10px"><label for="checkall" class="v_none2">선택 체크</label><input type="checkbox" name="checkall" id="checkall" value="" /></th> <th style="width:25px">복사</th> <th style="width:41px">상태</th> <th style="width:72px">예약접수일</th> <th style="width:85px"> 운행일 <a href="#" class="order_icon" order_name="start_date" order_type="<?=$startDateOrderType?>"> <img src="/toadmin/image/common/icon_sort<?=$startDateOrderTypeFile?>.png"> </a> </th> <th style="width:100px">고객명</th> <th style="width:40px">국적</th> <th style="width:115px">연락처</th> <th style="width:70px">항공편</th> <th style="width:60px">미팅시간</th> <th style="width:300px">출발지</th> <th style="width:300px">도착지</th> <th style="width:40px">인원</th> <th style="width:40px">짐개수</th> <th style="display:none;width:80px">행사명</th> <th style="display:none;">버스회사명</th> <th style="display:none;width:110px">차량종류</th> <th style="width:82px">차량번호</th> <th style="width:100px">기사정보</th> <th style="width:70px">공급가</th> <th style="display:none;width:120px">판매가격ⓐ</th> <th style="display:none;width:100px;color:#d63038;font-weight:normal">정산소계ⓑ</th> <th style="display:none;width:100px;color:blue;font-weight:normal">회사수익(ⓐ-ⓑ)</th> <!-- <th style="width:200px">메모 <input type="button" value="저장" onClick="memo_save('frm_list');" class="Table_btn gray"</th>--> <th style="width:60px">세부사항</th> </tr> </thead> <tbody> <? for($i=0 ; $i < $row = db_fetch_array($rs) ; $i++){ $newdate = date("Y-m-d H:i:s", strtotime("+3 day", strtotime($row['ins_dt']))); // NEW 아이콘 $bus_corp = db_fetch("SELECT * FROM TB_ERP_BUS_CORP where bc_idx='{$row[bc_idx]}' "); // 버스회사 $row['start_date'] = str_replace("-", ".", $row['start_date']); $row['end_date'] = str_replace("-", ".", $row['end_date']); // $profit = $row['total_sell_price'] - $row['total_buy_price']; $profit = $row['bus_price']; if($profit < 0) { $profit_color = "color:red;"; } else { $profit_color = "color:blue;"; } $cus_name = $row['cus_name']; $cus_nation = $row['cus_nation']; $cus_phone = $row['cus_phone']; $cus_flight = $row['cus_flight']; $cus_meeting_time = $row['cus_meeting_time']; $cus_depature_place = $row['cus_depature_place']; $cus_destination = $row['cus_destination']; $cus_people_cnt = $row['cus_people_cnt']; $cus_luggage_bag = $row['cus_luggage_bag']; $start_date = substr($row['start_date'], 0, 10); $end_date = substr($row['end_date'], 0, 10); if($start_date == $end_date) { $bus_date = $start_date; } else { $bus_date = $start_date . " ~<br>" . $end_date; } ?> <tr class="<?=(($row['res_stat_cd'] == "D") ? 'cancel_line2' : '' )?>" id="row-<?=$row['b_idx']?>"> <td><input type="checkbox" name="idx_no_arr[]" class="item_checkbox_res" value="<?=$row['b_idx']?>" /></td> <td><img src="../image/icon/btn_copy.gif" onclick="bus_copy('<?=$row['b_idx']?>')" title="복사" style="cursor:pointer;"/></td><!-- 복사 --> <td onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');" class="busStateColor<?=$row['esti_state']?>" style="<?=(($row['esti_state'] != 'Y' && !$bus_corp['corp_nm']) ? "background:{$busResColorList['미등록']} !important" : '')?>;cursor:pointer"> <? if($row['esti_state'] == 'Y') { ?> 정산<br>완료 <? } else { ?> <?=(($bus_corp['corp_nm']) ? '미정산' : '미등록')?> <? } ?> </td><!-- 진행상태 --> <td style="cursor:pointer" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"><?=$row['ins_dt']?></td><!-- 예약접수일 --> <td style="cursor:pointer" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"><b style="color:#000"><?=$bus_date?></b></td><!-- 운행날짜 --> <td style="cursor:pointer" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"><b style="color:#000"><?=$cus_name?></b></td><!-- 고객명 --> <td style="cursor:pointer" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"><?=$cus_nation?></td><!-- 국적 --> <td style="cursor:pointer" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"><?=$cus_phone?></td><!-- 고객연락처 --> <td style="cursor:pointer" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"><?=$cus_flight?></td><!-- 항공편명 --> <td style="cursor:pointer" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"><?=$cus_meeting_time?></td><!-- 미팅시간 --> <td onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');" style="text-align:left"><?=$cus_depature_place?></td><!-- 출발지 --> <td onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');" style="text-align:left"><?=$cus_destination?></td><!-- 도착지 --> <td style="cursor:pointer" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"><?=$cus_people_cnt?></td><!-- 인원 --> <td style="cursor:pointer" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"><?=$cus_luggage_bag?></td><!-- 짐개수 --> <td class="t_title" style="display:none;cursor:pointer;" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"> <?=$row['schedule_name']?> <?if($today <= $newdate) : ?> <img src="../image/new.gif"> <? endif; ?> <?php if($row['MFILE1']){ ?> <img src="../../image/board/bullet_disk.gif" align="absmiddle" alt="첨부파일"> <?php } ?> </td><!-- 행사명 --> <td style="display:none;cursor:pointer;" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"><?=(($bus_corp['corp_nm']) ? $bus_corp['corp_nm'] : '미정')?></td><!-- 버스회사 --> <td onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');" style="display:none"><?=(($row['bus_model']) ? $row['bus_model'] : '미정')?></td><!-- 차량종류 --> <td style="cursor:pointer" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"><?=(($row['bus_number']) ? $row['bus_number'] : '미정')?></td><!-- 차량번호 --> <td style="cursor:pointer;text-align:center" align="center" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"> <?=(($row['driver_name']) ? $row['driver_name'] : '미정')?> <?php // if(devCookie()){ if($row['MFILE1']){ ?> <img src="../../image/board/bullet_disk.gif"> <?php } // } if($row['MFILE2']){ ?> <img src="../../image/board/bullet_disk.gif"> <?php } ?> <br> <?=(($row['driver_phone']) ? $row['driver_phone'] : '미정')?> </td><!-- 기사명 --> <td style="cursor:pointer" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"><?=number_format($row['bus_price'])?></td><!-- 공급가 --> <td style="display:none;text-align:right;padding-right:10px"> ₩ <?=number_format($row['total_sell_price'])?> </td><!-- 판매가격 --> <td style="display:none;text-align:right;padding-right:10px;cursor:pointer;" class="c_red" onclick="to_dialog.iframe('bus_edit.php?b_idx=<?=$row['b_idx']?>','버스예약수정','800','830',true,true,'yes');"> ₩ <?=number_format($row['total_buy_price'])?></td><!-- 정산소계 --> <td style="display:none;text-align:right;padding-right:10px;<?=$profit_color?>"> ₩ <?=number_format($profit)?> </td> <td> <!-- <textarea class="eMemoArea" id="busResMemo--><?php //=$row['b_idx']?><!--" bidx="--><?php //=$row['b_idx']?><!--" name="e_memo_arr[]" style="width:95%;height:45px">--><?php //=$row['schedule']?><!--</textarea>--> <input type="button" value="VIEW" class="Table_btn eMemoArea" id="busResMemo<?=$row['b_idx']?>" bidx="<?=$row['b_idx']?>"> <input type="hidden" name="memo_idx_arr[]" value="<?=$row['b_idx']?>" /> <p class="memoSaveBtn" id="memoSaveBtn-<?=$row['b_idx']?>" bidx="<?=$row['b_idx']?>">저장</p> </td><!-- 메모 --> </tr> <tr id="schedule<?=$row['b_idx']?>" bidx="<?=$row['b_idx']?>" style="display:none;background:#edf0f5"> <th colspan="4" style="background:#edf0f5;border-right:1px solid #fff !important;">스케줄<br>(특이사항)</th> <td style="background:#edf0f5;text-align:left;padding-left:10px" colspan="14"><?=$row['schedule']?></td> </tr> <? } ?> </tbody> </table> </form> <!-- 폼 --> <?php if($bc_idx_s){ $rhref .= '&bc_idx_s='.$bc_idx_s; } echo adm_get_paging($total_page, $page, $list, "?$rhref&page=", ""); ?> </div> </div> </div> </div> <script type="text/javascript"> var res_good_num=''; $(document).ready(function(){ $("#order_by_s").on("change",function(){ var order_by_s = $("#order_by_s").val(); var list_count_s = $("#list_count_s").val(); startMarkUrl = '?'; if(location.href.indexOf('?') > 0){ startMarkUrl = '&'; } location.href = location.href += startMarkUrl + 'order_by_s='+order_by_s+'&list_count_s='+list_count_s; }); $("#list_count_s").on("change",function(){ var order_by_s = $("#order_by_s").val(); var list_count_s = $("#list_count_s").val(); startMarkUrl = '?'; if(location.href.indexOf('?') > 0){ startMarkUrl = '&'; } location.href = location.href += startMarkUrl + 'order_by_s='+order_by_s+'&list_count_s='+list_count_s; }); $(".order_icon").on("click",function(){ var order_type = $(this).attr('order_type'); if(order_type == 'desc') { // 반대로 바꿈 order_type = ""; } else { order_type = " desc"; } var order_by_s = $(this).attr('order_name') + order_type; var list_count_s = $("#list_count_s").val(); startMarkUrl = '?'; if(location.href.indexOf('?') > 0){ startMarkUrl = '&'; } location.href = location.href += startMarkUrl + 'order_by_s='+order_by_s+'&list_count_s='+list_count_s; }); $("#checkall").on("click",function(){ $(".item_checkbox_res").prop("checked",$(this).prop("checked")); }); $(".item_checkbox_res").on("click",function(){ // console.log($(this).val()); // console.log($(this).prop('checked')); resNo = $(this).val(); console.log('resNo is ' + resNo); if($(this).prop('checked')){ $('#row-'+resNo +' td').css('border-top','2px solid #57ADb5'); $('#row-'+resNo +' td').css('border-bottom','2px solid #57ADb5'); $('#row-'+resNo +' td:nth-child(1)').css('border-left','1px solid #57ADb5'); $('#row-'+resNo +' td:last-child').css('border-right','1px solid #57ADb5'); $('#row-'+resNo +' td').css('background','#fffCEB'); }else{ $('#row-'+resNo).css('border','1px solid #e4e4e4'); $('#row-'+resNo +' td').css('border-top','1px solid #e4e4e4'); $('#row-'+resNo +' td').css('border-bottom','1px solid #e4e4e4'); $('#row-'+resNo +' td:nth-child(1)').css('border-left','1px solid #e4e4e4'); $('#row-'+resNo +' td:last-child').css('border-right','1px solid #e4e4e4'); $('#row-'+resNo +' td').css('background','unset'); } }); $(".item_chg_esti_state").on("click",function(){ if($(".item_checkbox_res:checked").length==0){ alert('적어도 한개 항목을 선택해 주세요.'); return; } if(!confirm('진행상태를 변경하시겠습니까?')) return; var f = document.frm_list; f.SqlType.value = "update_order"; f.action = "bus_proc.php"; f.submit(); }); $(".delete_estimate").on("click",function(){ var cnt = parseInt($(".item_checkbox_res:checked").length); if(cnt==0) { alert('적어도 한개 항목을 선택해 주세요.'); return; } if(!confirm('선택된 정산을 삭제하시겠습니까?')) return; var f = document.frm_list; f.SqlType.value = "del_order"; f.action = "bus_proc.php"; f.submit(); }); $(".cancel_estimate").on("click",function(){ var cnt = parseInt($(".item_checkbox_res:checked").length); if(cnt==0) { alert('적어도 한개 항목을 선택해 주세요.'); return; } if(!confirm('선택된 정산을 취소하시겠습니까?')) return; var f = document.frm_list; f.SqlType.value = "cancel_order"; f.action = "bus_proc.php"; f.submit(); }); }); <?php if(devCookie()){ ?> <?php }else{ ?> //엑셀출력 <?php } ?> function to_excel(sql_where,sql_order) { if(!confirm('1,000건이하로 엑셀다운로드됩니다.\n시간이 소요될수 있습니다.\n엑셀파일을 다운로드 하시겠습니까?')) return; document.location.href='bus_excel.php?sql_where='+sql_where+'&sql_order='+sql_order; } // 메모저장 function memo_save(){ if(confirm('전체 메모를 수정하시겠습니까?')){ document.querySelectorAll('.memoSaveBtn').length; for(i = 0; i < document.getElementsByClassName('memoSaveBtn').length; i++){ if(document.getElementsByClassName('memoSaveBtn')[i].style.display == 'block'){ bidx = document.getElementsByClassName('memoSaveBtn')[i].getAttribute('bidx'); if(parseInt(bidx) > 0 ){ saveMemo(bidx); } } } } } // 메모수정 /*function memo_save() { if (!confirm('메모를 수정하시겠습니까?')) return; document.frm_list.SqlType.value = "memo_ins"; document.frm_list.action = "bus_proc.php?s=1<?=$_rhref?>"; document.frm_list.submit(); }*/ // 확정유무수정 function confirm_save() { if (!confirm('수정하시겠습니까?')) return; document.frm_list.SqlType.value = "confirm_ins"; document.frm_list.action = "bus_proc.php?s=1<?=$_rhref?>"; document.frm_list.submit(); } // erp copy function bus_copy(b_idx) { var params = "&b_idx="+b_idx+"<?=$_rhref?>"; if(!b_idx) return; if (!confirm('복사를 진행하시겠습니까?')) return; ajax_post("","bus_proc.php?SqlType=copy_order"+params); } <?php if($_GET['task'] == 'busResWindow'){ ?> to_dialog.iframe('bus_edit.php','버스예약등록','800','780',true,true,'yes'); <?php } ?> $('.eMemoArea').click(function(){ bidx = $(this).attr('bidx'); if($('#schedule'+bidx).css('display') == 'none'){ $('#schedule'+bidx).show(); $('#busResMemo'+bidx).val('CLOSE'); }else{ $('#schedule'+bidx).hide(); $('#busResMemo'+bidx).val('VIEW'); } }); $('.memoSaveBtn').click(function(){ bidx = $(this).attr('bidx'); saveMemo(bidx); }); function saveMemo(bidx) { if (!bidx) { iziToast.show({ timeout: 3000, color: 'red', title: '메모저장오류발생', message: '적용 실패 개발자에게 문의주세요.', }); return false; } eMemoContents = $('#busResMemo' + bidx).val(); // console.log('gMemoContents is ' + gMemoContents); $.ajax({ type: "post", url: "/toadmin/ajaxData/", dataType: 'json', data: {'mode': 'setResEmemo', bidx, eMemoContents}, async: false, success: function (data) { console.log('data is ' + JSON.stringify(data)); if (data.result == true) { $('#busResMemo' + bidx).val(data.eMemoContents); iziToast.show({ timeout: 1000, color: 'green', title: '메모', message: '저장되었습니다.', }); } else { iziToast.show({ timeout: 10000, color: 'red', title: '메모', message: '저장 실패 - 개발자에게 문의하세요.', }); } }, error: function (a, b, c) { console.log(JSON.stringify(a)); console.log(b); console.log(c); console.log('error'); iziToast.show({ timeout: 10000, color: 'red', title: 'PHP ERROR 관리자 메모', message: '저장 실패 - 개발자에게 문의하세요.', }); } }); // console.log('resSeq is ' + resSeq); $('#memoSaveBtn-'+bidx).slideUp(); } </script> <? include "../include/footer.html" ?>