ÿØÿà 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/ticket/ |
Upload File : |
<? include "../include/top.html"; include "_common.php"; //테이블명 $table = " TB_TICKET_GRP "; // 검색 설정 $sql_where = ""; if($search_key and $search_word) { if($search_key == 'producer_nm') { $sql_where .= " and producer_id in (select mb_id from TB_MEMBER where bz_corp_nm like '%{$search_word}%' and mb_level = 13)"; } else { $sql_where .= " and {$search_key} like '%".$search_word."%' ";// 검색어(상품명,행사명,행사코드,담당자명) } } if ($producer_id) $sql_where .= " and producer_id='{$producer_id}' "; // 공급처 if ($group_code) $sql_where .= " and group_code='{$group_code}' "; // 티켓그룹코드 // 검색결과 수량 $sql = "select count(*) as cnt from {$table} where 1=1 {$sql_where}"; $rs = db_fetch($sql); $total = $rs['cnt']; // 페이지수 설정 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 = "producer_id asc, seq desc"; // 데이터 $sql = "select * from {$table} as TG where 1=1 "; if($sql_where) $sql .= " ".$sql_where; if($sql_order) $sql .= " order by ".$sql_order . ", seq desc"; if($olds>=0 and $line>0) $sql .= " limit $olds , $line"; $rs = db_query($sql); $i=0; while($rows = db_fetch_array($rs)){ $data[$i] = $rows; $i++; } ?> <div class="contents_wrap"> <div class="contents_wrap_in"> <div class="title"> <strong>티켓그룹관리</strong> </div> <div class="contents_detail"> <? // 검색폼 //require_once("ticket_list_search.php"); ?> <form name="frm_search" method="POST" action="<?=$PHP_SELF?>"> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="order_by_s" value="<?=$order_by_s?>"> <input type="hidden" name="list_count_s" value="<?=$list_count_s?>"> <div class="c_top_bar" style="float:left;margin-bottom:10px"> <ul class="c_top_search"> <li> <select name="search_key" id="search_key"> <option value="group_nm" <?if($search_key=='group_nm') echo "selected";?>>그룹명</option> <option value="group_code" <?if($search_key=='group_code') echo "selected";?>>그룹코드</option> <option value="producer_nm" <?if($search_key=='producer_nm') echo "selected";?>>공급처명</option> <option value="producer_id" <?if($search_key=='producer_id') echo "selected";?>>공급처ID</option> </select> </li> <li> <label for="search_word" class="v_none2">검색어 입력</label> <input class="search_box" id="search_word" name="search_word" type="text" value="<?=$search_word?>" /><input type="image" src="../image/btn/btn_search.gif" align="top" alt="검색" class="input_btn_search" /> </li> </ul> </div> <div class="c_top_sch_wrap" style="float:right"> <ul class="c_top_sch_r"> <li> <a href="javascript:;" class="Tbtn red" onclick="javascript:document.location.href='ticket_group_edit.html';">티켓그룹등록</a> <a href="javascript:;" class="Tbtn gray" onclick="javascript:document.location.href='ticket_list.html';">티켓관리</a> </li> <li class="ml10"> </li> <li> <select name="list_count_s" id="list_count_s" > <option value="50" <?=($list_count_s==50)?"selected":""?>>50개 보기</option> <option value="100" <?=($list_count_s==100)?"selected":""?>>100개 보기</option> <option value="200" <?=($list_count_s==200)?"selected":""?>>200개 보기</option> </select> </li> </ul><!-- 상품등록 --> </div> </form> <div id="Content_box"> <!-- 폼 --> <form name="frm_list" id="frm_list" method="post"> <input type="hidden" name="SqlType" value="" /> <style> .t_list th {padding:5px 3px 5px 3px;} </style> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="t_list"> <caption>티켓 그룹 수정 및 관리</caption> <colgroup> <col style="width:60px" /> <col style="width:220px" /> <col style="" /> <col style="width:130px" /> <col style="width:90px" /> <col style="width:75px" /> <col style="width:75px" /> <col style="width:75px" /> <col style="width:75px" /> <col style="width:75px" /> <col style="width:110px" /> <col style="width:200px" /> <col style="width:110px" /> </colgroup> <thead class="ticket_theadtr"> <tr> <th rowspan="2">No.</th> <th rowspan="2">공급처</th> <th rowspan="2">티켓그룹명</th> <th rowspan="2">그룹코드</th> <th colspan="6">티켓수량</th> <th rowspan="2">등록일</th> <th rowspan="2">메모</th> <th rowspan="2">수정/삭제</th> </tr> <tr> <th>전체</th> <th>미사용</th> <th>발송완료</th> <th>사용완료</th> <th>취소</th> <th style="color:red">남은수량</th> </tr> </thead> <tbody> <? for($i=0 ; $i < count($data) ; $i++){ $row = $data[$i]; $num = $total - ($page - 1) * $line - $i; // 공급처명 if(empty($row['producer_id'])) { $producer_nm = 'TK TRAVEL'; } else { $memInfo = get_member($row['producer_id']); $producer_nm = $memInfo['bz_corp_nm']; } // 티켓 수량 $status_total = array(); $sql2 = "select ticket_status, count(*) as cnt from TB_TICKET where del_flag = 'N' AND group_code = '{$row['group_code']}' group by ticket_status"; $rs2 = db_query($sql2); while($row_ticket = db_fetch_array($rs2)){ $status_total[$row_ticket['ticket_status']] = $row_ticket['cnt']; } ?> <tr> <td><?=$num?></td> <td><?=$producer_nm?></td> <td style="text-align:left">   <a href="ticket_list.html?producer_id=<?=$row['producer_id']?>&group_code=<?=$row['group_code']?>"><?=$row['group_nm']?></a></td> <td><b><?=$row['group_code']?></b></td> <td style="font-weight:800;"><?=number_format(array_sum($status_total))?></td> <td><?=number_format($status_total['W'])?></td> <td><?=number_format($status_total['S'])?></td> <td><?=number_format($status_total['U'])?></td> <td><?=number_format($status_total['C'])?></td> <td style="color:red"><?=number_format($status_total['W'])?></td><!--남은수량--> <td><?=substr($row['ins_dt'],0,10)?></td> <td><?=$row['memo']?></td> <td> <input class="Table_btn" onclick="document.location.href='ticket_group_edit.html?mode=edit&group_seq=<?=$row['seq']?>'" type="button" value="수정"> <? if(array_sum($status_total) <= 0) { ?> <input class="Table_btn" onclick="if(!confirm('정말삭제하시겠습니까?'))return;ajax_loader('ticket_register_proc.php?SqlType=ticket_group_delete&seq=<?=$row['seq']?>');" type="button" value="삭제"> <? } ?> </td> <?}?> </tbody> </table> </form> <!-- /폼 --> </div> <?=adm_get_paging($total_page, $page, $list, "?$href&page=", "")?> </div> </div> </div> <script Language="Javascript"> $(function(){ $("#order_by_s").on("change",function(){ var order_by_s = $("#order_by_s").val(); var form = document.forms['frm_search']; form.elements['order_by_s'].value = order_by_s; form.submit(); }); $("#list_count_s").on("change",function(){ var list_count_s = $("#list_count_s").val(); var form = document.forms['frm_search']; form.elements['list_count_s'].value = list_count_s; form.submit(); }); $("#checkall").on("click",function(){ $(".item_checkbox").prop("checked",$(this).prop("checked")); }); $(".ticket_chg_order_state").on("click",function(){ if($(".item_checkbox:checked").length==0){ alert('적어도 한개 항목을 선택해 주세요.'); return; } document.elements['SqlType'].value = ""; if(!confirm('사용상태를 변경하시겠습니까?')) return; ajax_post("ajax_proc","sights_register_proc.php","frm_list"); }); $(".ticket_chk_del").on("click",function(){ var form = document.forms['frm_list']; if($(".item_checkbox:checked").length==0){ alert('삭제할 항목을 선택해 주세요.'); return; } if(!confirm('티켓을 삭제하시겠습니까?')) return; form.elements['SqlType'].value = "ticket_delete"; ajax_post("ajax_proc","ticket_register_proc.php","frm_list"); }); }); </script> <? include "../include/footer.html" ?>