영카트 주문내역리스트에 회원 닉네임 검색을 추가하고싶습니다.

영카트 주문내역리스트에 회원 닉네임 검색을 추가하고싶습니다.

QA

영카트 주문내역리스트에 회원 닉네임 검색을 추가하고싶습니다.

본문

orderlist.php에 회원디비 닉네임 검색을 추가하고싶습니다.

이 질문에 댓글 쓰기 :

답변 5

/adm/shop_admin/orderlist.php 내용

 


<?php
$sub_menu = '400400';
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();
 
$sql_search = "";
if ($search != "") {
    if ($sel_field != "") {
      if ($sel_field == 'mb_nick'){
        $res = sql_fetch("select mb_id from {$g5['member_table']} where mb_nick like '%".$search."%'");
        $where[] = " mb_id = '{$res['mb_id']}' ";
      }else{
        $where[] = " $sel_field like '%$search%' ";
      }
    }
 
    if ($save_search != $search) {
        $page = 1;
    }
}
 
//이하 생략...

 

약 140번째줄


<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="mb_nick" <?php echo get_selected($sel_field, 'mb_nick'); ?>>닉네임</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>
</select>
/* 이하 생략 */

 

아래와 같이 변형해서 쓰시면 될것 같습니다.


$sql_search = "";
if ($search != "") {
    if ($sel_field != "") {
      if ($sel_field == 'mb_nick'){
        $res = sql_query("select mb_id from {$g5['member_table']} where mb_nick like '%".$search."%'");
        for($i=0;$iddata=sql_fetch_array($res);$i++){
          if($i!=0){ $idwhere .= " or "; }
          $idwhere .= " mb_id = '{$iddata['mb_id']}' ";
        }
        if(mysql_num_rows($res)){
          $where[] = $idwhere;
        }else{
          $where[] = "mb_id = '$search' ";
        }
      }else{
        $where[] = " $sel_field like '%$search%' ";
      }
    }
 
    if ($save_search != $search) {
        $page = 1;
    }
}
답변을 작성하시기 전에 로그인 해주세요.
전체 125,940 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT