사용처리 및 조회부분 복구
This commit is contained in:
@ -20,4 +20,9 @@ $menu['menu400'] = array(
|
||||
array('400810', '쿠폰존관리', G5_ADMIN_URL . '/shop_admin/couponzonelist.php', 'scf_coupon_zone'),
|
||||
array('400750', '추가배송비관리', G5_ADMIN_URL . '/shop_admin/sendcostlist.php', 'scf_sendcost', 1),
|
||||
array('400410', '미완료주문', G5_ADMIN_URL . '/shop_admin/inorderlist.php', 'scf_inorder', 1),
|
||||
array('400411', '매표소주문확인', G5_ADMIN_URL.'/shop_admin/orderlist_ticket.php', 'scf_order', 1),
|
||||
array('400421', '혜윰주문확인', G5_ADMIN_URL.'/shop_admin/orderlist_hy.php', 'scf_order', 1),
|
||||
array('400431', 'B2B주문확인', G5_ADMIN_URL.'/shop_admin/orderlist_b2b.php', 'scf_order', 1),
|
||||
array('400412', '관리자주문확인', G5_ADMIN_URL . '/shop_admin/orderlist_admin.php', 'scf_order', 1),
|
||||
array('400413', '관지라월정산용', G5_ADMIN_URL . '/shop_admin/orderlist_admin_sum.php', 'scf_order', 1),
|
||||
);
|
||||
|
||||
421
adm/shop_admin/orderlist_admin.php
Normal file
421
adm/shop_admin/orderlist_admin.php
Normal file
@ -0,0 +1,421 @@
|
||||
<?php
|
||||
$sub_menu = '400412';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '관리자 주문 확인';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
|
||||
$where = array();
|
||||
|
||||
// 퍼스트가든용
|
||||
// $od_status = '입금'; //입금처리 된것만 출력한다.
|
||||
// 특정 카테고리만 노출
|
||||
$ca_id = "20"; // 특정 카테고리 선택
|
||||
$sel_ca_id = " NOT ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다.
|
||||
$where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
|
||||
$tot_ct_qty = 0;
|
||||
|
||||
// 검색날짜 설정
|
||||
$fr_date = "2024-04-01";
|
||||
$to_date = "2024-04-30";
|
||||
// 퍼스트가든용 끝
|
||||
|
||||
include_once ('orderlist_head.php');
|
||||
|
||||
$sql_search = "";
|
||||
if ($search != "") {
|
||||
if ($sel_field != "") {
|
||||
$where[] = " $sel_field like '%$search%' ";
|
||||
}
|
||||
|
||||
if ($save_search != $search) {
|
||||
$page = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($od_status) {
|
||||
switch($od_status) {
|
||||
case '전체취소':
|
||||
$where[] = " a.od_status = '취소' ";
|
||||
break;
|
||||
case '부분취소':
|
||||
$where[] = " a.od_status IN('주문', '입금', '준비', '배송', '완료') and a.od_cancel_price > 0 ";
|
||||
break;
|
||||
default:
|
||||
$where[] = " a.od_status = '$od_status'";
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($od_status) {
|
||||
case '주문' :
|
||||
$sort1 = "a.od_id";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
case '입금' : // 결제완료
|
||||
$sort1 = "a.od_receipt_time";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
case '배송' : // 배송중
|
||||
$sort1 = "a.od_invoice_time";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($od_settle_case) {
|
||||
$where[] = " a.od_settle_case = '$od_settle_case' ";
|
||||
}
|
||||
|
||||
if ($od_misu) {
|
||||
$where[] = " a.od_misu != 0 ";
|
||||
}
|
||||
|
||||
if ($od_cancel_price) {
|
||||
$where[] = " a.od_cancel_price != 0 ";
|
||||
}
|
||||
|
||||
if ($od_refund_price) {
|
||||
$where[] = " a.od_refund_price != 0 ";
|
||||
}
|
||||
|
||||
if ($od_receipt_point) {
|
||||
$where[] = " a.od_receipt_point != 0 ";
|
||||
}
|
||||
|
||||
if ($od_coupon) {
|
||||
$where[] = " ( a.od_cart_coupon > 0 or a.od_coupon > 0 or a.od_send_coupon > 0 ) ";
|
||||
}
|
||||
|
||||
if ($od_escrow) {
|
||||
$where[] = " a.od_escrow = 1 ";
|
||||
}
|
||||
|
||||
if ($fr_date && $to_date) {
|
||||
$where[] = " a.od_time between '$fr_date 00:00:00' AND '$to_date 23:59:59' ";
|
||||
}
|
||||
|
||||
if ($where) {
|
||||
$sql_search = ' WHERE '.implode(' AND ', $where);
|
||||
}
|
||||
|
||||
if ( empty($sel_field) ) $sel_field = "a.od_id";
|
||||
if ( empty($sort1) ) $sort1 = "a.od_id";
|
||||
if ( empty($sort2) ) $sort2 = "desc";
|
||||
|
||||
// 상품명, 단가, 수량, 카테고리를 불러오기 위해 DB를 합친다
|
||||
$sql_common = " FROM {$g5['g5_shop_order_table']} AS a
|
||||
LEFT JOIN {$g5['g5_shop_cart_table']} AS b ON a.od_id = b.od_id
|
||||
LEFT JOIN {$g5['g5_shop_item_table']} AS c ON b.it_id = c.it_id
|
||||
LEFT JOIN {$g5['g5_shop_item_option_table']} AS d ON c.it_id = d.it_id AND b.io_id = d.io_id
|
||||
";
|
||||
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
$sql = " SELECT count(a.od_id) AS cnt " . $sql_common ;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = 100;
|
||||
if( !isset($rows) ) $rows = $config['cf_page_rows'];
|
||||
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
// 상품명, 수량, 단가, 카테고리를 가져옴
|
||||
$sql = " SELECT a.*,
|
||||
(a.od_cart_coupon + a.od_coupon + a.od_send_coupon) as couponprice,
|
||||
b.it_name,
|
||||
b.ct_qty,
|
||||
b.ct_price,
|
||||
b.ct_option,
|
||||
b.io_id,
|
||||
c.ca_id,
|
||||
c.it_1,
|
||||
c.it_2,
|
||||
d.io_price
|
||||
$sql_common
|
||||
ORDER BY $sort1 $sort2
|
||||
LIMIT $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$qstr1 = "od_status=".urlencode($od_status)."&
|
||||
od_settle_case=".urlencode($od_settle_case)."&
|
||||
od_misu=$od_misu&
|
||||
;od_cancel_price=$od_cancel_price&
|
||||
od_refund_price=$od_refund_price&
|
||||
od_receipt_point=$od_receipt_point&
|
||||
od_coupon=$od_coupon&
|
||||
fr_date=$fr_date&
|
||||
to_date=$to_date&
|
||||
sel_field=$sel_field&
|
||||
search=$search&
|
||||
save_search=$search";
|
||||
|
||||
if($default['de_escrow_use'])
|
||||
$qstr1 .= "&od_escrow=$od_escrow";
|
||||
|
||||
$qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page";
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
|
||||
// 주문삭제 히스토리 테이블 필드 추가
|
||||
if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_order_delete_table']}`
|
||||
ADD `mb_id` varchar(20) NOT NULL DEFAULT '' AFTER `de_data`,
|
||||
ADD `de_ip` varchar(255) NOT NULL DEFAULT '' AFTER `mb_id`,
|
||||
ADD `de_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `de_ip` ", true);
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="frmorderlist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
|
||||
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
|
||||
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_search" value="<?php echo $search; ?>">
|
||||
<!-- 엑셀저장 기능 구현 필요
|
||||
<div class="list_excel">
|
||||
<form method="post" action="orderlist_ex.php">
|
||||
<input type="hidden" name="sql_common" value="<?=$sql_common?>">
|
||||
<input type="hidden" name="sort1" value="<?=$sort1?>">
|
||||
<input type="hidden" name="sort2" value="<?=$sort2?>">
|
||||
<input type="hidden" name="from_record" value="<?=$from_record?>">
|
||||
<input type="hidden" name="rows" value="<?=$rows?>" >
|
||||
<input type="submit" value="엑셀저장" class="list_excel">
|
||||
</form>
|
||||
</div>
|
||||
-->
|
||||
<label for="sel_field" class="sound_only">검색대상</label>
|
||||
<select name="sel_field" id="sel_field">
|
||||
<option value="od_tel" <?php echo get_selected($sel_field, 'od_tel'); ?> selected>연락처</option>
|
||||
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
|
||||
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
|
||||
</select>
|
||||
|
||||
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="search" value="<?php echo $search; ?>" id="search" required class="required frm_input" autocomplete="off">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</form>
|
||||
<form class="local_sch03 local_sch">
|
||||
<div class="sch_last"">
|
||||
<strong>주문일자</strong>
|
||||
<input type="text" id="fr_date" name="fr_date" value="<?php echo $fr_date; ?>" class="frm_input" size="10" maxlength="10"> ~
|
||||
<input type="text" id="to_date" name="to_date" value="<?php echo $to_date; ?>" class="frm_input" size="10" maxlength="10">
|
||||
<button type="button" onclick="javascript:set_date('오늘');">오늘</button>
|
||||
<button type="button" onclick="javascript:set_date('어제');">어제</button>
|
||||
<button type="button" onclick="javascript:set_date('이번주');">이번주</button>
|
||||
<button type="button" onclick="javascript:set_date('이번달');">이번달</button>
|
||||
<button type="button" onclick="javascript:set_date('지난주');">지난주</button>
|
||||
<button type="button" onclick="javascript:set_date('지난달');">지난달</button>
|
||||
<button type="button" onclick="javascript:set_date('전체');">전체</button>
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form name="forderlist" id="forderlist" onsubmit="return forderlist_submit(this);" method="post" autocomplete="off">
|
||||
<input type="hidden" name="search_od_status" value="<?php echo $od_status; ?>">
|
||||
|
||||
<!-- 목록 시작 -->
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table id="sodr_list">
|
||||
<caption>주문 내역 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" style="display:none">
|
||||
<label for="chkall" class="sound_only">주문 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<!-- <th scope="col" id="th_ordnum" style="width:200px;"><a href="<?php echo title_sort("od_id", 1)."&$qstr1"; ?>">주문번호</a></th>-->
|
||||
<th scope="col" id="th_odrer">주문일</th>
|
||||
<th scope="col" id="th_odrer" style="width:240px;">상품명</th>
|
||||
<th scope="col" id="th_order" >옵션</th>
|
||||
<th scope="col" id="th_odrer">주문자</th>
|
||||
<th scope="col" id="th_odrertel">주문자전화</th>
|
||||
<th scope="col" style="width:85px;">단가</th>
|
||||
<th scope="col" style="width:62px;">수량</th>
|
||||
<th scope="col" style="width:85px;">합계금액</th>
|
||||
<!-- <th scope="col">입금합계</th>-->
|
||||
<th scope="col" style="width:62px;">상태</th>
|
||||
<th scope="col" style="width:61px;">상세</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
// 결제 수단
|
||||
$s_receipt_way = $s_br = "";
|
||||
if ($row['od_settle_case'])
|
||||
{
|
||||
$s_receipt_way = $row['od_settle_case'];
|
||||
$s_br = '<br />';
|
||||
|
||||
// 간편결제
|
||||
if($row['od_settle_case'] == '간편결제') {
|
||||
switch($row['od_pg']) {
|
||||
case 'lg':
|
||||
$s_receipt_way = 'PAYNOW';
|
||||
break;
|
||||
case 'inicis':
|
||||
$s_receipt_way = 'KPAY';
|
||||
break;
|
||||
case 'kcp':
|
||||
$s_receipt_way = 'PAYCO';
|
||||
break;
|
||||
default:
|
||||
$s_receipt_way = $row['od_settle_case'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_receipt_way = '결제수단없음';
|
||||
$s_br = '<br />';
|
||||
}
|
||||
|
||||
if ($row['od_receipt_point'] > 0)
|
||||
$s_receipt_way .= $s_br."포인트";
|
||||
|
||||
$mb_nick = get_sideview($row['mb_id'], get_text($row['od_name']), $row['od_email'], '');
|
||||
|
||||
$od_cnt = 0;
|
||||
if ($row['mb_id'])
|
||||
{
|
||||
$sql2 = " select count(*) as cnt from {$g5['g5_shop_order_table']} where mb_id = '{$row['mb_id']}' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
$od_cnt = $row2['cnt'];
|
||||
}
|
||||
|
||||
// 주문 번호에 device 표시
|
||||
$od_mobile = '';
|
||||
if($row['od_mobile'])
|
||||
$od_mobile = '(M)';
|
||||
|
||||
// 주문번호에 - 추가
|
||||
switch(strlen($row['od_id'])) {
|
||||
case 16:
|
||||
$disp_od_id = substr($row['od_id'],0,8).'-'.substr($row['od_id'],8);
|
||||
break;
|
||||
default:
|
||||
$disp_od_id = substr($row['od_id'],0,6).'-'.substr($row['od_id'],6);
|
||||
break;
|
||||
}
|
||||
|
||||
// 주문 번호에 에스크로 표시
|
||||
$od_paytype = '';
|
||||
if($row['od_test'])
|
||||
$od_paytype .= '<span class="list_test">테스트</span>';
|
||||
|
||||
if($default['de_escrow_use'] && $row['od_escrow'])
|
||||
$od_paytype .= '<span class="list_escrow">에스크로</span>';
|
||||
|
||||
$uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
|
||||
|
||||
$invoice_time = is_null_time($row['od_invoice_time']) ? G5_TIME_YMDHIS : $row['od_invoice_time'];
|
||||
$delivery_company = $row['od_delivery_company'] ? $row['od_delivery_company'] : $default['de_delivery_company'];
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
$td_color = 0;
|
||||
if($row['od_cancel_price'] > 0) {
|
||||
$bg .= 'cancel';
|
||||
$td_color = 1;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- 목록 내용 시작 -->
|
||||
<tr class="orderlist<?php echo ' '.$bg; ?>">
|
||||
<td class="td_chk" style="display:none">
|
||||
<input type="hidden" name="od_id[<?php echo $i ?>]" value="<?php echo $row['od_id'] ?>" id="od_id_<?php echo $i ?>">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only">주문번호 <?php echo $row['od_id']; ?></label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
|
||||
</td>
|
||||
<!--
|
||||
<td headers="th_ordnum" class="td_odrnum2">
|
||||
<?php if ($is_admin == 'super'){ ?>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>" class="orderitem"><?php echo $disp_od_id; ?></a>
|
||||
<?php } else { echo $disp_od_id; }?>
|
||||
<?php echo $od_mobile; ?>
|
||||
<?php echo $od_paytype; ?>
|
||||
</td>
|
||||
-->
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo substr($row['od_receipt_time'],0,10);?></td>
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo $row['it_name'];?></td>
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo ($row['io_id']) ? $row['io_id'] : ''; ?></td>
|
||||
<td headers="th_odrer" class="td_name"><?php echo $mb_nick; ?></td>
|
||||
<td headers="th_odrertel" class="td_tel" style="text-align:center;"><?php echo add_hyphen(get_text($row['od_tel'])); ?></td>
|
||||
<td headers="th_odrcnt"><?php echo number_format($row['ct_price']+$row['io_price']);?></td>
|
||||
<td headers="th_odrcnt"><?php echo $row['ct_qty']; ?></td>
|
||||
<td class="td_num td_numsum">
|
||||
<?php echo number_format(($row['ct_price'] + $row['io_price']) * $row['ct_qty']); ?>
|
||||
<?php // echo number_format($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']); // 같은 승인번호의 결제건 여러개가 있는 경우 금액이 알아보기 불편함 ?></td>
|
||||
<!-- <td class="td_num_right"><?php echo number_format($row['od_receipt_price']); ?></td>-->
|
||||
<td class="td_mng td_mng_s">
|
||||
<?php
|
||||
echo $row['od_status'];
|
||||
/* 사용처리사용안함
|
||||
// 사용처리 버튼 출력을 위한 부분
|
||||
if ($row['it_2'] && (substr($row['od_receipt_time'],0,10) == date('Y-m-d'))) { // 당일주문 사용불가 대상 & 당일주문 체크
|
||||
echo '당일주문<br>사용불가';
|
||||
} else if ($row['od_status'] == '입금' && $row['it_1'] >= date("ymd") || $row['it_1'] == "" ) { // 상태가 '입금' 이면서 유효기간이 지정되지 않았거나 지나지 않은 경우
|
||||
?>
|
||||
<a href="orderliveupdate.php?bo=u&it_id=<?php echo $row['od_id']; ?>&st=<?php echo $row['od_status'];?>" class="mng_mod btn btn_04"><span class="sound_only"><?php echo $row['od_id']; ?></span>사용</a>
|
||||
<?php } else {
|
||||
echo "사용불가<br>(유효일자:".$row['it_1'].")";
|
||||
}
|
||||
//사용처리 버튼 끝
|
||||
*/
|
||||
?>
|
||||
</td>
|
||||
<td class="td_mng td_mng_s">
|
||||
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&<?php echo $qstr; ?>" class="mng_mod btn btn_02"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$tot_itemcount += $row['od_cart_count'];
|
||||
$tot_orderprice += (($row['ct_price'] + $row['io_price']) * $row['ct_qty']);
|
||||
// $tot_orderprice += ($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']);
|
||||
$tot_ordercancel += $row['od_cancel_price'];
|
||||
$tot_receiptprice += $row['od_receipt_price'];
|
||||
$tot_couponprice += $row['couponprice'];
|
||||
$tot_ct_qty += $row['ct_qty'];
|
||||
}
|
||||
sql_free_result($result);
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="11" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="orderlist">
|
||||
<th scope="row" colspan="6">합 계</th>
|
||||
<td><?php echo $tot_ct_qty //number_format($tot_itemcount); ?>건</td>
|
||||
<td><?php echo number_format($tot_orderprice); ?></td>
|
||||
<!-- <td><?php echo number_format($tot_receiptprice); ?></td>-->
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="local_desc02 local_desc">
|
||||
<p>
|
||||
<사용>버튼을 클릭하면 티켓 사용처리가 완료됩니다. 부분사용, 부분취소가 불가능하므로 이용수량이 다른 경우 고객님께 꼭 확인해주시기 바랍니다.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&page="); ?>
|
||||
|
||||
|
||||
<?php
|
||||
include_once ('orderlist_tail.php');
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
227
adm/shop_admin/orderlist_admin_sum.php
Normal file
227
adm/shop_admin/orderlist_admin_sum.php
Normal file
@ -0,0 +1,227 @@
|
||||
<?php
|
||||
$sub_menu = '400413';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '월간 주문내역 합계';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
|
||||
$where = array();
|
||||
|
||||
// 퍼스트가든용
|
||||
// $od_status = '입금'; //입금처리 된것만 출력한다.
|
||||
// 특정 카테고리만 노출
|
||||
$ca_id = "20"; // 특정 카테고리 선택
|
||||
$sel_ca_id = " NOT ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다.
|
||||
$where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
|
||||
$tot_ct_qty = 0;
|
||||
|
||||
// 퍼스트가든용 끝
|
||||
|
||||
include_once ('orderlist_head.php');
|
||||
|
||||
$sql_search = "";
|
||||
if ($search != "") {
|
||||
if ($sel_field != "") {
|
||||
$where[] = " $sel_field like '%$search%' ";
|
||||
}
|
||||
|
||||
if ($save_search != $search) {
|
||||
$page = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// od_status가 입금, 완료인 것만 출력함
|
||||
|
||||
$where[] = " a.od_status IN('완료') ";
|
||||
|
||||
if ($od_settle_case) {
|
||||
$where[] = " a.od_settle_case = '$od_settle_case' ";
|
||||
}
|
||||
|
||||
if ($od_misu) {
|
||||
$where[] = " a.od_misu != 0 ";
|
||||
}
|
||||
|
||||
if ($od_cancel_price) {
|
||||
$where[] = " a.od_cancel_price != 0 ";
|
||||
}
|
||||
|
||||
if ($od_refund_price) {
|
||||
$where[] = " a.od_refund_price != 0 ";
|
||||
}
|
||||
|
||||
if ($od_receipt_point) {
|
||||
$where[] = " a.od_receipt_point != 0 ";
|
||||
}
|
||||
|
||||
if ($od_coupon) {
|
||||
$where[] = " ( a.od_cart_coupon > 0 or a.od_coupon > 0 or a.od_send_coupon > 0 ) ";
|
||||
}
|
||||
|
||||
if ($od_escrow) {
|
||||
$where[] = " a.od_escrow = 1 ";
|
||||
}
|
||||
|
||||
if ($fr_date && $to_date) {
|
||||
$where[] = " a.od_time between '$fr_date 00:00:00' AND '$to_date 23:59:59' ";
|
||||
}
|
||||
|
||||
if ($where) {
|
||||
$sql_search = ' WHERE '.implode(' AND ', $where);
|
||||
}
|
||||
|
||||
if ( empty($sel_field) ) $sel_field = "a.od_id";
|
||||
if ( empty($sort1) ) $sort1 = "a.od_id";
|
||||
if ( empty($sort2) ) $sort2 = "desc";
|
||||
|
||||
// 상품명, 단가, 수량, 카테고리를 불러오기 위해 DB를 합친다
|
||||
$sql_common = " FROM {$g5['g5_shop_order_table']} AS a
|
||||
LEFT JOIN {$g5['g5_shop_cart_table']} AS b ON a.od_id = b.od_id
|
||||
LEFT JOIN {$g5['g5_shop_item_table']} AS c ON b.it_id = c.it_id
|
||||
LEFT JOIN {$g5['g5_shop_item_option_table']} AS d ON c.it_id = d.it_id AND b.io_id = d.io_id
|
||||
";
|
||||
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
$sql = " SELECT count(a.od_id) AS cnt " . $sql_common ;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = 100;
|
||||
if( !isset($rows) ) $rows = $config['cf_page_rows'];
|
||||
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
// 상품명, 수량, 단가, 카테고리를 가져옴
|
||||
$sql = " SELECT a.od_id,
|
||||
b.it_name,
|
||||
b.ct_qty,
|
||||
b.ct_price,
|
||||
b.ct_option,
|
||||
b.io_id,
|
||||
c.ca_id,
|
||||
c.it_1,
|
||||
c.it_2,
|
||||
d.io_price
|
||||
$sql_common
|
||||
ORDER BY $sort1 $sort2
|
||||
LIMIT $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$qstr1 = "od_status=".urlencode($od_status)."&
|
||||
od_settle_case=".urlencode($od_settle_case)."&
|
||||
od_misu=$od_misu&
|
||||
;od_cancel_price=$od_cancel_price&
|
||||
od_refund_price=$od_refund_price&
|
||||
od_receipt_point=$od_receipt_point&
|
||||
od_coupon=$od_coupon&
|
||||
fr_date=$fr_date&
|
||||
to_date=$to_date&
|
||||
sel_field=$sel_field&
|
||||
search=$search&
|
||||
save_search=$search";
|
||||
|
||||
if($default['de_escrow_use'])
|
||||
$qstr1 .= "&od_escrow=$od_escrow";
|
||||
|
||||
$qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page";
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
|
||||
?>
|
||||
|
||||
<form name="frmorderlist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
|
||||
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
|
||||
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_search" value="<?php echo $search; ?>">
|
||||
|
||||
<label for="sel_field" class="sound_only">검색대상</label>
|
||||
<select name="sel_field" id="sel_field">
|
||||
<option value="od_tel" <?php echo get_selected($sel_field, 'od_tel'); ?> selected>연락처</option>
|
||||
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
|
||||
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
|
||||
</select>
|
||||
|
||||
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="search" value="<?php echo $search; ?>" id="search" required class="required frm_input" autocomplete="off">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</form>
|
||||
<form class="local_sch03 local_sch">
|
||||
<div class="sch_last"">
|
||||
<strong>주문일자</strong>
|
||||
<input type="text" id="fr_date" name="fr_date" value="<?php echo $fr_date; ?>" class="frm_input" size="10" maxlength="10"> ~
|
||||
<input type="text" id="to_date" name="to_date" value="<?php echo $to_date; ?>" class="frm_input" size="10" maxlength="10">
|
||||
<button type="button" onclick="javascript:set_date('오늘');">오늘</button>
|
||||
<button type="button" onclick="javascript:set_date('어제');">어제</button>
|
||||
<button type="button" onclick="javascript:set_date('이번주');">이번주</button>
|
||||
<button type="button" onclick="javascript:set_date('이번달');">이번달</button>
|
||||
<button type="button" onclick="javascript:set_date('지난주');">지난주</button>
|
||||
<button type="button" onclick="javascript:set_date('지난달');">지난달</button>
|
||||
<button type="button" onclick="javascript:set_date('전체');">전체</button>
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form name="forderlist" id="forderlist" onsubmit="return forderlist_submit(this);" method="post" autocomplete="off">
|
||||
<input type="hidden" name="search_od_status" value="<?php echo $od_status; ?>">
|
||||
|
||||
<?php
|
||||
// 총 수량과 총 금액을 저장할 배열 초기화
|
||||
$total_items = array();
|
||||
|
||||
while ($row = sql_fetch_array($result)) {
|
||||
$item_name = $row['it_name'];
|
||||
$item_option = $row['ct_option'];
|
||||
|
||||
if (!isset($total_items[$item_name][$item_option])) {
|
||||
$total_items[$item_name][$item_option]['quantity'] = 0;
|
||||
$total_items[$item_name][$item_option]['total_price'] = 0;
|
||||
}
|
||||
|
||||
if ( !isset($total_items[$item_name][$item_option]['price'] ) ) $total_items[$item_name][$item_option]['price'] = $row['ct_price'] + $row['io_price'];
|
||||
$total_items[$item_name][$item_option]['quantity'] += $row['ct_qty'];
|
||||
$total_items[$item_name][$item_option]['total_price'] += $row['ct_qty'] * ($row['ct_price'] + $row['io_price']);
|
||||
|
||||
}
|
||||
|
||||
// PHP 코드 블록 종료
|
||||
?>
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table id="sodr_list">
|
||||
<!-- 합계 표 출력 -->
|
||||
<tr>
|
||||
<th>상품명</th>
|
||||
<th>옵션</th>
|
||||
<th>단가</th>
|
||||
<th>총 수량</th>
|
||||
<th>총 금액</th>
|
||||
</tr>
|
||||
<?php foreach ($total_items as $item_name => $options): ?>
|
||||
<?php foreach ($options as $option => $totals): ?>
|
||||
<tr>
|
||||
<td><?php echo $item_name; ?></td>
|
||||
<td><?php echo $option; ?></td>
|
||||
<td class="td_num"><?php echo number_format($totals['total_price'] / $totals['quantity']); ?></td>
|
||||
<td class="th_odrcnt"><?php echo number_format($totals['quantity']); ?></td>
|
||||
<td class="td_num td_numsum"><?php echo number_format($totals['total_price']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
include_once ('orderlist_tail.php');
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
603
adm/shop_admin/orderlist_b2b.php
Normal file
603
adm/shop_admin/orderlist_b2b.php
Normal file
@ -0,0 +1,603 @@
|
||||
<?php
|
||||
$sub_menu = '400431';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = 'B2B 주문내역 확인';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
|
||||
$where = array();
|
||||
|
||||
// 퍼스트가든용
|
||||
// $od_status = '입금'; //입금처리 된것만 출력한다.
|
||||
// 특정 카테고리만 노출
|
||||
$ca_id = "30"; // 특정 카테고리 선택
|
||||
$sel_ca_id = " ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다.
|
||||
$where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
|
||||
$tot_ct_qty = 0;
|
||||
// 퍼스트가든용 끝
|
||||
|
||||
include_once ('orderlist_head.php');
|
||||
|
||||
$sql_search = "";
|
||||
if ($search != "") {
|
||||
if ($sel_field != "") {
|
||||
$where[] = " $sel_field like '%$search%' ";
|
||||
}
|
||||
|
||||
if ($save_search != $search) {
|
||||
$page = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($od_status) {
|
||||
switch($od_status) {
|
||||
case '전체취소':
|
||||
$where[] = " a.od_status = '취소' ";
|
||||
break;
|
||||
case '부분취소':
|
||||
$where[] = " a.od_status IN('주문', '입금', '준비', '배송', '완료') AND a.od_cancel_price > 0 ";
|
||||
break;
|
||||
default:
|
||||
$where[] = " a.od_status = '$od_status'";
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($od_status) {
|
||||
case '주문' :
|
||||
$sort1 = "a.od_id";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
case '입금' : // 결제완료
|
||||
$sort1 = "a.od_receipt_time";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
case '배송' : // 배송중
|
||||
$sort1 = "a.od_invoice_time";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($od_settle_case) {
|
||||
$where[] = " a.od_settle_case = '$od_settle_case' ";
|
||||
}
|
||||
|
||||
if ($od_misu) {
|
||||
$where[] = " a.od_misu != 0 ";
|
||||
}
|
||||
|
||||
if ($od_cancel_price) {
|
||||
$where[] = " a.od_cancel_price != 0 ";
|
||||
}
|
||||
|
||||
if ($od_refund_price) {
|
||||
$where[] = " a.od_refund_price != 0 ";
|
||||
}
|
||||
|
||||
if ($od_receipt_point) {
|
||||
$where[] = " a.od_receipt_point != 0 ";
|
||||
}
|
||||
|
||||
if ($od_coupon) {
|
||||
$where[] = " ( a.od_cart_coupon > 0 OR a.od_coupon > 0 OR a.od_send_coupon > 0 ) ";
|
||||
}
|
||||
|
||||
if ($od_escrow) {
|
||||
$where[] = " a.od_escrow = 1 ";
|
||||
}
|
||||
|
||||
if ($fr_date && $to_date) {
|
||||
$where[] = " a.od_time between '$fr_date 00:00:00' AND '$to_date 23:59:59' ";
|
||||
}
|
||||
|
||||
if ($where) {
|
||||
$sql_search = ' WHERE '.implode(' AND ', $where);
|
||||
}
|
||||
|
||||
if ($sel_field == "") $sel_field = "a.od_id";
|
||||
if ($sort1 == "") $sort1 = "a.od_id";
|
||||
if ($sort2 == "") $sort2 = "desc";
|
||||
|
||||
// 상품명, 단가, 수량, 카테고리를 불러오기 위해 DB를 합친다
|
||||
$sql_common = " FROM {$g5['g5_shop_order_table']} AS a
|
||||
LEFT JOIN {$g5['g5_shop_cart_table']} AS b ON a.od_id = b.od_id
|
||||
LEFT JOIN {$g5['g5_shop_item_table']} AS c ON b.it_id = c.it_id
|
||||
LEFT JOIN {$g5['g5_shop_item_option_table']} AS d ON c.it_id = d.it_id AND b.io_id = d.io_id
|
||||
";
|
||||
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
$sql = " SELECT count(a.od_id) AS cnt " . $sql_common ;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
// 상품명, 수량, 단가, 카테고리를 가져옴
|
||||
$sql = " SELECT a.*,
|
||||
(a.od_cart_coupon + a.od_coupon + a.od_send_coupon) as couponprice,
|
||||
b.it_name,
|
||||
b.ct_qty,
|
||||
b.ct_price,
|
||||
b.ct_option,
|
||||
b.io_id,
|
||||
c.ca_id,
|
||||
c.it_1,
|
||||
c.it_2,
|
||||
d.io_price
|
||||
$sql_common
|
||||
ORDER BY $sort1 $sort2
|
||||
LIMIT $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$qstr1 = "od_status=".urlencode($od_status)."&
|
||||
od_settle_case=".urlencode($od_settle_case)."&
|
||||
od_misu=$od_misu&
|
||||
;od_cancel_price=$od_cancel_price&
|
||||
od_refund_price=$od_refund_price&
|
||||
od_receipt_point=$od_receipt_point&
|
||||
od_coupon=$od_coupon&
|
||||
fr_date=$fr_date&
|
||||
to_date=$to_date&
|
||||
sel_field=$sel_field&
|
||||
search=$search&
|
||||
save_search=$search";
|
||||
if($default['de_escrow_use'])
|
||||
$qstr1 .= "&od_escrow=$od_escrow";
|
||||
$qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page";
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
|
||||
// 주문삭제 히스토리 테이블 필드 추가
|
||||
if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_order_delete_table']}`
|
||||
ADD `mb_id` varchar(20) NOT NULL DEFAULT '' AFTER `de_data`,
|
||||
ADD `de_ip` varchar(255) NOT NULL DEFAULT '' AFTER `mb_id`,
|
||||
ADD `de_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `de_ip` ", true);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?>
|
||||
<span class="btn_ov01"><span class="ov_txt">전체 주문내역</span><span class="ov_num"> <?php echo number_format($total_count); ?>건</span></span>
|
||||
<?php if($od_status == '준비' && $total_count > 0) { ?>
|
||||
<a href="./orderdelivery.php" id="order_delivery" class="ov_a">엑셀배송처리</a>
|
||||
<?php } ?>
|
||||
<div class="list_excel">
|
||||
<form method="post" action="orderlist_ex.php">
|
||||
<input type="hidden" name="sql_common" value="<?=$sql_common?>">
|
||||
<input type="hidden" name="sort1" value="<?=$sort1?>">
|
||||
<input type="hidden" name="sort2" value="<?=$sort2?>">
|
||||
<input type="hidden" name="from_record" value="<?=$from_record?>">
|
||||
<input type="hidden" name="rows" value="<?=$rows?>" >
|
||||
<input type="submit" value="엑셀저장" class="list_excel">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form name="frmorderlist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
|
||||
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
|
||||
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_search" value="<?php echo $search; ?>">
|
||||
|
||||
<label for="sel_field" class="sound_only">검색대상</label>
|
||||
<select name="sel_field" id="sel_field">
|
||||
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
|
||||
<option value="mb_id" <?php echo get_selected($sel_field, 'mb_id'); ?>>회원 ID</option>
|
||||
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
|
||||
<option value="od_tel" <?php echo get_selected($sel_field, 'od_tel'); ?>>주문자전화</option>
|
||||
<option value="od_hp" <?php echo get_selected($sel_field, 'od_hp'); ?>>주문자핸드폰</option>
|
||||
<!--<option value="od_b_name" <?php echo get_selected($sel_field, 'od_b_name'); ?>>받는분</option>-->
|
||||
<option value="od_b_tel" <?php echo get_selected($sel_field, 'od_b_tel'); ?>>받는분전화</option>
|
||||
<option value="od_b_hp" <?php echo get_selected($sel_field, 'od_b_hp'); ?>>받는분핸드폰</option>
|
||||
<option value="od_deposit_name" <?php echo get_selected($sel_field, 'od_deposit_name'); ?>>입금자</option>
|
||||
<!-- <option value="od_invoice" <?php echo get_selected($sel_field, 'od_invoice'); ?>>운송장번호</option>-->
|
||||
<option value="od_app_no" <?php echo get_selected($sel_field, 'od_app_no'); ?>>승인번호</option>
|
||||
</select>
|
||||
|
||||
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="search" value="<?php echo $search; ?>" id="search" required class="required frm_input" autocomplete="off">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<form class="local_sch03 local_sch">
|
||||
<div>
|
||||
<strong>주문상태</strong>
|
||||
<input type="radio" name="od_status" value="" id="od_status_all" <?php echo get_checked($od_status, ''); ?>>
|
||||
<label for="od_status_all">전체</label>
|
||||
<input type="radio" name="od_status" value="입금" id="od_status_income" <?php echo get_checked($od_status, '입금'); ?>>
|
||||
<label for="od_status_income">결제완료</label>
|
||||
<input type="radio" name="od_status" value="완료" id="od_status_done" <?php echo get_checked($od_status, '완료'); ?>>
|
||||
<label for="od_status_done">사용완료</label>
|
||||
<input type="radio" name="od_status" value="전체취소" id="od_status_cancel" <?php echo get_checked($od_status, '전체취소'); ?>>
|
||||
<label for="od_status_cancel">취소</label>
|
||||
</div>
|
||||
|
||||
<div class="sch_last">
|
||||
<strong>주문일자</strong>
|
||||
<input type="text" id="fr_date" name="fr_date" value="<?php echo $fr_date; ?>" class="frm_input" size="10" maxlength="10"> ~
|
||||
<input type="text" id="to_date" name="to_date" value="<?php echo $to_date; ?>" class="frm_input" size="10" maxlength="10">
|
||||
<button type="button" onclick="javascript:set_date('오늘');">오늘</button>
|
||||
<button type="button" onclick="javascript:set_date('어제');">어제</button>
|
||||
<button type="button" onclick="javascript:set_date('이번주');">이번주</button>
|
||||
<button type="button" onclick="javascript:set_date('이번달');">이번달</button>
|
||||
<button type="button" onclick="javascript:set_date('지난주');">지난주</button>
|
||||
<button type="button" onclick="javascript:set_date('지난달');">지난달</button>
|
||||
<button type="button" onclick="javascript:set_date('전체');">전체</button>
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form name="forderlist" id="forderlist" onsubmit="return forderlist_submit(this);" method="post" autocomplete="off">
|
||||
<input type="hidden" name="search_od_status" value="<?php echo $od_status; ?>">
|
||||
|
||||
<!-- 목록 시작 -->
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table id="sodr_list">
|
||||
<caption>주문 내역 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">주문 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<!-- <th scope="col" id="th_ordnum" style="width:200px;"><a href="<?php echo title_sort("od_id", 1)."&$qstr1"; ?>">주문번호</a></th>-->
|
||||
<th scope="col" id="th_odrer">주문일</th>
|
||||
<th scope="col" id="th_odrer" style="width:240px;">상품명<br>(옵션)</th>
|
||||
<th scope="col" id="th_odrer">주문자</th>
|
||||
<th scope="col" id="th_odrertel">주문자전화</th>
|
||||
<th scope="col" style="width:85px;">단가<br>(옵션가)</th>
|
||||
<th scope="col" style="width:62px;">주문수량</th>
|
||||
<th scope="col" style="width:85px;">합계</th>
|
||||
<!-- <th scope="col">입금합계</th>-->
|
||||
<th scope="col" style="width:62px;">상태</th>
|
||||
<th scope="col" style="width:61px;">상세</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
// 결제 수단
|
||||
$s_receipt_way = $s_br = "";
|
||||
if ($row['od_settle_case'])
|
||||
{
|
||||
$s_receipt_way = $row['od_settle_case'];
|
||||
$s_br = '<br />';
|
||||
|
||||
// 간편결제
|
||||
if($row['od_settle_case'] == '간편결제') {
|
||||
switch($row['od_pg']) {
|
||||
case 'lg':
|
||||
$s_receipt_way = 'PAYNOW';
|
||||
break;
|
||||
case 'inicis':
|
||||
$s_receipt_way = 'KPAY';
|
||||
break;
|
||||
case 'kcp':
|
||||
$s_receipt_way = 'PAYCO';
|
||||
break;
|
||||
default:
|
||||
$s_receipt_way = $row['od_settle_case'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_receipt_way = '결제수단없음';
|
||||
$s_br = '<br />';
|
||||
}
|
||||
|
||||
if ($row['od_receipt_point'] > 0)
|
||||
$s_receipt_way .= $s_br."포인트";
|
||||
|
||||
$mb_nick = get_sideview($row['mb_id'], get_text($row['od_name']), $row['od_email'], '');
|
||||
|
||||
$od_cnt = 0;
|
||||
if ($row['mb_id'])
|
||||
{
|
||||
$sql2 = " select count(*) as cnt from {$g5['g5_shop_order_table']} where mb_id = '{$row['mb_id']}' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
$od_cnt = $row2['cnt'];
|
||||
}
|
||||
|
||||
// 주문 번호에 device 표시
|
||||
$od_mobile = '';
|
||||
if($row['od_mobile'])
|
||||
$od_mobile = '(M)';
|
||||
|
||||
// 주문번호에 - 추가
|
||||
switch(strlen($row['od_id'])) {
|
||||
case 16:
|
||||
$disp_od_id = substr($row['od_id'],0,8).'-'.substr($row['od_id'],8);
|
||||
break;
|
||||
default:
|
||||
$disp_od_id = substr($row['od_id'],0,6).'-'.substr($row['od_id'],6);
|
||||
break;
|
||||
}
|
||||
|
||||
// 주문 번호에 에스크로 표시
|
||||
$od_paytype = '';
|
||||
if($row['od_test'])
|
||||
$od_paytype .= '<span class="list_test">테스트</span>';
|
||||
|
||||
if($default['de_escrow_use'] && $row['od_escrow'])
|
||||
$od_paytype .= '<span class="list_escrow">에스크로</span>';
|
||||
|
||||
$uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
|
||||
|
||||
$invoice_time = is_null_time($row['od_invoice_time']) ? G5_TIME_YMDHIS : $row['od_invoice_time'];
|
||||
$delivery_company = $row['od_delivery_company'] ? $row['od_delivery_company'] : $default['de_delivery_company'];
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
$td_color = 0;
|
||||
if($row['od_cancel_price'] > 0) {
|
||||
$bg .= 'cancel';
|
||||
$td_color = 1;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- 목록 내용 시작 -->
|
||||
<tr class="orderlist<?php echo ' '.$bg; ?>">
|
||||
<td class="td_chk">
|
||||
<input type="hidden" name="od_id[<?php echo $i ?>]" value="<?php echo $row['od_id'] ?>" id="od_id_<?php echo $i ?>">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only">주문번호 <?php echo $row['od_id']; ?></label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
|
||||
</td>
|
||||
<!--<?php /*
|
||||
<td headers="th_ordnum" class="td_odrnum2">
|
||||
<?php if ($is_admin == 'super'){ ?>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>" class="orderitem"><?php echo $disp_od_id; ?></a>
|
||||
<?php } else { echo $disp_od_id; }?>
|
||||
<?php echo $od_mobile; ?>
|
||||
<?php echo $od_paytype; ?>
|
||||
</td>
|
||||
*/ ?> -->
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo substr($row['od_receipt_time'],0,10);?></td>
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php
|
||||
echo $row['it_name'];
|
||||
echo ($row['io_id']) ? '<br>('.$row['io_id'].')' : ''; ?></td>
|
||||
<td headers="th_odrer" class="td_name"><?php echo $mb_nick; ?></td>
|
||||
<td headers="th_odrertel" class="td_tel" style="text-align:center;"><?php echo add_hyphen(get_text($row['od_tel'])); ?></td>
|
||||
<td headers="th_odrcnt"><?php echo number_format($row['ct_price']);
|
||||
echo ($row['io_price'])? '<br>('.number_format($row['io_price']).')' : '';
|
||||
?></td>
|
||||
<td headers="th_odrcnt"><?php echo $row['ct_qty']; ?></td>
|
||||
<td class="td_num td_numsum">
|
||||
<?php echo number_format(($row['ct_price'] + $row['io_price']) * $row['ct_qty']); ?>
|
||||
<?php // echo number_format($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']); // 같은 승인번호의 결제건 여러개가 있는 경우 금액이 알아보기 불편함 ?></td>
|
||||
<!--<?php /* <td class="td_num_right"><?php echo number_format($row['od_receipt_price']); ?></td>*/?>-->
|
||||
<td class="td_mng td_mng_s">
|
||||
<?php
|
||||
// 상태 출력
|
||||
if ($row['it_2'] && (substr($row['od_receipt_time'],0,10) == date('Y-m-d'))) { // 당일주문 사용불가 대상 & 당일주문 체크
|
||||
echo '<font color="red">당일주문<br>사용불가</font>';
|
||||
} else if ($row['od_status'] == "입금") {
|
||||
echo "결제완료<br>";
|
||||
if ($row['od_status'] == '입금' && $row['it_1'] < date("ymd") || $row['it_1'] == "") { // 상태가 '입금' 이면서 유효기간이 지정되어있고 지난경우
|
||||
echo '<font color="red">유효기간 종료</font><br>(유효일자:'.$row['it_1'].')';
|
||||
}
|
||||
} else if ($row['od_status'] == "완료" ) {
|
||||
echo '<font color="#999">사용완료</font>';
|
||||
// 완료처리 시간을 기록해야 할 듯
|
||||
} else if ($row['od_status'] == "취소" ) {
|
||||
echo '<font color="#ccc">취소</font>';
|
||||
// 완료처리 시간을 기록해야 할 듯
|
||||
}
|
||||
//사용처리 버튼 끝
|
||||
/* <a href="orderliveupdate.php?bo=u&it_id=<?php echo $row[od_id]; ?>&st=<?php echo $row[od_status];?>" class="mng_mod btn btn_04"><span class="sound_only"><?php echo $row['od_id']; ?></span>사용</a>*/
|
||||
?>
|
||||
</td>
|
||||
<td class="td_mng td_mng_s">
|
||||
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&<?php echo $qstr; ?>" class="mng_mod btn btn_02"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$tot_itemcount += $row['od_cart_count'];
|
||||
$tot_orderprice += (($row['ct_price'] + $row['io_price']) * $row['ct_qty']);
|
||||
// $tot_orderprice += ($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']);
|
||||
$tot_ordercancel += $row['od_cancel_price'];
|
||||
$tot_receiptprice += $row['od_receipt_price'];
|
||||
$tot_couponprice += $row['couponprice'];
|
||||
}
|
||||
sql_free_result($result);
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="11" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="orderlist">
|
||||
<th scope="row" colspan="6">합 계</th>
|
||||
<td><?php echo number_format($tot_itemcount); ?>건</td>
|
||||
<td><?php echo number_format($tot_orderprice); ?></td>
|
||||
<!-- <td><?php echo number_format($tot_receiptprice); ?></td>-->
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="local_desc02 local_desc">
|
||||
<p>
|
||||
<!--<사용>버튼을 클릭하면 티켓 사용처리가 완료됩니다. 부분사용, 부분취소가 불가능하므로 이용수량이 다른 경우 고객님께 꼭 확인해주시기 바랍니다.-->
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&page="); ?>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#fr_date, #to_date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", showButtonPanel: true, yearRange: "c-99:c+99", maxDate: "+0d" });
|
||||
|
||||
// 주문상품보기
|
||||
$(".orderitem").on("click", function() {
|
||||
var $this = $(this);
|
||||
var od_id = $this.text().replace(/[^0-9]/g, "");
|
||||
|
||||
if($this.next("#orderitemlist").size())
|
||||
return false;
|
||||
|
||||
$("#orderitemlist").remove();
|
||||
|
||||
$.post(
|
||||
"./ajax.orderitem.php",
|
||||
{ od_id: od_id },
|
||||
function(data) {
|
||||
$this.after("<div id=\"orderitemlist\"><div class=\"itemlist\"></div></div>");
|
||||
$("#orderitemlist .itemlist")
|
||||
.html(data)
|
||||
.append("<div id=\"orderitemlist_close\"><button type=\"button\" id=\"orderitemlist-x\" class=\"btn_frmline\">닫기</button></div>");
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// 상품리스트 닫기
|
||||
$(".orderitemlist-x").on("click", function() {
|
||||
$("#orderitemlist").remove();
|
||||
});
|
||||
|
||||
$("body").on("click", function() {
|
||||
$("#orderitemlist").remove();
|
||||
});
|
||||
|
||||
// 엑셀배송처리창
|
||||
$("#order_delivery").on("click", function() {
|
||||
var opt = "width=600,height=450,left=10,top=10";
|
||||
window.open(this.href, "win_excel", opt);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function set_date(today)
|
||||
{
|
||||
<?php
|
||||
$date_term = date('w', G5_SERVER_TIME);
|
||||
$week_term = $date_term + 7;
|
||||
$last_term = strtotime(date('Y-m-01', G5_SERVER_TIME));
|
||||
?>
|
||||
if (today == "오늘") {
|
||||
document.getElementById("fr_date").value = "<?php echo G5_TIME_YMD; ?>";
|
||||
document.getElementById("to_date").value = "<?php echo G5_TIME_YMD; ?>";
|
||||
} else if (today == "어제") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME - 86400); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME - 86400); ?>";
|
||||
} else if (today == "이번주") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-d', strtotime('-'.$date_term.' days', G5_SERVER_TIME)); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME); ?>";
|
||||
} else if (today == "이번달") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-01', G5_SERVER_TIME); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME); ?>";
|
||||
} else if (today == "지난주") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-d', strtotime('-'.$week_term.' days', G5_SERVER_TIME)); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-d', strtotime('-'.($week_term - 6).' days', G5_SERVER_TIME)); ?>";
|
||||
} else if (today == "지난달") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-01', strtotime('-1 Month', $last_term)); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-t', strtotime('-1 Month', $last_term)); ?>";
|
||||
} else if (today == "전체") {
|
||||
document.getElementById("fr_date").value = "";
|
||||
document.getElementById("to_date").value = "";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function forderlist_submit(f)
|
||||
{
|
||||
if (!is_checked("chk[]")) {
|
||||
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var change_status = f.od_status.value;
|
||||
|
||||
if (f.od_status.checked == false) {
|
||||
alert("주문상태 변경에 체크하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var chk = document.getElementsByName("chk[]");
|
||||
|
||||
for (var i=0; i<chk.length; i++)
|
||||
{
|
||||
if (chk[i].checked)
|
||||
{
|
||||
var k = chk[i].value;
|
||||
var current_settle_case = f.elements['current_settle_case['+k+']'].value;
|
||||
var current_status = f.elements['current_status['+k+']'].value;
|
||||
|
||||
switch (change_status)
|
||||
{
|
||||
case "입금" :
|
||||
if (!(current_status == "주문" && current_settle_case == "무통장")) {
|
||||
alert("'주문' 상태의 '무통장'(결제수단)인 경우에만 '입금' 처리 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case "준비" :
|
||||
if (current_status != "입금") {
|
||||
alert("'입금' 상태의 주문만 '준비'로 변경이 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case "배송" :
|
||||
if (current_status != "준비") {
|
||||
alert("'준비' 상태의 주문만 '배송'으로 변경이 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var invoice = f.elements['od_invoice['+k+']'];
|
||||
var invoice_time = f.elements['od_invoice_time['+k+']'];
|
||||
var delivery_company = f.elements['od_delivery_company['+k+']'];
|
||||
|
||||
if ($.trim(invoice_time.value) == '') {
|
||||
alert("배송일시를 입력하시기 바랍니다.");
|
||||
invoice_time.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($.trim(delivery_company.value) == '') {
|
||||
alert("배송업체를 입력하시기 바랍니다.");
|
||||
delivery_company.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($.trim(invoice.value) == '') {
|
||||
alert("운송장번호를 입력하시기 바랍니다.");
|
||||
invoice.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!confirm("선택하신 주문서의 주문상태를 '"+change_status+"'상태로 변경하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
f.action = "./orderlistupdate_ticket.php";
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
262
adm/shop_admin/orderlist_chk.php
Normal file
262
adm/shop_admin/orderlist_chk.php
Normal file
@ -0,0 +1,262 @@
|
||||
<?php
|
||||
$sub_menu = '400413';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '완료주문확인';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
|
||||
$where = array();
|
||||
|
||||
// 퍼스트가든용
|
||||
// 특정 카테고리만 노출 제외를 위한 부분
|
||||
$ca_id = "20"; // 특정 카테고리 선택
|
||||
$sel_ca_id = "NOT ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다. 카테고리는 '분류관리'에서 확인, 최상위 카테고리 기준. 값을 추가할땐 or 을 사용하면 될듯.
|
||||
$tot_ct_qty = 0;
|
||||
$where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
|
||||
$od_status = '완료'; //입금처리 된것만 출력한다.
|
||||
$where[] = " a.od_status = '{$od_status}' ";
|
||||
// 퍼스트가든용 끝
|
||||
|
||||
include_once ('orderlist_head.php');
|
||||
|
||||
$sql_search = "";
|
||||
if ($search != "") {
|
||||
if ($sel_field != "") {
|
||||
$where[] = " $sel_field like '%$search%' ";
|
||||
}
|
||||
|
||||
if ($save_search != $search) {
|
||||
$page = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($where) {
|
||||
$sql_search = ' WHERE '.implode(' AND ', $where);
|
||||
}
|
||||
|
||||
if ($sel_field == "") $sel_field = "a.od_id";
|
||||
if ($sort1 == "") $sort1 = "a.od_id";
|
||||
if ($sort2 == "") $sort2 = "desc";
|
||||
|
||||
// 상품명, 단가, 수량, 카테고리를 불러오기 위해 DB를 합친다
|
||||
$sql_common = " FROM {$g5['g5_shop_order_table']} AS a
|
||||
LEFT JOIN {$g5['g5_shop_cart_table']} AS b ON a.od_id = b.od_id
|
||||
LEFT JOIN {$g5['g5_shop_item_table']} AS c ON b.it_id = c.it_id
|
||||
LEFT JOIN {$g5['g5_shop_item_option_table']} AS d ON c.it_id = d.it_id AND b.io_id = d.io_id
|
||||
";
|
||||
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
$sql = " SELECT count(a.od_id) AS cnt " . $sql_common ;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
// 상품명, 수량, 단가, 카테고리를 가져옴
|
||||
$sql = " SELECT a.*,
|
||||
(a.od_cart_coupon + a.od_coupon + a.od_send_coupon) as couponprice,
|
||||
b.it_name,
|
||||
b.ct_qty,
|
||||
b.ct_price,
|
||||
b.ct_option,
|
||||
b.io_id,
|
||||
c.ca_id,
|
||||
c.it_1,
|
||||
c.it_2,
|
||||
d.io_price
|
||||
$sql_common
|
||||
ORDER BY $sort1 $sort2
|
||||
LIMIT $from_record, $rows ";
|
||||
|
||||
$result = sql_query($sql);
|
||||
|
||||
$qstr1 = "od_status=".urlencode($od_status)."&
|
||||
od_settle_case=".urlencode($od_settle_case)."&
|
||||
od_misu=$od_misu&
|
||||
;od_cancel_price=$od_cancel_price&
|
||||
od_refund_price=$od_refund_price&
|
||||
od_receipt_point=$od_receipt_point&
|
||||
od_coupon=$od_coupon&
|
||||
fr_date=$fr_date&
|
||||
to_date=$to_date&
|
||||
sel_field=$sel_field&
|
||||
search=$search&
|
||||
save_search=$search";
|
||||
if($default['de_escrow_use'])
|
||||
$qstr1 .= "&od_escrow=$od_escrow";
|
||||
$qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page";
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
|
||||
// 주문삭제 히스토리 테이블 필드 추가
|
||||
if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_order_delete_table']}`
|
||||
ADD `mb_id` varchar(20) NOT NULL DEFAULT '' AFTER `de_data`,
|
||||
ADD `de_ip` varchar(255) NOT NULL DEFAULT '' AFTER `mb_id`,
|
||||
ADD `de_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `de_ip` ", true);
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
#container { height: unset;}
|
||||
</style>
|
||||
|
||||
<form name="frmorderlist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
|
||||
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
|
||||
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_search" value="<?php echo $search; ?>">
|
||||
|
||||
<label for="sel_field" class="sound_only">검색대상</label>
|
||||
<select name="sel_field" id="sel_field">
|
||||
<option value="od_tel" <?php echo get_selected($sel_field, 'od_tel'); ?> selected>연락처</option>
|
||||
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
|
||||
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
|
||||
</select>
|
||||
|
||||
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="search" value="<?php echo $search; ?>" id="search" class="frm_input" autocomplete="off">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</form>
|
||||
<form class="local_sch03 local_sch">
|
||||
<!--
|
||||
<div class="sch_last"">
|
||||
<strong>주문일자</strong>
|
||||
<input type="text" id="fr_date" name="fr_date" value="<?php echo $fr_date; ?>" class="frm_input" size="10" maxlength="10"> ~
|
||||
<input type="text" id="to_date" name="to_date" value="<?php echo $to_date; ?>" class="frm_input" size="10" maxlength="10">
|
||||
<button type="button" onclick="javascript:set_date('오늘');">오늘</button>
|
||||
<button type="button" onclick="javascript:set_date('어제');">어제</button>
|
||||
<button type="button" onclick="javascript:set_date('이번주');">이번주</button>
|
||||
<button type="button" onclick="javascript:set_date('이번달');">이번달</button>
|
||||
<button type="button" onclick="javascript:set_date('지난주');">지난주</button>
|
||||
<button type="button" onclick="javascript:set_date('지난달');">지난달</button>
|
||||
<button type="button" onclick="javascript:set_date('전체');">전체</button>
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
</form>
|
||||
-->
|
||||
<div>
|
||||
<form method="post" action="orderlist_chk_ex.php">
|
||||
<input type="hidden" name="sql_common" value="<?=$sql_common?>">
|
||||
<input type="hidden" name="sort1" value="<?=$sort1?>">
|
||||
<input type="hidden" name="sort2" value="<?=$sort2?>">
|
||||
<input type="hidden" name="from_record" value="<?=$from_record?>">
|
||||
<input type="hidden" name="rows" value="<?=$rows?>" >
|
||||
<button type="submit" class="list_excel" >엑셀</button>
|
||||
<!-- <input type="submit" value="엑셀저장" class="list_excel">-->
|
||||
</form>
|
||||
</div>
|
||||
<form name="forderlist" id="forderlist" onsubmit="return forderlist_submit(this);" method="post" autocomplete="off">
|
||||
<input type="hidden" name="search_od_status" value="<?php echo $od_status; ?>">
|
||||
|
||||
|
||||
<!-- 목록 시작 -->
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table id="sodr_list">
|
||||
<caption>주문 내역 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">주문 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<!-- <th scope="col" id="th_ordnum" style="width:200px;"><a href="<?php echo title_sort("od_id", 1)."&$qstr1"; ?>">주문번호</a></th>-->
|
||||
<th scope="col" id="th_odrer">주문일</th>
|
||||
<th scope="col" id="th_odrer" style="width:240px;">상품명</th>
|
||||
<th scope="col" id="th_odrer">옵션</th>
|
||||
<th scope="col" id="th_odrer">주문자</th>
|
||||
<th scope="col" id="th_odrertel">주문자전화</th>
|
||||
<th scope="col" style="width:85px;">단가</th>
|
||||
<th scope="col" style="width:62px;">주문수량</th>
|
||||
<th scope="col" style="width:85px;">합계</th>
|
||||
<!-- <th scope="col">입금합계</th>-->
|
||||
<th scope="col" style="min-width:62px;">상태</th>
|
||||
<th scope="col" style="min-width:62px;">상세</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$mb_nick = get_sideview($row['mb_id'], get_text($row['od_name']), $row['od_email'], '');
|
||||
?>
|
||||
|
||||
<!-- 목록 내용 시작 -->
|
||||
<tr class="orderlist<?php echo ' '.$bg; ?>">
|
||||
<td class="td_chk">
|
||||
<input type="hidden" name="od_id[<?php echo $i ?>]" value="<?php echo $row['od_id'] ?>" id="od_id_<?php echo $i ?>">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only">주문번호 <?php echo $row['od_id']; ?></label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
|
||||
</td>
|
||||
<!--
|
||||
<td headers="th_ordnum" class="td_odrnum2">
|
||||
<?php if ($is_admin == 'super'){ ?>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>" class="orderitem"><?php echo $disp_od_id; ?></a>
|
||||
<?php } else { echo $disp_od_id; }?>
|
||||
<?php echo $od_mobile; ?>
|
||||
<?php echo $od_paytype; ?>
|
||||
</td>
|
||||
-->
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo substr($row['od_receipt_time'],0,10) ?></td>
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo $row['it_name'] ?></td>
|
||||
<td heardrs="th_ordnum" class="td_odrnum2"><?php echo ($row['io_id']) ? $row['io_id'] : '' ?> </td>
|
||||
<td headers="th_odrer" class="td_name"><?php echo $mb_nick; ?></td>
|
||||
<td headers="th_odrertel" class="td_tel" style="text-align:center;"><?php echo add_hyphen(get_text($row['od_tel'])); ?></td>
|
||||
<td headers="th_odrcnt"><?php echo ($row['io_price']) ? number_format($row['ct_price']+$row['io_price']) : number_format($row['ct_price']) ?></td>
|
||||
<td headers="th_odrcnt"><?php echo $row['ct_qty']; ?></td>
|
||||
<td class="td_num td_numsum">
|
||||
<?php echo number_format(($row['ct_price'] + $row['io_price']) * $row['ct_qty']); ?>
|
||||
<?php // echo number_format($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']); // 같은 승인번호의 결제건 여러개가 있는 경우 금액이 알아보기 불편함 ?></td>
|
||||
<!-- <td class="td_num_right"><?php echo number_format($row['od_receipt_price']); ?></td>-->
|
||||
<td class="td_mng td_mng_s"><?php echo $row['od_status'] ?></td>
|
||||
<td class="td_mng td_mng_s">
|
||||
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&<?php echo $qstr; ?>" class="mng_mod btn btn_02"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$tot_itemcount += $row['od_cart_count'];
|
||||
$tot_orderprice += (($row['ct_price'] + $row['io_price']) * $row['ct_qty']);
|
||||
// $tot_orderprice += ($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']);
|
||||
$tot_ordercancel += $row['od_cancel_price'];
|
||||
$tot_receiptprice += $row['od_receipt_price'];
|
||||
$tot_couponprice += $row['couponprice'];
|
||||
$tot_ct_qty += $row['ct_qty'];
|
||||
}
|
||||
sql_free_result($result);
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="11" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="orderlist">
|
||||
<th scope="row" colspan="7">합 계</th>
|
||||
<td><?php echo $tot_ct_qty //number_format($tot_itemcount); ?>건</td>
|
||||
<td><?php echo number_format($tot_orderprice); ?></td>
|
||||
<!-- <td><?php echo number_format($tot_receiptprice); ?></td>-->
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="local_desc02 local_desc">
|
||||
<p>
|
||||
<사용>버튼을 클릭하면 티켓 사용처리가 완료됩니다. 부분사용, 부분취소가 불가능하므로 이용수량이 다른 경우 고객님께 꼭 확인해주시기 바랍니다.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&page="); ?>
|
||||
|
||||
<?php
|
||||
include_once ('orderlist_tail.php');
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
212
adm/shop_admin/orderlist_chk_ex.php
Normal file
212
adm/shop_admin/orderlist_chk_ex.php
Normal file
@ -0,0 +1,212 @@
|
||||
<?php
|
||||
//include_once('./_common.php');
|
||||
|
||||
$file_name = "orderlist_".date("ymd")."_".date("His").".xls"; // 파일명지정
|
||||
|
||||
header("Content-Type: application/vnd.ms-excel");
|
||||
header('Content-Type: application/vnd.ms-excel; charset=utf-8');
|
||||
header("Content-Disposition: attachment; filename=$file_name");
|
||||
header("Content-Description: PHP5 Generated Data");
|
||||
|
||||
$sql = " SELECT a.*,
|
||||
(a.od_cart_coupon + a.od_coupon + a.od_send_coupon) as couponprice,
|
||||
b.it_name,
|
||||
b.ct_qty,
|
||||
b.ct_price,
|
||||
b.ct_option,
|
||||
c.ca_id
|
||||
$sql_common
|
||||
ORDER BY $sort1 $sort2
|
||||
";
|
||||
$sql= stripslashes($sql);
|
||||
$result = sql_query($sql);
|
||||
?>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
|
||||
<style type="text/css">
|
||||
.tit {background-color:#C0C0C0; height:30px; }
|
||||
.no-text {mso-number-format:'\@'; text-align:center;}
|
||||
</style>
|
||||
|
||||
|
||||
<table cellspacing="0" cellpadding="0" border="1">
|
||||
<caption>주문 내역 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">주문 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<!-- <th scope="col" id="th_ordnum" style="width:200px;"><a href="<?php echo title_sort("od_id", 1)."&$qstr1"; ?>">주문번호</a></th>-->
|
||||
<th scope="col" id="th_odrer">주문일</th>
|
||||
<th scope="col" id="th_odrer" style="width:240px;">상품명</th>
|
||||
<th scope="col" id="th_odrer">옵션</th>
|
||||
<th scope="col" id="th_odrer">주문자</th>
|
||||
<th scope="col" id="th_odrertel">주문자전화</th>
|
||||
<th scope="col" style="width:85px;">단가<br>(옵션가)</th>
|
||||
<th scope="col" style="width:62px;">주문수량</th>
|
||||
<th scope="col" style="width:85px;">합계</th>
|
||||
<!-- <th scope="col">입금합계</th>-->
|
||||
<th scope="col" style="width:62px;">사용처리</th>
|
||||
<th scope="col" style="width:61px;">상세</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
// '입금'인 것만 출력
|
||||
if ($row['od_status'] != '입금') continue;
|
||||
// 결제 수단
|
||||
$s_receipt_way = $s_br = "";
|
||||
if ($row['od_settle_case'])
|
||||
{
|
||||
$s_receipt_way = $row['od_settle_case'];
|
||||
$s_br = '<br />';
|
||||
|
||||
// 간편결제
|
||||
if($row['od_settle_case'] == '간편결제') {
|
||||
switch($row['od_pg']) {
|
||||
case 'lg':
|
||||
$s_receipt_way = 'PAYNOW';
|
||||
break;
|
||||
case 'inicis':
|
||||
$s_receipt_way = 'KPAY';
|
||||
break;
|
||||
case 'kcp':
|
||||
$s_receipt_way = 'PAYCO';
|
||||
break;
|
||||
default:
|
||||
$s_receipt_way = $row['od_settle_case'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_receipt_way = '결제수단없음';
|
||||
$s_br = '<br />';
|
||||
}
|
||||
|
||||
if ($row['od_receipt_point'] > 0)
|
||||
$s_receipt_way .= $s_br."포인트";
|
||||
|
||||
$mb_nick = get_sideview($row['mb_id'], get_text($row['od_name']), $row['od_email'], '');
|
||||
|
||||
$od_cnt = 0;
|
||||
if ($row['mb_id'])
|
||||
{
|
||||
$sql2 = " select count(*) as cnt from {$g5['g5_shop_order_table']} where mb_id = '{$row['mb_id']}' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
$od_cnt = $row2['cnt'];
|
||||
}
|
||||
|
||||
// 주문 번호에 device 표시
|
||||
$od_mobile = '';
|
||||
if($row['od_mobile'])
|
||||
$od_mobile = '(M)';
|
||||
|
||||
// 주문번호에 - 추가
|
||||
switch(strlen($row['od_id'])) {
|
||||
case 16:
|
||||
$disp_od_id = substr($row['od_id'],0,8).'-'.substr($row['od_id'],8);
|
||||
break;
|
||||
default:
|
||||
$disp_od_id = substr($row['od_id'],0,6).'-'.substr($row['od_id'],6);
|
||||
break;
|
||||
}
|
||||
|
||||
// 주문 번호에 에스크로 표시
|
||||
$od_paytype = '';
|
||||
if($row['od_test'])
|
||||
$od_paytype .= '<span class="list_test">테스트</span>';
|
||||
|
||||
if($default['de_escrow_use'] && $row['od_escrow'])
|
||||
$od_paytype .= '<span class="list_escrow">에스크로</span>';
|
||||
|
||||
$uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
|
||||
|
||||
$invoice_time = is_null_time($row['od_invoice_time']) ? G5_TIME_YMDHIS : $row['od_invoice_time'];
|
||||
$delivery_company = $row['od_delivery_company'] ? $row['od_delivery_company'] : $default['de_delivery_company'];
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
$td_color = 0;
|
||||
if($row['od_cancel_price'] > 0) {
|
||||
$bg .= 'cancel';
|
||||
$td_color = 1;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- 목록 내용 시작 -->
|
||||
<tr class="orderlist<?php echo ' '.$bg; ?>">
|
||||
<td class="td_chk">
|
||||
<input type="hidden" name="od_id[<?php echo $i ?>]" value="<?php echo $row['od_id'] ?>" id="od_id_<?php echo $i ?>">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only">주문번호 <?php echo $row['od_id']; ?></label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
|
||||
</td>
|
||||
<!--
|
||||
<td headers="th_ordnum" class="td_odrnum2">
|
||||
<?php if ($is_admin == 'super'){ ?>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>" class="orderitem"><?php echo $disp_od_id; ?></a>
|
||||
<?php } else { echo $disp_od_id; }?>
|
||||
<?php echo $od_mobile; ?>
|
||||
<?php echo $od_paytype; ?>
|
||||
</td>
|
||||
-->
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo substr($row['od_receipt_time'],0,10) ?></td>
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo $row['it_name'] ?></td>
|
||||
<td heardrs="th_ordnum" class="td_odrnum2"><?php echo ($row['io_id']) ? $row['io_id'] : '' ?> </td>
|
||||
<td headers="th_odrer" class="td_name"><?php echo $mb_nick; ?></td>
|
||||
<td headers="th_odrertel" class="td_tel" style="text-align:center;"><?php echo add_hyphen(get_text($row['od_tel'])); ?></td>
|
||||
<td headers="th_odrcnt"><?php echo ($row['io_price']) ? number_format($row['ct_price']+$row['io_price']) : number_format($row['ct_price']) ?></td>
|
||||
<td headers="th_odrcnt"><?php echo $row['ct_qty']; ?></td>
|
||||
<td class="td_num td_numsum">
|
||||
<?php echo number_format(($row['ct_price'] + $row['io_price']) * $row['ct_qty']); ?>
|
||||
<?php // echo number_format($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']); // 같은 승인번호의 결제건 여러개가 있는 경우 금액이 알아보기 불편함 ?></td>
|
||||
<!-- <td class="td_num_right"><?php echo number_format($row['od_receipt_price']); ?></td>-->
|
||||
<td class="td_mng td_mng_s">
|
||||
<?php
|
||||
// 사용처리
|
||||
// 사용처리 버튼 출력을 위한 부분
|
||||
if ($row['it_2'] && (substr($row['od_receipt_time'],0,10) == date('Y-m-d'))) { // 당일주문 사용불가 대상 & 당일주문 체크
|
||||
echo '사용불가<br>당일주문';
|
||||
// 상태가 '입금' 이 아니면서 유효기간이 지났거나 주문 상태가 취소인 경우
|
||||
} else if ($row['od_status'] != '입금' || $row['it_1'] < date("ymd") && !isset($row['it_1']) || $row['od_status'] == '취소') {
|
||||
echo "사용불가<br>(";
|
||||
if( $row['od_status'] == '취소' ) echo "취소)"; // 취소라면
|
||||
else echo "유효일자:".$row['it_1'].")"; // 유효일자가 지났다면
|
||||
} else { // 위 조건에 해당하지 않으면 사용처리 버튼 출력
|
||||
?>
|
||||
<a href="orderliveupdate.php?bo=u&od_id=<?php echo $row['od_id']; ?>&st=<?php echo $row['od_status'];?>" class="mng_mod btn btn_04"><span class="sound_only"><?php echo $row['od_id']; ?></span>사용</a>
|
||||
<?php } //사용처리 버튼 끝 ?>
|
||||
</td>
|
||||
<td class="td_mng td_mng_s">
|
||||
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&<?php echo $qstr; ?>" class="mng_mod btn btn_02"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$tot_itemcount += $row['od_cart_count'];
|
||||
$tot_orderprice += (($row['ct_price'] + $row['io_price']) * $row['ct_qty']);
|
||||
// $tot_orderprice += ($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']);
|
||||
$tot_ordercancel += $row['od_cancel_price'];
|
||||
$tot_receiptprice += $row['od_receipt_price'];
|
||||
$tot_couponprice += $row['couponprice'];
|
||||
$tot_ct_qty += $row['ct_qty'];
|
||||
}
|
||||
sql_free_result($result);
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="11" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="orderlist">
|
||||
<th scope="row" colspan="7">합 계</th>
|
||||
<td><?php echo $tot_ct_qty //number_format($tot_itemcount); ?>건</td>
|
||||
<td><?php echo number_format($tot_orderprice); ?></td>
|
||||
<!-- <td><?php echo number_format($tot_receiptprice); ?></td>-->
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
66
adm/shop_admin/orderlist_ex.php
Normal file
66
adm/shop_admin/orderlist_ex.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$file_name = "orderlist_".date("ymd")."_".date("His").".xls"; // 파일명지정
|
||||
|
||||
header("Content-Type: application/vnd.ms-excel");
|
||||
header('Content-Type: application/vnd.ms-excel; charset=utf-8');
|
||||
header("Content-Disposition: attachment; filename=$file_name");
|
||||
header("Content-Description: PHP5 Generated Data");
|
||||
|
||||
$sql = " SELECT a.*,
|
||||
(a.od_cart_coupon + a.od_coupon + a.od_send_coupon) as couponprice,
|
||||
b.it_name,
|
||||
b.ct_qty,
|
||||
b.ct_price,
|
||||
b.ct_option,
|
||||
c.ca_id
|
||||
$sql_common
|
||||
ORDER BY $sort1 $sort2
|
||||
";
|
||||
$sql= stripslashes($sql);
|
||||
$result = sql_query($sql);
|
||||
?>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
|
||||
<style type="text/css">
|
||||
.tit {background-color:#C0C0C0; height:30px; }
|
||||
.no-text {mso-number-format:'\@'; text-align:center;}
|
||||
</style>
|
||||
|
||||
<table cellspacing="0" cellpadding="0" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="tit">주문번호</th>
|
||||
<th class="tit">승인번호</th>
|
||||
<th class="tit">주문자명</th>
|
||||
<th class="tit">연락처</th>
|
||||
<th class="tit">상태</th>
|
||||
<th class="tit">상품명</th>
|
||||
<th class="tit">수량</th>
|
||||
<th class="tit">단가</th>
|
||||
<th class="tit">주문금액</th>
|
||||
<th class="tit">총결제금액</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) { // 반복문 시작
|
||||
?>
|
||||
<tr>
|
||||
<td class="no-text"><?php echo $row['od_id']; ?> </td>
|
||||
<td class="no-text"><?php echo $row['od_app_no']?> </td>
|
||||
<td style="text-align:center"> <?php echo $row['od_name']?> </td>
|
||||
<td class="no-text"><?php echo get_text($row['od_tel']); ?></td>
|
||||
<td style="text-align:center"> <?php echo $row['od_status']?> </td>
|
||||
<td style="text-align:center"> <?php echo $row['it_name'];?> </td>
|
||||
<td style="text-align:center"> <?php echo $row['ct_qty'];?> </td>
|
||||
<td style="text-align:center"> <?php echo number_format($row['ct_price']);?> </td>
|
||||
<td style="text-align:center"> <?php echo number_format($row['ct_price'] * $row['ct_qty']);?> </td>
|
||||
<td style="text-align:center"><?php echo number_format($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']); ?></td>
|
||||
</tr>
|
||||
<?php } // 반복문 종료 ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
651
adm/shop_admin/orderlist_hy.php
Normal file
651
adm/shop_admin/orderlist_hy.php
Normal file
@ -0,0 +1,651 @@
|
||||
<?php
|
||||
$sub_menu = '400421';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '혜윰 주문확인';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
|
||||
$where = array();
|
||||
|
||||
// 퍼스트가든용
|
||||
// $od_status = '입금'; //입금처리 된것만 출력한다.
|
||||
// 특정 카테고리만 노출
|
||||
$ca_id = "20"; // 특정 카테고리 선택
|
||||
$sel_ca_id = " ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다.
|
||||
$where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
|
||||
$tot_ct_qty = 0;
|
||||
// 퍼스트가든용 끝
|
||||
|
||||
include_once ('orderlist_head.php');
|
||||
|
||||
$sql_search = "";
|
||||
if ($search != "") {
|
||||
if ($sel_field != "") {
|
||||
$where[] = " $sel_field like '%$search%' ";
|
||||
}
|
||||
|
||||
if ($save_search != $search) {
|
||||
$page = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($od_status) {
|
||||
switch($od_status) {
|
||||
case '전체취소':
|
||||
$where[] = " a.od_status = '취소' ";
|
||||
break;
|
||||
case '부분취소':
|
||||
$where[] = " a.od_status IN('주문', '입금', '준비', '배송', '완료') and a.od_cancel_price > 0 ";
|
||||
break;
|
||||
default:
|
||||
$where[] = " a.od_status = '$od_status'";
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($od_status) {
|
||||
case '주문' :
|
||||
$sort1 = "a.od_id";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
case '입금' : // 결제완료
|
||||
$sort1 = "a.od_receipt_time";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
case '배송' : // 배송중
|
||||
$sort1 = "a.od_invoice_time";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($od_settle_case) {
|
||||
$where[] = " a.od_settle_case = '$od_settle_case' ";
|
||||
}
|
||||
|
||||
if ($od_misu) {
|
||||
$where[] = " a.od_misu != 0 ";
|
||||
}
|
||||
|
||||
if ($od_cancel_price) {
|
||||
$where[] = " a.od_cancel_price != 0 ";
|
||||
}
|
||||
|
||||
if ($od_refund_price) {
|
||||
$where[] = " a.od_refund_price != 0 ";
|
||||
}
|
||||
|
||||
if ($od_receipt_point) {
|
||||
$where[] = " a.od_receipt_point != 0 ";
|
||||
}
|
||||
|
||||
if ($od_coupon) {
|
||||
$where[] = " ( a.od_cart_coupon > 0 or a.od_coupon > 0 or a.od_send_coupon > 0 ) ";
|
||||
}
|
||||
|
||||
if ($od_escrow) {
|
||||
$where[] = " a.od_escrow = 1 ";
|
||||
}
|
||||
|
||||
if ($fr_date && $to_date) {
|
||||
$where[] = " a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
|
||||
}
|
||||
|
||||
if ($where) {
|
||||
$sql_search = ' where '.implode(' and ', $where);
|
||||
}
|
||||
|
||||
if ($sel_field == "") $sel_field = "a.od_id";
|
||||
if ($sort1 == "") $sort1 = "a.od_id";
|
||||
if ($sort2 == "") $sort2 = "desc";
|
||||
|
||||
// 상품명, 단가, 수량, 카테고리를 불러오기 위해 DB를 합친다
|
||||
$sql_common = " FROM {$g5['g5_shop_order_table']} AS a LEFT
|
||||
JOIN {$g5['g5_shop_cart_table']} AS b ON a.od_id = b.od_id
|
||||
JOIN {$g5['g5_shop_item_table']} AS c ON b.it_id = c.it_id
|
||||
";
|
||||
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
$sql = " select count(a.od_id) as cnt " . $sql_common ;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = " SELECT a.*,
|
||||
(a.od_cart_coupon + a.od_coupon + a.od_send_coupon) as couponprice,
|
||||
b.it_name,
|
||||
b.ct_qty,
|
||||
b.ct_price,
|
||||
b.ct_option,
|
||||
c.ca_id
|
||||
$sql_common
|
||||
ORDER BY $sort1 $sort2
|
||||
LIMIT $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$qstr1 = "od_status=".urlencode($od_status)."&
|
||||
od_settle_case=".urlencode($od_settle_case)."&
|
||||
od_misu=$od_misu&
|
||||
od_cancel_price=$od_cancel_price&
|
||||
od_refund_price=$od_refund_price&
|
||||
od_receipt_point=$od_receipt_point&
|
||||
od_coupon=$od_coupon&
|
||||
fr_date=$fr_date&
|
||||
to_date=$to_date&
|
||||
sel_field=$sel_field&
|
||||
search=$search&
|
||||
save_search=$search";
|
||||
|
||||
if($default['de_escrow_use'])
|
||||
$qstr1 .= "&od_escrow=$od_escrow";
|
||||
$qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page";
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
|
||||
// 주문삭제 히스토리 테이블 필드 추가
|
||||
if(!sql_query(" select mb_id from {$g5['g5_shop_order_delete_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_order_delete_table']}`
|
||||
ADD `mb_id` varchar(20) NOT NULL DEFAULT '' AFTER `de_data`,
|
||||
ADD `de_ip` varchar(255) NOT NULL DEFAULT '' AFTER `mb_id`,
|
||||
ADD `de_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `de_ip` ", true);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?>
|
||||
<span class="btn_ov01"><span class="ov_txt">전체 주문내역</span><span class="ov_num"> <?php echo number_format($total_count); ?>건</span></span>
|
||||
<?php if($od_status == '준비' && $total_count > 0) { ?>
|
||||
<a href="./orderdelivery.php" id="order_delivery" class="ov_a">엑셀배송처리</a>
|
||||
<?php } ?>
|
||||
<div class="list_excel">
|
||||
<form method="post" action="orderlist_ex.php">
|
||||
<input type="hidden" name="sql_common" value="<?=$sql_common?>">
|
||||
<input type="hidden" name="sort1" value="<?=$sort1?>">
|
||||
<input type="hidden" name="sort2" value="<?=$sort2?>">
|
||||
<input type="hidden" name="from_record" value="<?=$from_record?>">
|
||||
<input type="hidden" name="rows" value="<?=$rows?>" >
|
||||
<input type="submit" value="엑셀저장" class="list_excel">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<form name="frmorderlist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
|
||||
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
|
||||
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_search" value="<?php echo $search; ?>">
|
||||
|
||||
<label for="sel_field" class="sound_only">검색대상</label>
|
||||
<select name="sel_field" id="sel_field">
|
||||
<option value="od_tel" <?php echo get_selected($sel_field, 'od_tel'); ?> selected>연락처</option>
|
||||
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
|
||||
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
|
||||
</select>
|
||||
|
||||
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="search" value="<?php echo $search; ?>" id="search" required class="required frm_input" autocomplete="off">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</form>
|
||||
|
||||
<form class="local_sch03 local_sch">
|
||||
<div>
|
||||
<strong>주문상태</strong>
|
||||
<input type="radio" name="od_status" value="" id="od_status_all" <?php echo get_checked($od_status, ''); ?>>
|
||||
<label for="od_status_all">전체</label>
|
||||
<input type="radio" name="od_status" value="주문" id="od_status_odr" <?php echo get_checked($od_status, '주문'); ?>>
|
||||
<label for="od_status_odr">주문</label>
|
||||
<input type="radio" name="od_status" value="입금" id="od_status_income" <?php echo get_checked($od_status, '입금'); ?>>
|
||||
<label for="od_status_income">입금</label>
|
||||
<input type="radio" name="od_status" value="준비" id="od_status_rdy" <?php echo get_checked($od_status, '준비'); ?>>
|
||||
<label for="od_status_rdy">준비</label>
|
||||
<input type="radio" name="od_status" value="배송" id="od_status_dvr" <?php echo get_checked($od_status, '배송'); ?>>
|
||||
<label for="od_status_dvr">배송</label>
|
||||
<input type="radio" name="od_status" value="완료" id="od_status_done" <?php echo get_checked($od_status, '완료'); ?>>
|
||||
<label for="od_status_done">완료</label>
|
||||
<input type="radio" name="od_status" value="전체취소" id="od_status_cancel" <?php echo get_checked($od_status, '전체취소'); ?>>
|
||||
<label for="od_status_cancel">전체취소</label>
|
||||
<!--
|
||||
<input type="radio" name="od_status" value="부분취소" id="od_status_pcancel" <?php echo get_checked($od_status, '부분취소'); ?>>
|
||||
<label for="od_status_pcancel">부분취소</label>
|
||||
-->
|
||||
</div>
|
||||
<div>
|
||||
<strong>결제수단</strong>
|
||||
<input type="radio" name="od_settle_case" value="" id="od_settle_case01" <?php echo get_checked($od_settle_case, ''); ?>>
|
||||
<label for="od_settle_case01">전체</label>
|
||||
<input type="radio" name="od_settle_case" value="무통장" id="od_settle_case02" <?php echo get_checked($od_settle_case, '무통장'); ?>>
|
||||
<label for="od_settle_case02">무통장</label>
|
||||
<input type="radio" name="od_settle_case" value="가상계좌" id="od_settle_case03" <?php echo get_checked($od_settle_case, '가상계좌'); ?>>
|
||||
<label for="od_settle_case03">가상계좌</label>
|
||||
<input type="radio" name="od_settle_case" value="계좌이체" id="od_settle_case04" <?php echo get_checked($od_settle_case, '계좌이체'); ?>>
|
||||
<label for="od_settle_case04">계좌이체</label>
|
||||
<input type="radio" name="od_settle_case" value="휴대폰" id="od_settle_case05" <?php echo get_checked($od_settle_case, '휴대폰'); ?>>
|
||||
<label for="od_settle_case05">휴대폰</label>
|
||||
<input type="radio" name="od_settle_case" value="신용카드" id="od_settle_case06" <?php echo get_checked($od_settle_case, '신용카드'); ?>>
|
||||
<label for="od_settle_case06">신용카드</label>
|
||||
<input type="radio" name="od_settle_case" value="간편결제" id="od_settle_case07" <?php echo get_checked($od_settle_case, '간편결제'); ?>>
|
||||
<label for="od_settle_case07">PG간편결제</label>
|
||||
<input type="radio" name="od_settle_case" value="KAKAOPAY" id="od_settle_case08" <?php echo get_checked($od_settle_case, 'KAKAOPAY'); ?>>
|
||||
<label for="od_settle_case08">KAKAOPAY</label>
|
||||
</div>
|
||||
<div class="sch_last"">
|
||||
<strong>주문일자</strong>
|
||||
<input type="text" id="fr_date" name="fr_date" value="<?php echo $fr_date; ?>" class="frm_input" size="10" maxlength="10"> ~
|
||||
<input type="text" id="to_date" name="to_date" value="<?php echo $to_date; ?>" class="frm_input" size="10" maxlength="10">
|
||||
<button type="button" onclick="javascript:set_date('오늘');">오늘</button>
|
||||
<button type="button" onclick="javascript:set_date('어제');">어제</button>
|
||||
<button type="button" onclick="javascript:set_date('이번주');">이번주</button>
|
||||
<button type="button" onclick="javascript:set_date('이번달');">이번달</button>
|
||||
<button type="button" onclick="javascript:set_date('지난주');">지난주</button>
|
||||
<button type="button" onclick="javascript:set_date('지난달');">지난달</button>
|
||||
<button type="button" onclick="javascript:set_date('전체');">전체</button>
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<form name="forderlist" id="forderlist" onsubmit="return forderlist_submit(this);" method="post" autocomplete="off">
|
||||
<input type="hidden" name="search_od_status" value="<?php echo $od_status; ?>">
|
||||
|
||||
<!-- 목록 시작 -->
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table id="sodr_list">
|
||||
<caption>주문 내역 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">주문 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<th scope="col" id="th_ordnum" style="width:160px;"><a href="<?php echo title_sort("od_id", 1)."&$qstr1"; ?>">주문번호</a></th>
|
||||
<th scope="col" id="odrstat">주문상태</th>
|
||||
<th scope="col" id="th_app_no">승인번호</th>
|
||||
<th scope="col" id="odrpay">결제수단</th>
|
||||
<th scope="col" id="th_odrer" style="width:200px;">상품명</th>
|
||||
<th scope="col" id="th_odrer">주문자</th>
|
||||
<th scope="col" id="th_odrertel">주문자전화</th>
|
||||
<th scope="col" style="width:100px;">단가</th>
|
||||
<th scope="col" style="width:80px;">주문수량</th>
|
||||
<th scope="col" style="width:120px;">주문합계</th>
|
||||
<th scope="col">입금합계</th>
|
||||
<th scope="col">주문취소</th>
|
||||
<th scope="col">확인</th>
|
||||
<th scope="col">상세</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
// 결제 수단
|
||||
$s_receipt_way = $s_br = "";
|
||||
if ($row['od_settle_case'])
|
||||
{
|
||||
$s_receipt_way = $row['od_settle_case'];
|
||||
$s_br = '<br />';
|
||||
|
||||
// 간편결제
|
||||
if($row['od_settle_case'] == '간편결제') {
|
||||
switch($row['od_pg']) {
|
||||
case 'lg':
|
||||
$s_receipt_way = 'PAYNOW';
|
||||
break;
|
||||
case 'inicis':
|
||||
$s_receipt_way = 'KPAY';
|
||||
break;
|
||||
case 'kcp':
|
||||
$s_receipt_way = 'PAYCO';
|
||||
break;
|
||||
default:
|
||||
$s_receipt_way = $row['od_settle_case'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_receipt_way = '결제수단없음';
|
||||
$s_br = '<br />';
|
||||
}
|
||||
|
||||
if ($row['od_receipt_point'] > 0)
|
||||
$s_receipt_way .= $s_br."포인트";
|
||||
|
||||
$mb_nick = get_sideview($row['mb_id'], get_text($row['od_name']), $row['od_email'], '');
|
||||
|
||||
$od_cnt = 0;
|
||||
if ($row['mb_id'])
|
||||
{
|
||||
$sql2 = " select count(*) as cnt from {$g5['g5_shop_order_table']} where mb_id = '{$row['mb_id']}' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
$od_cnt = $row2['cnt'];
|
||||
}
|
||||
|
||||
// 주문 번호에 device 표시
|
||||
$od_mobile = '';
|
||||
if($row['od_mobile'])
|
||||
$od_mobile = '(M)';
|
||||
|
||||
// 주문번호에 - 추가
|
||||
switch(strlen($row['od_id'])) {
|
||||
case 16:
|
||||
$disp_od_id = substr($row['od_id'],0,8).'-'.substr($row['od_id'],8);
|
||||
break;
|
||||
default:
|
||||
$disp_od_id = substr($row['od_id'],0,6).'-'.substr($row['od_id'],6);
|
||||
break;
|
||||
}
|
||||
|
||||
// 주문 번호에 에스크로 표시
|
||||
$od_paytype = '';
|
||||
if($row['od_test'])
|
||||
$od_paytype .= '<span class="list_test">테스트</span>';
|
||||
|
||||
if($default['de_escrow_use'] && $row['od_escrow'])
|
||||
$od_paytype .= '<span class="list_escrow">에스크로</span>';
|
||||
|
||||
$uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
|
||||
|
||||
$invoice_time = is_null_time($row['od_invoice_time']) ? G5_TIME_YMDHIS : $row['od_invoice_time'];
|
||||
$delivery_company = $row['od_delivery_company'] ? $row['od_delivery_company'] : $default['de_delivery_company'];
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
$td_color = 0;
|
||||
if($row['od_cancel_price'] > 0) {
|
||||
$bg .= 'cancel';
|
||||
$td_color = 1;
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- 목록 내용 시작 -->
|
||||
<tr class="orderlist<?php echo ' '.$bg; ?>">
|
||||
<td class="td_chk">
|
||||
<input type="hidden" name="od_id[<?php echo $i ?>]" value="<?php echo $row['od_id'] ?>" id="od_id_<?php echo $i ?>">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only">주문번호 <?php echo $row['od_id']; ?></label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
|
||||
</td>
|
||||
<td headers="th_ordnum" class="td_odrnum2">
|
||||
<?php if ($is_admin == 'super'){ ?>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>" class="orderitem"><?php echo $disp_od_id; ?></a>
|
||||
<?php } else { echo $disp_od_id; }?>
|
||||
<?php echo $od_mobile; ?>
|
||||
<?php echo $od_paytype; ?>
|
||||
</td>
|
||||
<td headers="odrstat" class="odrstat">
|
||||
<input type="hidden" name="current_status[<?php echo $i ?>]" value="<?php echo $row['od_status'] ?>">
|
||||
<?php echo $row['od_status']; ?>
|
||||
</td>
|
||||
<td headers="th_app_no" class="td_name"><?php echo get_text($row['od_app_no']); ?></a></td>
|
||||
<td headers="odrpay" class="odrpay">
|
||||
<input type="hidden" name="current_settle_case[<?php echo $i ?>]" value="<?php echo $row['od_settle_case'] ?>">
|
||||
<?php
|
||||
if ($s_receipt_way == "신용카드"){
|
||||
echo "신";
|
||||
} else if ($s_receipt_way == "무통장"){
|
||||
echo "무";
|
||||
} else if ($s_receipt_way == "가상계좌"){
|
||||
echo "가";
|
||||
} else if ($s_receipt_way == "휴대폰결제"){
|
||||
echo "휴";
|
||||
} else {
|
||||
echo $s_receipt_way;
|
||||
}
|
||||
|
||||
?>
|
||||
</td>
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo $row['it_name']; ?></td>
|
||||
<td headers="th_odrer" class="td_name"><?php echo $mb_nick; ?></td>
|
||||
<td headers="th_odrertel" class="td_tel" style="text-align:center;"><?php echo add_hyphen(get_text($row['od_tel'])); ?></td>
|
||||
<td headers="th_odrcnt"><?php echo number_format($row['ct_price']); ?></td>
|
||||
<td headers="th_odrcnt"><?php echo $row['ct_qty']; ?></td>
|
||||
<td class="td_num td_numsum"><?php echo number_format($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']); ?></td>
|
||||
<td class="td_num_right"><?php echo number_format($row['od_receipt_price']); ?></td>
|
||||
<td class="td_numcancel<?php echo $td_color; ?> td_num"><?php echo number_format($row['od_cancel_price']); ?></td>
|
||||
<td class="td_mng td_mng_s">
|
||||
<?php if($row['od_status'] == '입금' ) { /*입금이라면 확인처리 출력*/?>
|
||||
<a href="orderliveupdate.php?bo=u&it_id=<?php echo $row['od_id']; ?>&st=<?php echo $row['od_status'];?>" class="mng_mod btn btn_04"><span class="sound_only"><?php echo $row['od_id']; ?></span>완료</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="td_mng td_mng_s">
|
||||
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&<?php echo $qstr; ?>" class="mng_mod btn btn_02"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$tot_itemcount += $row['od_cart_count'];
|
||||
$tot_orderprice += ($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']);
|
||||
$tot_ordercancel += $row['od_cancel_price'];
|
||||
$tot_receiptprice += $row['od_receipt_price'];
|
||||
$tot_couponprice += $row['couponprice'];
|
||||
} // for문 종료
|
||||
sql_free_result($result);
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="12" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="orderlist">
|
||||
<th scope="row" colspan="8"> </th>
|
||||
<th scope="row">합 계</th>
|
||||
<td><?php echo number_format($tot_itemcount); ?>건</td>
|
||||
<td><?php echo number_format($tot_orderprice); ?></td>
|
||||
<td><?php echo number_format($tot_receiptprice); ?></td>
|
||||
<td><?php echo number_format($tot_ordercancel); ?></td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="local_cmd01 local_cmd">
|
||||
<?php if (($od_status == '' || $od_status == '완료' || $od_status == '전체취소' || $od_status == '부분취소') == false) {
|
||||
// 검색된 주문상태가 '전체', '완료', '전체취소', '부분취소' 가 아니라면
|
||||
?>
|
||||
<label for="od_status" class="cmd_tit">주문상태 변경</label>
|
||||
<?php
|
||||
$change_status = "";
|
||||
if ($od_status == '주문') $change_status = "입금";
|
||||
if ($od_status == '입금') $change_status = "완료";
|
||||
if ($od_status == '준비') $change_status = "배송";
|
||||
if ($od_status == '배송') $change_status = "완료";
|
||||
?>
|
||||
<label><input type="checkbox" name="od_status" value="<?php echo $change_status; ?>"> '<?php echo $od_status ?>'상태에서 '<strong><?php echo $change_status ?></strong>'상태로 변경합니다.</label>
|
||||
<?php if($od_status == '주문' || $od_status == '준비') { ?>
|
||||
<input type="checkbox" name="od_send_mail" value="1" id="od_send_mail" checked="checked">
|
||||
<label for="od_send_mail"><?php echo $change_status; ?>안내 메일</label>
|
||||
<input type="checkbox" name="send_sms" value="1" id="od_send_sms" checked="checked">
|
||||
<label for="od_send_sms"><?php echo $change_status; ?>안내 SMS</label>
|
||||
<?php } ?>
|
||||
<?php if($od_status == '준비') { ?>
|
||||
<input type="checkbox" name="send_escrow" value="1" id="od_send_escrow">
|
||||
<label for="od_send_escrow">에스크로배송등록</label>
|
||||
<?php } ?>
|
||||
<input type="submit" value="선택수정" class="btn_submit" onclick="document.pressed=this.value">
|
||||
<?php } ?>
|
||||
<?php if ($od_status == '주문') { ?> <span>주문상태에서만 삭제가 가능합니다.</span> <input type="submit" value="선택삭제" class="btn_submit" onclick="document.pressed=this.value"><?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="local_desc02 local_desc">
|
||||
<p>
|
||||
<완료>를 클릭하면 주문처리가 완료됩니다. <br>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&page="); ?>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#fr_date, #to_date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", showButtonPanel: true, yearRange: "c-99:c+99", maxDate: "+0d" });
|
||||
|
||||
// 주문상품보기
|
||||
$(".orderitem").on("click", function() {
|
||||
var $this = $(this);
|
||||
var od_id = $this.text().replace(/[^0-9]/g, "");
|
||||
|
||||
if($this.next("#orderitemlist").size())
|
||||
return false;
|
||||
|
||||
$("#orderitemlist").remove();
|
||||
|
||||
$.post(
|
||||
"./ajax.orderitem.php",
|
||||
{ od_id: od_id },
|
||||
function(data) {
|
||||
$this.after("<div id=\"orderitemlist\"><div class=\"itemlist\"></div></div>");
|
||||
$("#orderitemlist .itemlist")
|
||||
.html(data)
|
||||
.append("<div id=\"orderitemlist_close\"><button type=\"button\" id=\"orderitemlist-x\" class=\"btn_frmline\">닫기</button></div>");
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// 상품리스트 닫기
|
||||
$(".orderitemlist-x").on("click", function() {
|
||||
$("#orderitemlist").remove();
|
||||
});
|
||||
|
||||
$("body").on("click", function() {
|
||||
$("#orderitemlist").remove();
|
||||
});
|
||||
|
||||
// 엑셀배송처리창
|
||||
$("#order_delivery").on("click", function() {
|
||||
var opt = "width=600,height=450,left=10,top=10";
|
||||
window.open(this.href, "win_excel", opt);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function set_date(today)
|
||||
{
|
||||
<?php
|
||||
$date_term = date('w', G5_SERVER_TIME);
|
||||
$week_term = $date_term + 7;
|
||||
$last_term = strtotime(date('Y-m-01', G5_SERVER_TIME));
|
||||
?>
|
||||
if (today == "오늘") {
|
||||
document.getElementById("fr_date").value = "<?php echo G5_TIME_YMD; ?>";
|
||||
document.getElementById("to_date").value = "<?php echo G5_TIME_YMD; ?>";
|
||||
} else if (today == "어제") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME - 86400); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME - 86400); ?>";
|
||||
} else if (today == "이번주") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-d', strtotime('-'.$date_term.' days', G5_SERVER_TIME)); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME); ?>";
|
||||
} else if (today == "이번달") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-01', G5_SERVER_TIME); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME); ?>";
|
||||
} else if (today == "지난주") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-d', strtotime('-'.$week_term.' days', G5_SERVER_TIME)); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-d', strtotime('-'.($week_term - 6).' days', G5_SERVER_TIME)); ?>";
|
||||
} else if (today == "지난달") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-01', strtotime('-1 Month', $last_term)); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-t', strtotime('-1 Month', $last_term)); ?>";
|
||||
} else if (today == "전체") {
|
||||
document.getElementById("fr_date").value = "";
|
||||
document.getElementById("to_date").value = "";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function forderlist_submit(f)
|
||||
{
|
||||
if (!is_checked("chk[]")) {
|
||||
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var change_status = f.od_status.value;
|
||||
|
||||
if (f.od_status.checked == false) {
|
||||
alert("주문상태 변경에 체크하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var chk = document.getElementsByName("chk[]");
|
||||
|
||||
for (var i=0; i<chk.length; i++)
|
||||
{
|
||||
if (chk[i].checked)
|
||||
{
|
||||
var k = chk[i].value;
|
||||
var current_settle_case = f.elements['current_settle_case['+k+']'].value;
|
||||
var current_status = f.elements['current_status['+k+']'].value;
|
||||
|
||||
switch (change_status)
|
||||
{
|
||||
case "입금" :
|
||||
if (!(current_status == "주문" && current_settle_case == "무통장")) {
|
||||
alert("'주문' 상태의 '무통장'(결제수단)인 경우에만 '입금' 처리 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case "준비" :
|
||||
if (current_status != "입금") {
|
||||
alert("'입금' 상태의 주문만 '준비'로 변경이 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case "배송" :
|
||||
if (current_status != "준비") {
|
||||
alert("'준비' 상태의 주문만 '배송'으로 변경이 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var invoice = f.elements['od_invoice['+k+']'];
|
||||
var invoice_time = f.elements['od_invoice_time['+k+']'];
|
||||
var delivery_company = f.elements['od_delivery_company['+k+']'];
|
||||
|
||||
if ($.trim(invoice_time.value) == '') {
|
||||
alert("배송일시를 입력하시기 바랍니다.");
|
||||
invoice_time.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($.trim(delivery_company.value) == '') {
|
||||
alert("배송업체를 입력하시기 바랍니다.");
|
||||
delivery_company.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($.trim(invoice.value) == '') {
|
||||
alert("운송장번호를 입력하시기 바랍니다.");
|
||||
invoice.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!confirm("선택하신 주문서의 주문상태를 '"+change_status+"'상태로 변경하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
f.action = "./orderlistupdate_ticket.php";
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
346
adm/shop_admin/orderlist_ticket.php
Normal file
346
adm/shop_admin/orderlist_ticket.php
Normal file
@ -0,0 +1,346 @@
|
||||
<?php
|
||||
$sub_menu = '400411';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '매표소 주문확인';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
|
||||
$where = array();
|
||||
|
||||
// 퍼스트가든용
|
||||
// 특정 카테고리만 노출 제외를 위한 부분
|
||||
$ca_id = "20"; // 특정 카테고리 선택
|
||||
$sel_ca_id = "NOT ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다. 카테고리는 '분류관리'에서 확인, 최상위 카테고리 기준. 값을 추가할땐 or 을 사용하면 될듯.
|
||||
$tot_ct_qty = 0;
|
||||
$where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
|
||||
$od_status = '입금'; //입금처리 된것만 출력한다.
|
||||
$where[] = " a.od_status = '{$od_status}' ";
|
||||
// 퍼스트가든용 끝
|
||||
|
||||
include_once ('orderlist_head.php');
|
||||
|
||||
$sql_search = "";
|
||||
if ($search != "") {
|
||||
if ($sel_field != "") {
|
||||
$where[] = " $sel_field like '%$search%' ";
|
||||
}
|
||||
|
||||
if ($save_search != $search) {
|
||||
$page = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($where) {
|
||||
$sql_search = ' WHERE '.implode(' AND ', $where);
|
||||
}
|
||||
|
||||
if ($sel_field == "") $sel_field = "a.od_id";
|
||||
if ($sort1 == "") $sort1 = "a.od_id";
|
||||
if ($sort2 == "") $sort2 = "desc";
|
||||
|
||||
// 상품명, 단가, 수량, 카테고리를 불러오기 위해 DB를 합친다
|
||||
$sql_common = " FROM {$g5['g5_shop_order_table']} AS a
|
||||
LEFT JOIN {$g5['g5_shop_cart_table']} AS b ON a.od_id = b.od_id
|
||||
LEFT JOIN {$g5['g5_shop_item_table']} AS c ON b.it_id = c.it_id
|
||||
LEFT JOIN {$g5['g5_shop_item_option_table']} AS d ON c.it_id = d.it_id AND b.io_id = d.io_id
|
||||
";
|
||||
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
$sql = " SELECT count(a.od_id) AS cnt " . $sql_common ;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
// 상품명, 수량, 단가, 카테고리를 가져옴
|
||||
$sql = " SELECT a.*,
|
||||
(a.od_cart_coupon + a.od_coupon + a.od_send_coupon) as couponprice,
|
||||
b.it_name,
|
||||
b.ct_qty,
|
||||
b.ct_price,
|
||||
b.ct_option,
|
||||
b.io_id,
|
||||
c.ca_id,
|
||||
c.it_1,
|
||||
c.it_2,
|
||||
d.io_price
|
||||
$sql_common
|
||||
ORDER BY $sort1 $sort2
|
||||
LIMIT $from_record, $rows ";
|
||||
|
||||
$result = sql_query($sql);
|
||||
|
||||
$qstr1 = "od_status=".urlencode($od_status)."&
|
||||
od_settle_case=".urlencode($od_settle_case)."&
|
||||
od_misu=$od_misu&
|
||||
;od_cancel_price=$od_cancel_price&
|
||||
od_refund_price=$od_refund_price&
|
||||
od_receipt_point=$od_receipt_point&
|
||||
od_coupon=$od_coupon&
|
||||
fr_date=$fr_date&
|
||||
to_date=$to_date&
|
||||
sel_field=$sel_field&
|
||||
search=$search&
|
||||
save_search=$search";
|
||||
if($default['de_escrow_use'])
|
||||
$qstr1 .= "&od_escrow=$od_escrow";
|
||||
$qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page";
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
|
||||
// 주문삭제 히스토리 테이블 필드 추가
|
||||
if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_order_delete_table']}`
|
||||
ADD `mb_id` varchar(20) NOT NULL DEFAULT '' AFTER `de_data`,
|
||||
ADD `de_ip` varchar(255) NOT NULL DEFAULT '' AFTER `mb_id`,
|
||||
ADD `de_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `de_ip` ", true);
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
#container { height: unset;}
|
||||
</style>
|
||||
|
||||
<form name="frmorderlist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
|
||||
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
|
||||
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_search" value="<?php echo $search; ?>">
|
||||
|
||||
<label for="sel_field" class="sound_only">검색대상</label>
|
||||
<select name="sel_field" id="sel_field">
|
||||
<option value="od_tel" <?php echo get_selected($sel_field, 'od_tel'); ?> selected>연락처</option>
|
||||
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
|
||||
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
|
||||
</select>
|
||||
|
||||
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="search" value="<?php echo $search; ?>" id="search" class="frm_input" autocomplete="off">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</form>
|
||||
<!--
|
||||
<form class="local_sch03 local_sch">
|
||||
<div class="sch_last"">
|
||||
<strong>주문일자</strong>
|
||||
<input type="text" id="fr_date" name="fr_date" value="<?php echo $fr_date; ?>" class="frm_input" size="10" maxlength="10"> ~
|
||||
<input type="text" id="to_date" name="to_date" value="<?php echo $to_date; ?>" class="frm_input" size="10" maxlength="10">
|
||||
<button type="button" onclick="javascript:set_date('오늘');">오늘</button>
|
||||
<button type="button" onclick="javascript:set_date('어제');">어제</button>
|
||||
<button type="button" onclick="javascript:set_date('이번주');">이번주</button>
|
||||
<button type="button" onclick="javascript:set_date('이번달');">이번달</button>
|
||||
<button type="button" onclick="javascript:set_date('지난주');">지난주</button>
|
||||
<button type="button" onclick="javascript:set_date('지난달');">지난달</button>
|
||||
<button type="button" onclick="javascript:set_date('전체');">전체</button>
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
</form>
|
||||
-->
|
||||
<!-- 엑셀변환 작업중
|
||||
<div>
|
||||
<form method="post" action="orderlist_ticket_ex.php">
|
||||
<input type="hidden" name="sql_common" value="<?=$sql_common?>">
|
||||
<input type="hidden" name="sort1" value="<?=$sort1?>">
|
||||
<input type="hidden" name="sort2" value="<?=$sort2?>">
|
||||
<input type="hidden" name="from_record" value="<?=$from_record?>">
|
||||
<input type="hidden" name="rows" value="<?=$rows?>" >
|
||||
<input type="submit" value="엑셀저장" class="list_excel">
|
||||
</form>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<!-- 크리스마스용 판매확인 -->
|
||||
<?php
|
||||
$count_sql = "SELECT a.*, (a.od_cart_coupon + a.od_coupon + a.od_send_coupon) as couponprice, b.it_name, b.ct_qty, b.ct_price, b.ct_option, b.io_id, c.ca_id, c.it_1, c.it_2, d.io_price
|
||||
FROM {$g5['g5_shop_order_table']} AS a
|
||||
LEFT JOIN {$g5['g5_shop_cart_table']} AS b ON a.od_id = b.od_id
|
||||
LEFT JOIN {$g5['g5_shop_item_table']} AS c ON b.it_id = c.it_id
|
||||
LEFT JOIN {$g5['g5_shop_item_option_table']} AS d ON c.it_id = d.it_id AND b.io_id = d.io_id";
|
||||
//$test = $count_sql.' WHERE b.it_name = "2024 크리스마스 이브 - 캔들라이트 콘서트" AND b.io_id = "R석일반"';
|
||||
|
||||
function cntQuery($count_sql,$where){
|
||||
$query = sql_query($count_sql.$where);
|
||||
if (sql_num_rows($query)) {
|
||||
foreach ($query as $row) {
|
||||
if (!isset($result)) $result = $row['ct_qty'];
|
||||
else $result += $row['ct_qty'];
|
||||
}
|
||||
return $result;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<h2>크리스마스주문내역 Total</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>R석</th>
|
||||
<th>S석</th>
|
||||
<th>A석</th>
|
||||
<th>유아</th>
|
||||
<th><b>계</b></th>
|
||||
<th>대인</th>
|
||||
<th>소인</th>
|
||||
<th>유아</th>
|
||||
<th><b>계</b></th>
|
||||
<th><b>합계</b></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php
|
||||
$xmas_eve_r = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 이브 - 캔들라이트 콘서트" AND b.io_id = "R석일반"');
|
||||
$xmas_eve_s = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 이브 - 캔들라이트 콘서트" AND b.io_id = "S석일반"');
|
||||
$xmas_eve_a = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 이브 - 캔들라이트 콘서트" AND b.io_id = "A석일반"');
|
||||
$xmas_eve_36 = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 이브 - 캔들라이트 콘서트" AND (b.io_id = "R석36개월미만 OR b.io_id = S석36개월미만" OR b.io_id = "A석36개월미만")');
|
||||
$xmas_eve_total = $xmas_eve_r + $xmas_eve_s + $xmas_eve_a + $xmas_eve_36;
|
||||
$xmas_n = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 - 스타일리쉬 매직쇼" AND b.io_id = "대인"');
|
||||
$xmas_s = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 - 스타일리쉬 매직쇼" AND b.io_id = "소인"');
|
||||
$xmas_36 = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 - 스타일리쉬 매직쇼" AND b.io_id = "36개월 미만"');
|
||||
$xmas_total = $xmas_n + $xmas_s + $xmas_36;
|
||||
?>
|
||||
<td><?=$xmas_eve_r?></td>
|
||||
<td><?=$xmas_eve_s?></td>
|
||||
<td><?=$xmas_eve_a?></td>
|
||||
<td><?=$xmas_eve_36?></td>
|
||||
<td><b><?=$xmas_eve_total?></b></td>
|
||||
<td><?=$xmas_n?></td>
|
||||
<td><?=$xmas_s?></td>
|
||||
<td><?=$xmas_36?></td>
|
||||
<td><b><?=$xmas_total?></b></td>
|
||||
<td><b><?=$xmas_total+$xmas_eve_total?></b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- 크리스마스용 판매확인 끝 -->
|
||||
<form name="forderlist" id="forderlist" onsubmit="return forderlist_submit(this);" method="post" autocomplete="off">
|
||||
<input type="hidden" name="search_od_status" value="<?php echo $od_status; ?>">
|
||||
|
||||
|
||||
<!-- 목록 시작 -->
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table id="sodr_list">
|
||||
<caption>주문 내역 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">주문 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<!-- <th scope="col" id="th_ordnum" style="width:200px;"><a href="<?php echo title_sort("od_id", 1)."&$qstr1"; ?>">주문번호</a></th>-->
|
||||
<th scope="col" id="th_odrer">주문일</th>
|
||||
<th scope="col" id="th_odrer" style="width:240px;">상품명</th>
|
||||
<th scope="col" id="th_odrer">옵션</th>
|
||||
<th scope="col" id="th_odrer">주문자</th>
|
||||
<th scope="col" id="th_odrertel">주문자전화</th>
|
||||
<th scope="col" style="width:85px;">단가</th>
|
||||
<th scope="col" style="width:62px;">주문수량</th>
|
||||
<th scope="col" style="width:85px;">합계</th>
|
||||
<!-- <th scope="col">입금합계</th>-->
|
||||
<th scope="col" style="min-width:62px;">사용처리</th>
|
||||
<th scope="col" style="min-width:62px;">상세</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$mb_nick = get_sideview($row['mb_id'], get_text($row['od_name']), $row['od_email'], '');
|
||||
?>
|
||||
|
||||
<!-- 목록 내용 시작 -->
|
||||
<tr class="orderlist<?php echo ' '.$bg; ?>">
|
||||
<td class="td_chk">
|
||||
<input type="hidden" name="od_id[<?php echo $i ?>]" value="<?php echo $row['od_id'] ?>" id="od_id_<?php echo $i ?>">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only">주문번호 <?php echo $row['od_id']; ?></label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
|
||||
</td>
|
||||
<!--
|
||||
<td headers="th_ordnum" class="td_odrnum2">
|
||||
<?php if ($is_admin == 'super'){ ?>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>" class="orderitem"><?php echo $disp_od_id; ?></a>
|
||||
<?php } else { echo $disp_od_id; }?>
|
||||
<?php echo $od_mobile; ?>
|
||||
<?php echo $od_paytype; ?>
|
||||
</td>
|
||||
-->
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo substr($row['od_receipt_time'],0,10) ?></td>
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo $row['it_name'] ?></td>
|
||||
<td heardrs="th_ordnum" class="td_odrnum2"><?php echo ($row['io_id']) ? $row['io_id'] : '' ?> </td>
|
||||
<td headers="th_odrer" class="td_name"><?php echo $mb_nick; ?></td>
|
||||
<td headers="th_odrertel" class="td_tel" style="text-align:center;"><?php echo add_hyphen(get_text($row['od_tel'])); ?></td>
|
||||
<td headers="th_odrcnt"><?php echo ($row['io_price']) ? number_format($row['ct_price']+$row['io_price']) : number_format($row['ct_price']) ?></td>
|
||||
<td headers="th_odrcnt"><?php echo $row['ct_qty']; ?></td>
|
||||
<td class="td_num td_numsum">
|
||||
<?php echo number_format(($row['ct_price'] + $row['io_price']) * $row['ct_qty']); ?>
|
||||
<?php // echo number_format($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']); // 같은 승인번호의 결제건 여러개가 있는 경우 금액이 알아보기 불편함 ?></td>
|
||||
<!-- <td class="td_num_right"><?php echo number_format($row['od_receipt_price']); ?></td>-->
|
||||
<td class="td_mng td_mng_s">
|
||||
<?php
|
||||
// 사용처리
|
||||
// 사용처리 버튼 출력을 위한 부분
|
||||
if ($row['it_2'] && (substr($row['od_receipt_time'],0,10) == date('Y-m-d'))) { // 당일주문 사용불가 대상 & 당일주문 체크
|
||||
echo '사용불가<br>당일주문';
|
||||
// 상태가 '입금' 이 아니면서 유효기간이 지났거나 주문 상태가 취소인 경우
|
||||
} else if ($row['od_status'] != '입금' || $row['it_1'] < date("ymd") && !isset($row['it_1']) || $row['od_status'] == '취소') {
|
||||
echo "사용불가<br>(";
|
||||
if( $row['od_status'] == '취소' ) echo "취소)"; // 취소라면
|
||||
else echo "유효일자:".$row['it_1'].")"; // 유효일자가 지났다면
|
||||
} else { // 위 조건에 해당하지 않으면 사용처리 버튼 출력
|
||||
?>
|
||||
<a href="orderliveupdate.php?bo=u&od_id=<?php echo $row['od_id']; ?>&st=<?php echo $row['od_status'];?>" class="mng_mod btn btn_04"><span class="sound_only"><?php echo $row['od_id']; ?></span>사용</a>
|
||||
<?php } //사용처리 버튼 끝 ?>
|
||||
</td>
|
||||
<td class="td_mng td_mng_s">
|
||||
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&<?php echo $qstr; ?>" class="mng_mod btn btn_02"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$tot_itemcount += $row['od_cart_count'];
|
||||
$tot_orderprice += (($row['ct_price'] + $row['io_price']) * $row['ct_qty']);
|
||||
// $tot_orderprice += ($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']);
|
||||
$tot_ordercancel += $row['od_cancel_price'];
|
||||
$tot_receiptprice += $row['od_receipt_price'];
|
||||
$tot_couponprice += $row['couponprice'];
|
||||
$tot_ct_qty += $row['ct_qty'];
|
||||
}
|
||||
sql_free_result($result);
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="11" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="orderlist">
|
||||
<th scope="row" colspan="7">합 계</th>
|
||||
<td><?php echo $tot_ct_qty //number_format($tot_itemcount); ?>건</td>
|
||||
<td><?php echo number_format($tot_orderprice); ?></td>
|
||||
<!-- <td><?php echo number_format($tot_receiptprice); ?></td>-->
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="local_desc02 local_desc">
|
||||
<p>
|
||||
<사용>버튼을 클릭하면 티켓 사용처리가 완료됩니다. 부분사용, 부분취소가 불가능하므로 이용수량이 다른 경우 고객님께 꼭 확인해주시기 바랍니다.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&page="); ?>
|
||||
|
||||
<?php
|
||||
include_once ('orderlist_tail.php');
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
212
adm/shop_admin/orderlist_ticket_ex.php
Normal file
212
adm/shop_admin/orderlist_ticket_ex.php
Normal file
@ -0,0 +1,212 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$file_name = "orderlist_".date("ymd")."_".date("His").".xls"; // 파일명지정
|
||||
|
||||
header("Content-Type: application/vnd.ms-excel");
|
||||
header('Content-Type: application/vnd.ms-excel; charset=utf-8');
|
||||
header("Content-Disposition: attachment; filename=$file_name");
|
||||
header("Content-Description: PHP5 Generated Data");
|
||||
|
||||
$sql = " SELECT a.*,
|
||||
(a.od_cart_coupon + a.od_coupon + a.od_send_coupon) as couponprice,
|
||||
b.it_name,
|
||||
b.ct_qty,
|
||||
b.ct_price,
|
||||
b.ct_option,
|
||||
c.ca_id
|
||||
$sql_common
|
||||
ORDER BY $sort1 $sort2
|
||||
";
|
||||
$sql= stripslashes($sql);
|
||||
$result = sql_query($sql);
|
||||
?>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
|
||||
<style type="text/css">
|
||||
.tit {background-color:#C0C0C0; height:30px; }
|
||||
.no-text {mso-number-format:'\@'; text-align:center;}
|
||||
</style>
|
||||
|
||||
|
||||
<table cellspacing="0" cellpadding="0" border="1">
|
||||
<caption>주문 내역 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">주문 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<!-- <th scope="col" id="th_ordnum" style="width:200px;"><a href="<?php echo title_sort("od_id", 1)."&$qstr1"; ?>">주문번호</a></th>-->
|
||||
<th scope="col" id="th_odrer">주문일</th>
|
||||
<th scope="col" id="th_odrer" style="width:240px;">상품명</th>
|
||||
<th scope="col" id="th_odrer">옵션</th>
|
||||
<th scope="col" id="th_odrer">주문자</th>
|
||||
<th scope="col" id="th_odrertel">주문자전화</th>
|
||||
<th scope="col" style="width:85px;">단가<br>(옵션가)</th>
|
||||
<th scope="col" style="width:62px;">주문수량</th>
|
||||
<th scope="col" style="width:85px;">합계</th>
|
||||
<!-- <th scope="col">입금합계</th>-->
|
||||
<th scope="col" style="width:62px;">사용처리</th>
|
||||
<th scope="col" style="width:61px;">상세</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
// '입금'인 것만 출력
|
||||
if ($row['od_status'] != '입금') continue;
|
||||
// 결제 수단
|
||||
$s_receipt_way = $s_br = "";
|
||||
if ($row['od_settle_case'])
|
||||
{
|
||||
$s_receipt_way = $row['od_settle_case'];
|
||||
$s_br = '<br />';
|
||||
|
||||
// 간편결제
|
||||
if($row['od_settle_case'] == '간편결제') {
|
||||
switch($row['od_pg']) {
|
||||
case 'lg':
|
||||
$s_receipt_way = 'PAYNOW';
|
||||
break;
|
||||
case 'inicis':
|
||||
$s_receipt_way = 'KPAY';
|
||||
break;
|
||||
case 'kcp':
|
||||
$s_receipt_way = 'PAYCO';
|
||||
break;
|
||||
default:
|
||||
$s_receipt_way = $row['od_settle_case'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_receipt_way = '결제수단없음';
|
||||
$s_br = '<br />';
|
||||
}
|
||||
|
||||
if ($row['od_receipt_point'] > 0)
|
||||
$s_receipt_way .= $s_br."포인트";
|
||||
|
||||
$mb_nick = get_sideview($row['mb_id'], get_text($row['od_name']), $row['od_email'], '');
|
||||
|
||||
$od_cnt = 0;
|
||||
if ($row['mb_id'])
|
||||
{
|
||||
$sql2 = " select count(*) as cnt from {$g5['g5_shop_order_table']} where mb_id = '{$row['mb_id']}' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
$od_cnt = $row2['cnt'];
|
||||
}
|
||||
|
||||
// 주문 번호에 device 표시
|
||||
$od_mobile = '';
|
||||
if($row['od_mobile'])
|
||||
$od_mobile = '(M)';
|
||||
|
||||
// 주문번호에 - 추가
|
||||
switch(strlen($row['od_id'])) {
|
||||
case 16:
|
||||
$disp_od_id = substr($row['od_id'],0,8).'-'.substr($row['od_id'],8);
|
||||
break;
|
||||
default:
|
||||
$disp_od_id = substr($row['od_id'],0,6).'-'.substr($row['od_id'],6);
|
||||
break;
|
||||
}
|
||||
|
||||
// 주문 번호에 에스크로 표시
|
||||
$od_paytype = '';
|
||||
if($row['od_test'])
|
||||
$od_paytype .= '<span class="list_test">테스트</span>';
|
||||
|
||||
if($default['de_escrow_use'] && $row['od_escrow'])
|
||||
$od_paytype .= '<span class="list_escrow">에스크로</span>';
|
||||
|
||||
$uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
|
||||
|
||||
$invoice_time = is_null_time($row['od_invoice_time']) ? G5_TIME_YMDHIS : $row['od_invoice_time'];
|
||||
$delivery_company = $row['od_delivery_company'] ? $row['od_delivery_company'] : $default['de_delivery_company'];
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
$td_color = 0;
|
||||
if($row['od_cancel_price'] > 0) {
|
||||
$bg .= 'cancel';
|
||||
$td_color = 1;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- 목록 내용 시작 -->
|
||||
<tr class="orderlist<?php echo ' '.$bg; ?>">
|
||||
<td class="td_chk">
|
||||
<input type="hidden" name="od_id[<?php echo $i ?>]" value="<?php echo $row['od_id'] ?>" id="od_id_<?php echo $i ?>">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only">주문번호 <?php echo $row['od_id']; ?></label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
|
||||
</td>
|
||||
<!--
|
||||
<td headers="th_ordnum" class="td_odrnum2">
|
||||
<?php if ($is_admin == 'super'){ ?>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>" class="orderitem"><?php echo $disp_od_id; ?></a>
|
||||
<?php } else { echo $disp_od_id; }?>
|
||||
<?php echo $od_mobile; ?>
|
||||
<?php echo $od_paytype; ?>
|
||||
</td>
|
||||
-->
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo substr($row['od_receipt_time'],0,10) ?></td>
|
||||
<td headers="th_ordnum" class="td_odrnum2"><?php echo $row['it_name'] ?></td>
|
||||
<td heardrs="th_ordnum" class="td_odrnum2"><?php echo ($row['io_id']) ? $row['io_id'] : '' ?> </td>
|
||||
<td headers="th_odrer" class="td_name"><?php echo $mb_nick; ?></td>
|
||||
<td headers="th_odrertel" class="td_tel" style="text-align:center;"><?php echo add_hyphen(get_text($row['od_tel'])); ?></td>
|
||||
<td headers="th_odrcnt"><?php echo ($row['io_price']) ? number_format($row['ct_price']+$row['io_price']) : number_format($row['ct_price']) ?></td>
|
||||
<td headers="th_odrcnt"><?php echo $row['ct_qty']; ?></td>
|
||||
<td class="td_num td_numsum">
|
||||
<?php echo number_format(($row['ct_price'] + $row['io_price']) * $row['ct_qty']); ?>
|
||||
<?php // echo number_format($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']); // 같은 승인번호의 결제건 여러개가 있는 경우 금액이 알아보기 불편함 ?></td>
|
||||
<!-- <td class="td_num_right"><?php echo number_format($row['od_receipt_price']); ?></td>-->
|
||||
<td class="td_mng td_mng_s">
|
||||
<?php
|
||||
// 사용처리
|
||||
// 사용처리 버튼 출력을 위한 부분
|
||||
if ($row['it_2'] && (substr($row['od_receipt_time'],0,10) == date('Y-m-d'))) { // 당일주문 사용불가 대상 & 당일주문 체크
|
||||
echo '사용불가<br>당일주문';
|
||||
// 상태가 '입금' 이 아니면서 유효기간이 지났거나 주문 상태가 취소인 경우
|
||||
} else if ($row['od_status'] != '입금' || $row['it_1'] < date("ymd") && !isset($row['it_1']) || $row['od_status'] == '취소') {
|
||||
echo "사용불가<br>(";
|
||||
if( $row['od_status'] == '취소' ) echo "취소)"; // 취소라면
|
||||
else echo "유효일자:".$row['it_1'].")"; // 유효일자가 지났다면
|
||||
} else { // 위 조건에 해당하지 않으면 사용처리 버튼 출력
|
||||
?>
|
||||
<a href="orderliveupdate.php?bo=u&od_id=<?php echo $row['od_id']; ?>&st=<?php echo $row['od_status'];?>" class="mng_mod btn btn_04"><span class="sound_only"><?php echo $row['od_id']; ?></span>사용</a>
|
||||
<?php } //사용처리 버튼 끝 ?>
|
||||
</td>
|
||||
<td class="td_mng td_mng_s">
|
||||
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&<?php echo $qstr; ?>" class="mng_mod btn btn_02"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$tot_itemcount += $row['od_cart_count'];
|
||||
$tot_orderprice += (($row['ct_price'] + $row['io_price']) * $row['ct_qty']);
|
||||
// $tot_orderprice += ($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']);
|
||||
$tot_ordercancel += $row['od_cancel_price'];
|
||||
$tot_receiptprice += $row['od_receipt_price'];
|
||||
$tot_couponprice += $row['couponprice'];
|
||||
$tot_ct_qty += $row['ct_qty'];
|
||||
}
|
||||
sql_free_result($result);
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="11" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="orderlist">
|
||||
<th scope="row" colspan="7">합 계</th>
|
||||
<td><?php echo $tot_ct_qty //number_format($tot_itemcount); ?>건</td>
|
||||
<td><?php echo number_format($tot_orderprice); ?></td>
|
||||
<!-- <td><?php echo number_format($tot_receiptprice); ?></td>-->
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
Reference in New Issue
Block a user