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
206
207
208
209
210
211
212
213
214
|
<?php include("./_common.php");
if($order_key==''){ if($_COOKIE['ok_customer']!=''){ $order_key = $_COOKIE['ok_customer']; } else { $order_key = 'dealdate desc'; } }
if($stm==''){ $stm = '1'; } if($stm2==''){ $stm2 = '1'; }
$where = " and login_id <> '' and ocode = '{$configshop['office_code']}' "; //$where = " "; if($biztype=='' || $biztype=='1'){ $where .= " and biztype = '1' "; $biztype = "1"; } else if($biztype=='0'){ $where .= " and biztype = '0' "; } else if($biztype=='2'){ $where .= " and biztype = '2' "; }
if($stx!=''){ $where .= " and {$sti} like '%{$stx}%' "; }
if($stm=='1'){ $where .= " and a.user_define4 = '1' "; }
if($stm2=='1'){ $where .= " and a.email <> '' "; }
if($stc!=''){ $where .= " and a.comp_name like '%$stc%' "; }
$sql = "select count(*) as cnt from (select 3, dealdate, a.pname, savepoint as savept from sale_d a left join sale_m b on a.midx = b.midx where savepoint>0 and ccode = '{$id_ccode}' union select 4, dealdate, remarks as pname, point as savept from point_edit where ccode = '{$id_ccode}' union select 5, m.orddate, concat('주문사용:',s.od_id), use_point from sale_ord_m m inner join sale_ord_s s on m.midx = s.midx left join (select midx, count(*) as cnt from sale_ord_sd group by midx) sd on m.midx = sd.midx where m.ccode = '{$id_ccode}' and m.ocode = '{$configshop['office_code']}' and s.ord_cancel <> 1 and use_point > 0 ) aa "; //echo $sql; $result = mysql_query($sql,$connect_j3); $row = mysql_fetch_array($result); $total_count = $row['cnt'];
if($win=='mobile'){ $list_num = 6; } else { $list_num = 10; } if($_COOKIE['page_line']!=''){ $list_num = $_COOKIE['page_line']; } $total_page = ceil($total_count / $list_num); // 전체 페이지 계산 if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) $from_record = ($page - 1) * $list_num; // 시작 열을 구함
$sql = "select * from (select 3, dealdate, a.pname, savepoint as savept from sale_d a left join sale_m b on a.midx = b.midx where savepoint>0 and ccode = '{$id_ccode}' union select 4, dealdate, remarks as pname, point as savept from point_edit where ccode = '{$id_ccode}' union select 5, m.orddate, concat('주문사용:',s.od_id), use_point from sale_ord_m m inner join sale_ord_s s on m.midx = s.midx left join (select midx, count(*) as cnt from sale_ord_sd group by midx) sd on m.midx = sd.midx where m.ccode = '{$id_ccode}' and m.ocode = '{$configshop['office_code']}' and s.ord_cancel <> 1 and use_point > 0 ) aa order by $order_key limit $from_record, $list_num"; $result = mysql_query($sql,$connect_j3);
//_pr($sql); while($cus_info=mysql_fetch_array($result)){ $list_array[] = $cus_info; }
$qstr = $_SERVER['QUERY_STRING'];
?> <style> /* 리스트 테이블 */
.div-list-area { margin-top:20px; <?php if($win=='mobile'){?>font-size:0.6em;<?php }?> } .cust-list-area { overflow-x:auto;border-top:1px solid #e0e0e0;} .order-sheet2 { /*width:1350px;*/table-layout: fixed;width:100%;/* font-size:0.9em;*/} .order-sheet2 tr {border-right:1px solid #E1E1E1;} .order-sheet2 th {height:30px; line-height:30px; text-align:center; font-weight:600; border-bottom:1px solid #E1E1E1; background:#f7f7f7; border-left:1px solid #E1E1E1; } .order-sheet2 td {height:30px; line-height:30px; text-align:center; border-bottom:1px solid #E1E1E1;border-left:1px solid #E1E1E1;} .order-sheet2 td input[type=text] {padding:0 5px; width:170px; height:24px; line-height:24px} .order-sheet2 td input.long-text {width:810px} .order-sheet2 .step span {font-weight:600} .order-sheet2 td.dark-border {border-bottom:1px solid #888} .order-sheet2 td.total-bgcolor {color:#333; font-weight:600; background:#9ac4eb} .order-sheet2 td.cost {padding-right:3px; text-align:right} .order-sheet2 th.cost {padding-right:3px; text-align:right} .order-sheet2 td.linetxt {padding-left:3px; text-align:left} .order-sheet2 td.tcenter {padding-right:3px; text-align:center} .order-sheet2 td.beginning-balance {color:#2f6ba9; font-size:14px; font-weight:600; background:#FFC} .order-sheet2 tfoot th, .order-sheet tfoot td {height:36px; line-height:36px; text-align:center; font-weight:600; border-bottom:1px solid #000; background:#E8E8E8} .order-sheet2 .class_td_tfoot {height:36px; line-height:36px; text-align:center; font-weight:600; border-bottom:1px solid #000; background:#E8E8E8} .order-sheet2 .class_td_tfoot td{border-bottom:1px solid #333 !important; } .order-sheet2 tfoot th {background:#E1E1E1} .order-sheet2 tfoot td {font-size:14px;}
.paging_sel_class { width:80px;} .group-add-btn { width:25px;padding:3px 0px;} .glass_class {cursor:pointer;}
</style>
<div class='container_wrap' style='width:100%;'> <!-- 검색영역 --> <form name='point_search_form' method='get' onsubmit='return false;'> <input type='hidden' name='biztype' size='' value='<?php echo $biztype;?>'> <input type='hidden' name='mode' size='' value='<?php echo $mode;?>'> <div id="sub-contents-area"> <div class="sub-btn-area"> <div class="sub-btn sub-btn-search" style='margin-left:-200px;display:none;'> <select name='sti'> <option value='a.comp_name' <?php if($sti=='a.comp_name'){?>selected<?php }?>>상호명</option> <option value='a.login_id' <?php if($sti=='a.login_id'){?>selected<?php }?>>아이디</option> <option value='a.comp_sn' <?php if($sti=='a.comp_sn'){?>selected<?php }?>>사업자번호</option> <option value='a.ceo_name' <?php if($sti=='a.ceo_name'){?>selected<?php }?>>대표자</option> <option value='a.telno' <?php if($sti=='a.telno'){?>selected<?php }?>>전화번호</option> <option value='a.hpno' <?php if($sti=='a.hpno'){?>selected<?php }?>>핸드폰</option> <option value='a.email' <?php if($sti=='a.email'){?>selected<?php }?>>이메일</option> <option value='a.memo' <?php if($sti=='a.memo'){?>selected<?php }?>>메모</option> </select> <input type='text' id='stx' name='stx' size='' value='<?php echo $stx;?>' class="stx_class"> <a href="#" class="black-btn" id='search_btn_press'>검색</a> </div> </div> </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> <!--<a value='2'><span>매입.매출처 관리</span></a>--> </div> </div><!--//item_tab--> <!-- 탭 구분 영역 끝 -->
<form name='point_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;">--> <?php if($win=='mobile'){?> <col style="width:20%;"><col style="width:15%;"><col style="width:50%;"> <col style="width:15%;"> <?php } else { ?> <col style="width:50px;"><col style="width:40px;"><col style="width:180px;"> <col style="width:50px;"> <?php }?> </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> </tr> </thead> <tbody> <?php for($i=0;$i<count($list_array);$i++){ $info = $list_array[$i]; if($info['0']=='5'){ $info['savept'] = "-".$info['savept']; } ?> <tr> <!--<td class="tcenter cust_search"> <input type='checkbox' name='code_idx[]' value='<?php echo $i;?>'> <input type='hidden' name='codes[]' value='<?php echo $info['code'];?>'> <input type='hidden' name='login_id[]' value='<?php echo $info['login_id'];?>'> <input type='hidden' name='email[]' value='<?php echo $info['email'];?>'> <input type='hidden' name='comp_name[]' value='<?php echo $info['comp_name'];?>'> </td>--> <td class="tecenter cursor_p"><?php echo $info['dealdate'];?></td> <td class="tecenter cursor_p"><?php if($info['0']=='3'){ echo "구매"; } else if($info['0']=='4'){ echo "임의적립"; } else { echo "사용"; }?></td> <td class="linetxt"><?php echo $info['pname'];?></td> <td class="cost "><?php echo number_format($info['savept']);?></td> </tr> <?php } ?> </tbody> </table> </div> </div> </form>
<div class='pg_wrap' style='padding-top:0px;'> <?php echo get_paging2($list_num, $page, $total_page, "javascript:point_search('',");?> </div>
</div><!--//wrap-->
|