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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
|
<? header( "Content-type: application/vnd.ms-excel" ); header( "Content-Disposition: attachment; filename=Æ÷ÀÎÆ®ÃæÀü»ç¿ëÇöȲ.xls" ); header( "Content-Description: PHP4 Generated Data" );
if(trim($_REQUEST['uid'])==''){ echo "<script>alert('°Ë»ö ¾ÆÀ̵𸦠ÀÔ·ÂÇϽñ⠹ٶø´Ï´Ù.');window.history.go(-1);</script>"; exit; }
$uid = $_REQUEST['uid'];
$txtdate = trim($_REQUEST['txtdate']); $txtdate2 = trim($_REQUEST['txtdate2']);
if($txtdate==''){ $txtdate = date("Y-m-d ",time()); } if($txtdate2==''){ $txtdate2 = date("Y-m-d ",time()); }
if($searchCode==''){ $searchCode = '1'; } $searchid = $_REQUEST['uid'];
//print_r($_REQUEST);
?> <html> <head> <title>Æ÷ÀÎÆ® ÃæÀü/»ç¿ëÇöȲ</title> <meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> </head> <body> <table align=center border=1 cellpadding=0 cellspacing=0 bordercolor='#BDBEBD' width="960"> <tr bgcolor="#5076a9" width="960" height="25"> <td align=center width="7%"><p><span style=font-size:9pt;><font face=Verdana COLOR="#ffffff"><b>¹øÈ£</font></span></p></td> <td align=center width="10%"><p><span style=font-size:9pt;><font face=Verdana COLOR="#ffffff"><b>¾ÆÀ̵ð</font></span></p></td> <td align=center width="11%"><p><span style=font-size:9pt;><font face=Verdana COLOR="#ffffff"><b>ÀÏ ÀÚ</font></span></p></td> <td align=center width="8%"><p><span style=font-size:9pt;><font face=Verdana COLOR="#ffffff"><b>ÃæÀü±Ý¾×</font></span></p></td> <td align=center width="8%"><p><span style=font-size:9pt;><font face=Verdana COLOR="#ffffff"><b>ÃæÀüP</font></span></p></td> <td align=center width="8%"><p><span style=font-size:9pt;><font face=Verdana COLOR="#ffffff"><b>»ç¿ëP</font></span></p></td> <td align=center width="8%"><p><span style=font-size:9pt;><font face=Verdana COLOR="#ffffff"><b>ÀÜ¿©P</font></span></p></td> <td align=center width="10%"><p><span style=font-size:9pt;><font face=Verdana COLOR="#ffffff"><b>¿ëµµ</font></span></p></td> <td align=center width="15%"><p><span style=font-size:9pt;><font face=Verdana COLOR="#ffffff"><b>¼ö½ÅÀÚ</font></span></p></td> <td align=center width="15%"><p><span style=font-size:9pt;><font face=Verdana COLOR="#ffffff"><b>ÇÚµåÆù</font></span></p></td> <td align=center width="10%"><p><span style=font-size:9pt;><font face=Verdana COLOR="#ffffff"><b>ó¸®ÀÚ</font></span></p></td> </tr>
<? $Code = " AND cust_id = '$uid' ";
$Dgubun = " SELECT 0, f.idx, f.cust_id, f.rgst_dtm, f.price, f.addpoint, '' AS usepoint, '' AS use_type, '' AS use_fkey, f.bigo, f.rgster_nm, f.delkey, '' AS curpoint FROM cash_fill AS f WHERE f.rgst_dtm BETWEEN '$txtdate 00:00:00' AND '$txtdate2 23:59:59' $Code UNION ALL SELECT 1, f.idx, f.cust_id, f.rgst_dtm, '' AS price, '' AS addpoint, f.usepoint, f.use_type, f.use_fkey, f.bigo, '' AS rgster_nm, '' AS delkey, f.curpoint FROM cash_use AS f WHERE f.rgst_dtm BETWEEN '$txtdate 00:00:00' AND '$txtdate2 23:59:59' $Code "; //±âº» °Ë»öÄõ¸®
//echo $Dgubun; //exit;
if ( isset($mode ) && $mode == "search"){ //°Ë»öÆû
if( isset($uid) && $uid !== ""){ if($uid !== "") $Code = " AND cust_id = '$uid' "; }
//°Ë»ö±¸ºÐ¿¡ µû¸¥ Äõ¸® if( $searchCode !== ""){
if( $searchCode == '1') $Dgubun = " SELECT 0, f.idx, f.cust_id, f.rgst_dtm, f.price, f.addpoint, '' AS usepoint, '' AS use_type, '' AS use_fkey, f.bigo, f.rgster_nm, f.delkey, '' AS curpoint FROM cash_fill AS f WHERE f.rgst_dtm BETWEEN '$txtdate 00:00:00' AND '$txtdate2 23:59:59' $Code UNION ALL SELECT 1, f.idx, f.cust_id, f.rgst_dtm, '' AS price, '' AS addpoint, f.usepoint, f.use_type, f.use_fkey, f.bigo, '' AS rgster_nm, '' AS delkey, f.curpoint FROM cash_use AS f WHERE f.rgst_dtm BETWEEN '$txtdate 00:00:00' AND '$txtdate2 23:59:59' $Code ";
if( $searchCode == '2') $Dgubun = " SELECT 0, f.idx, f.cust_id, f.rgst_dtm, f.price, f.addpoint, '' AS usepoint, '' AS use_type, '' AS use_fkey, f.bigo, f.rgster_nm, f.delkey, '' AS curpoint FROM cash_fill AS f WHERE f.rgst_dtm BETWEEN '$txtdate 00:00:00' AND '$txtdate2 23:59:59' $Code ";
if( $searchCode == '3') $Dgubun = "SELECT 1, f.idx, f.cust_id, f.rgst_dtm, '' AS price, '' AS addpoint, f.usepoint, f.use_type, f.use_fkey, f.bigo, '' AS rgster_nm, '' AS delkey, f.curpoint FROM cash_use AS f WHERE f.rgst_dtm BETWEEN '$txtdate 00:00:00' AND '$txtdate2 23:59:59' $Code ";
}
} include("../manage/category/pointcommon.php");
$result = mysql_query($Dgubun) or die (mysql_error()); $nTotalCount = mysql_num_rows($result); $sql = $Dgubun . " order by cust_id, rgst_dtm DESC";
//echo $sql; // $sql = $Dgubun . " order by rgst_dtm DESC " ?>
<?
//AND cust_id = '$searchid'
$i = 0; $result = mysql_query($sql) or die (mysql_error());
if($num = mysql_num_rows($result)){
while($row = mysql_fetch_array($result)) { if ($row[0] =="0"){ $bg = "#ffffff"; } else { $bg = "#e2eff3"; } $usecode = $row[use_type];
$usesql = "select use_type_nam from cash_price where use_type_cde = '$usecode'"; $coderesult = mysql_query($usesql) or die (mysql_error()); $coderow = mysql_fetch_array($coderesult);
$usedetail = $coderow[use_type_nam]; if($row[0] =="0" && $row[delkey] == "1"){ $fontcolor = "#ff3506"; } ELSE { $fontcolor = "#333333"; }
?> </table> <table border="1"> <tr height="20" bgcolor="<?=$bg;?>"> <td align="center"> <!------------------ ¹øÈ£ ------------------> <font color="<?=$fontcolor;?>"> <!-- Æ÷ÀÎÆ®»ç¿ëÀÏ °æ¿ì idx°ª ´ë½Å P»ç¿ë --> <? if($row[0] =="0"){ ?> <?=$row[idx]; } ELSE { ?> [P»ç¿ë]<? } ?> </td> <td align="center"> <!------------------ ¾ÆÀ̵ð ------------------> <font color="<?=$fontcolor;?>"> <?=$row[cust_id];?>
</td> <td align="center"> <!------------------ ÀÏÀÚ ------------------> <font color="<?=$fontcolor;?>"><?=substr($row[rgst_dtm],0,16);?> </td> <td align="right"> <!------------------ ÃæÀü±Ý¾× ------------------> <font color="<?=$fontcolor;?>"> <? if($row[price] == ""){ } else { ?> <?=number_format($row[price]); } ?> </td> <td align="right"> <!------------------ ÃæÀüÆ÷ÀÎÆ® ------------------> <font color="<?=$fontcolor;?>"> <? if($row[addpoint] == ""){ } else { ?> <?=number_format($row[addpoint]); } ?> </td> <td align="right"> <!------------------ »ç¿ëÆ÷ÀÎÆ® ------------------> <font color="<?=$fontcolor;?>"> <? if($row[usepoint] == ""){ } else { ?> <?=number_format($row[usepoint]); } ?> </td> <td align="right"> <!------------------ ÀÜ¿©Æ÷ÀÎÆ® ------------------> <font color="<?=$fontcolor;?>"> <? if($row[curpoint] == ""){ } else { ?> <?=number_format($row[curpoint]); } ?> </td> <td align="center"> <!------------------ »ç¿ë³»¿ª ------------------> <font color="<?=$fontcolor;?>"><?=$usedetail;?> </td>
<!------------------ ºñ°í ------------------>
<? if((substr_count($row[bigo],"/")) > 0){ $bigoexplode = explode("/",$row[bigo]); ?> <td> <?=$bigoexplode[0]?> </td> <td> <?=str_replace("SMS:","",$bigoexplode[1]);?> </td> <? } else { ?> <td colspan="2" > <?=$row[bigo]?> </td>
<? } ?>
<td align="center"> <!------------------ µî·ÏÀÚ ------------------> <?=$row[rgster_nm];?> </td> </tr>
<? } } else{
?> <tr align="center" bgcolor="#FFFFFF"> <td height="100" align="cener" colspan="9" width="953"><span style=font-size:9pt;><font face=Verdana>µ¥ÀÌŸ°¡ ¾ø½À´Ï´Ù.</font></span></td> </tr> <? } ?>
</table> </body> </html>
|