/home/mjc1/public_html/j3demo/adm/cart_order_rank.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<?php
$sub_menu 
"500400";
$dir ".";
include_once(
$dir."/_common.php");
include(
$j3_adm_path."/shop_header.php");

$click_edit "click_edit";

$where2 "  ";

$stx urldecode($stx);

if(
$stx!=''){
    
$where2 .= " and {$sti} like '%{$stx}%' ";
}

if(
$stc==''){
    
$stc 2;
}

$list_num $config['page_line'];
if(
$_COOKIE['page_line']!=''){ $list_num $_COOKIE['page_line']; }
if (
$page 1) { $page 1; } // 페이지가 없으면 첫 페이지 (1 페이지)

$list_array prod_cart_rank_get($stc$where2$page$list_num);

$total_page $list_array[0]['total_page'];
$list_num $list_array[0]['list_num'];
$total_count $list_array[0]['total_count'];

$qstr $_SERVER['QUERY_STRING'];

//_pr($list_array);

?>
<!--<div id="contents" style="background:#999"><img src="http://placehold.it/960x150" alt="롤링배너"></div>-->
<div id="wrap" class='container_wrap'>
    <div id="sub-title">
        <h2>상품판매 랭킹</h2>
        <div class="sub-location">
            <a href="./index.php" class="home"><span class="screen_out">홈</span></a>
            <span class="location-gt"></span>
            <a>쇼핑몰현황</a>
            <span class="location-gt"></span>
            <a>상품판매 랭킹</a>
        </div>
    </div>
<form name='prod_qa_search_form' method='get'>
    <input type='hidden' name='biztype' size='' value='<?php echo $biztype;?>'>
    <div id="sub-contents-area">
        <div class="sub-btn-area">
            <div class="sub-btn">
                <!--<a class="lignt-blue-btn" id='btn_order_new'>신규등록</a><a class="blue-btn" id='sel_edit'>선택수정</a><a class="blue-btn">주문복사</a><?php if($Orow['ordstate']==0){ ?><a class="black-btn">전체삭제</a><?php }?><a class="gray-btn" id='buy_print'>인쇄</a><a class="gray-btn" id='xls_down'>엑셀</a><a class="black-btn" id='sel_delete'>선택삭제</a>-->
            </div>
        </div>
        <div class="sub-btn-area">
            <div class="sub-btn sub-btn-search">
                <input type='radio' name='stc' value='0' <?php if($stc=='0'){ echo "checked"; }?>>장바구니담기&nbsp;
                <input type='radio' name='stc' value='2' <?php if($stc=='2'){ echo "checked"; }?>>주문완료&nbsp;
                <input type='radio' name='stc' value='3' <?php if($stc=='3'){ echo "checked"; }?>>취소&nbsp;
                <select name='sti'>
                    <!--<option value='a.od_id' <?php if($sti=='a.od_id'){?>selected<?php }?>>주문번호</option>-->
                    <option value='a.name' <?php if($sti=='a.ct_name'){?>selected<?php }?>>상품명</option>
                    <!--<option value='a.opt_name' <?php if($sti=='a.opt_name'){?>selected<?php }?>>옵션명</option>
                    <option value='c.login_id' <?php if($sti=='c.login_id'){?>selected<?php }?>>거래처id</option>
                    <option value='c.comp_name' <?php if($sti=='c.comp_name'){?>selected<?php }?>>거래처명</option>-->
                </select>
                <input type='text' id='stx' name='stx' size='' value='<?php echo $stx;?>' class="stx_class">&nbsp;<a href="#" class="black-btn" id='search_btn_press'>검색</a>
            </div>
        </div>
        <span class='help_info'>원하는 상태를 선택하고 검색버튼을 누르면 수량랭킹이 표시됩니다. 장바구니 담거나 판매안된 상품은 표시되지 않습니다.</span>
    </div>
</form>
    <div class="item_tab screen_out">
        <div class="item_tab_navi">
            <a value='0'><span>기초 재고관리</span></a>
            <a value='1' class="on"><span>재고조정 관리</span></a>
        </div>
    </div>

<form name='prod_qa_list_form' method='post'>
<input type='hidden' name='sel_del' value=''>
    <div class="div-list-area">
        <div class="cust-list-area">
            <table class="order-sheet2">
                <caption class="screen_out">매입처 원장 조회<caption>
                <colgroup>
                <col style="width:30px;">
                <col style="width:60px;"><col style="width:60px;"><col style="width:200px;">
                <!--<col style="width:200px;"><col style="width:100px;">--><col style="width:60px;">
                <!--<col style="width:80px;"><col style="width:120px;">--><col style="width:60px;">
                </colgroup>

                <thead>
                    <tr>
                        <th scope="col"><input type='checkbox' name='ck_all' class='check_all_class'></th>
                        <th scope="col">이미지</th><th scope="col">상품코드</th><th scope="col">상품명</th>
                        <!--<th scope="col">옵션명</th><th scope="col">판매가격/옵션가격</th>--><th scope="col">수량</th>
                        <!--<th scope="col">거래처id</th><th scope="col">거래처명</th>--><th scope="col">상태</th>
                    </tr>
                </thead>
                <tbody class='change_check_class'>
<?php 
    
for($i=0;$i<count($list_array);$i++){ 
        
$info $list_array[$i];
        if(
$info['pcode']==''){ continue; }
?>
                    <tr>
                        <td class="tcenter ">
                            <input type='checkbox' name='code_idx[]' value='<?php echo $i;?>' class='code_idx_calss'>
                            <input type='hidden' name='codes[]' value='<?php echo $info['idx'];?>'>
                        </td>
                        <td class="tcenter padd_5px"><img src='<?php echo $thumb_file get_it_thumbnail($info['pcode'],$info['pic1'],50,50);?>' width=50></td>
                        <td class="tcenter "><?php echo $info['code1'];?></td>
                        <td class="linetxt" ><a href='./product_reg.php?code=<?php echo $info['pcode'];?>'><?php echo $info['name'];?></a></td>
                        <td class="tcenter "><?php echo $info['cart_cnt'];?></td>
                        <!--<td class="tcenter "><?php echo $info['login_id'];?></td>
                        <td class="tcenter "><?php echo $info['comp_name'];?></td>-->
                        <td class="tcenter "><?php echo $ct_state_list[$stc];?></td>
                    </tr>
<?php 
    

?>
                </tbody>
            </table>
        </div>
    </div>
</form>

    <div class='pg_wrap' style='padding-top:0px;'>
        <?php echo get_paging($list_num$page$total_page"?$qstr");?>
    </div>

</div><!--//wrap-->

<script>
var qstr = '<?php echo $qstr;?>';
$(function(){
    $(".item_tab_navi a").click(function(){ //네비게이션 탭 처리
        v = $(this).attr("value");
        if(v==0){
            document.location.href="./product_prod_qa.php";
        } else {
            document.location.href="./product_prod_qa_edit.php";
        }
    });

    $(".check_all_class").click(function(){ // 전체선택 전체선택 해제
        if($(this).is(":checked")){
            $("input[name='code_idx[]']").prop("checked",true);
        } else {
            $("input[name='code_idx[]']").prop("checked",false);            
        }
    });
    
    $("#sel_delete").click(function(){ // 선택삭제
        var ck_cnt = 0;
        var v = $("input[name='code_idx[]']").each(function(){
            if($(this).is(":checked")){ ck_cnt++; }
        });
        if(ck_cnt==0){ alert('삭제하실 장바구니를 선택하세요.'); return; }
        if(confirm('정말로 선택하신 '+ck_cnt+'개의 장바구니를 삭제하시겠습니까?')){
            $("input[name='sel_del']").val("Y");
            var form_data = $("form[name='prod_qa_list_form']").serialize();

            $.ajax({type:"post", url:"ajax.product_cart_process.php", data:form_data, async:false, dataType : "xml", 
                success:function(xml){    
                    var v_mode = $(xml).find("mode").text();
                    var v_mode_ok = $(xml).find("mode_ok").text();
                    var v_msg = $(xml).find("msg").text();
                    if(v_mode_ok!='Y'){
                        alert(v_msg);
                    } else {
                        document.location.reload();
                    }
                },
                error:function(rtn,status,error){    alert(error);        }
            });
        }
    });


    $("#xls_down").click(function(){ // 엑셀다운로드
        alert('준비중입니다.'); return;
        document.prod_qa_search_form.action='product_xls_down.php';
        document.prod_qa_search_form.target = '_blank';
        document.prod_qa_search_form.submit();
        document.prod_qa_search_form.action='?';
        document.prod_qa_search_form.target = '';
    });

    $("#search_btn_press").click(function(){ // 검색버튼 누를때
        document.prod_qa_search_form.action='?';
        document.prod_qa_search_form.target = '';
        document.prod_qa_search_form.submit();
    });

});
</script>
<?php 
    
//_pr($_COOKIE['qstr']);
    
include($j3_adm_path."/shop_footer.php");
?>
<div id="modal_member_box" title="거래처수정" style="display:none;width:100%; height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;"></div>
<div id="modal_member_box2" title="거래처수정" style="display:none;width:100%; height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;"></div>