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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
<?php include_once("common.php"); if (!isset($_SESSION['member'])) { header("Location: login.php"); exit; }
$podate = isset($_GET['podate']) ? $_GET['podate'] : ""; $pono = isset($_GET['pono']) ? $_GET['pono'] : ""; $orderdate = isset($_GET['orderdate']) ? $_GET['orderdate'] : ""; $orderno = isset($_GET['orderno']) ? $_GET['orderno'] : ""; $productno = isset($_GET['productno']) ? $_GET['productno'] : "";
require_once('../webadmin/configure.php'); $sql_cno = mysql_real_escape_string($_SESSION['member']['cno']); $sql = "SELECT * FROM order_history WHERE cno = '$sql_cno' AND recordstatus = '1'"; $sql .= strlen($pono) ? " AND po_no LIKE '%" . mysql_real_escape_string($pono) . "%'" : ""; $sql .= strlen($podate) ? " AND po_date = '" . mysql_real_escape_string($podate) . "'" : ""; $sql .= strlen($orderno) ? " AND order_no LIKE '%" . mysql_real_escape_string($orderno) . "%'" : ""; $sql .= strlen($orderdate) ? " AND order_date = '" . mysql_real_escape_string($orderdate) . "'" : ""; $sql .= strlen($productno) ? " AND product_detail LIKE '%" . mysql_real_escape_string($productno) . "%'" : ""; $sql .= " ORDER BY id ASC"; $result = mysql_query($sql);
function tmp_show_desc2($desc2, $cut_pos = 100) { $output = 'Sorry, no details.'; if (!empty($desc2)) { $output = ''; $len = strlen($desc2); for ($i = 0; $i <= $len; $i += $cut_pos) { $output .= substr($desc2, $i, $cut_pos); $output .= PHP_EOL; } } return $output; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <title>Glorious Company</title> <link rel="stylesheet" type="text/css" href="css/style.css" /> <!-- Select Calendar --> <link type="text/css" href="css/smoothness/jquery-ui-1.8.18.custom.css" rel="stylesheet" /> <!-- <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> --> <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script> <script type="text/javascript"> $(function() { $( "#orderdate,#podate" ).datepicker( { dateFormat: 'yy-mm-dd'} ); // $('.button').button(); }); function showDialog(title, $target) { var html = $target.html(); var htmlLength = html == null ? 0 : html.length; $('#msg_dialog') .empty() .html(html) .dialog({ modal: true, width: htmlLength >= 80 ? 800 : 200, resizable: false, title: title, buttons: { Close: function() { $(this).dialog('close'); } } }); return false; } </script> <style type="text/css"> .list-txt a { text-decoration:none; color: white; } .list-txt { line-height: 20px; } input.ui-button { padding: 0.2em 0.5em; } .desc-width { max-width: 180px; } @media print { input[type=submit] { display: none; } } .bg1 { background-color: rgba(0, 0, 0, 0.5); background-image: none; } </style> <!--[if lt IE 9]> <style type="text/css"> .bg1 { /* background-color: #403F42; */ background-color: transparent; background-image: url(images/bg1.png); background-repeat: repeat; } </style> <![endif]--> <!-- End Select Calendar --> </head> <body> <div id="msg_dialog"> </div> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <!-- Header --> <tr> <td height="73"><table width="930" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="220"><a href="../" target="_blank"><img src="images/logo.png" width="263" height="80" border="0"/></a></td> <td align="right"><span class="header">Welcome [<?=$_SESSION['member']['ccontactp']?>]</span> <!-- <span class="login"><a href="change_password.php">Change password</a></span> --><a href="logout.php"><img src="images/btn_logout.png" border="0" align="absmiddle"/></a></td> </tr> </table></td> </tr> <tr> <td><table width="930" border="0" align="center" cellspacing="0" cellpadding="0"> <tr> <td align="right"><a href="order_history.php"><img src="images/menu_orderhistory.png" width="200" height="35" border="0" /></a><a href="payment.php"><img src="images/menu_paymenthistory.png" width="200" height="35" border="0" /></a><a href="order_status.php"><img src="images/menu_orderstatus.png" width="200" height="35" border="0" /></a></td> </tr> </table></td> </tr> <tr> <td height="5" class="headerline"></td> </tr> <!-- End Header --> <tr> <td height="450" align="center" valign="top"><table width="930" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="50" class="bg1 text-left top"><table width="500" border="0" cellspacing="0" cellpadding="0" style="float:left;border-right: 1px solid #58585A;"> <tr> <td class="title text-left top"><b>Company Info</b></td> </tr> <tr> <td class="txt text-left top"><strong>Customer No.: <?=$_SESSION['member']['cno']?></strong></td> </tr> <tr> <td class="company text-left top"><strong><?=$_SESSION['member']['ccompany']?></strong></td> </tr> <tr> <td height="60" class="txt text-left top"><?=$_SESSION['member']['caddress']?></td> </tr> </table> <table width="400" border="0" cellspacing="0" cellpadding="0" style="float:right;"> <tr> <td class="title"><b>Contact Person</b></td> </tr> <tr> <td class="txt"><strong><?=$_SESSION['member']['ccontactp']?></strong></td> </tr> <tr> <td class="txt">Tel: <?=$_SESSION['member']['ctel']?></td> </tr> <tr> <td class="txt">Fax: <?=$_SESSION['member']['cfax']?></td> </tr> <tr> <td class="txt">Mail: <?=$_SESSION['member']['cmail']?></td> </tr> </table></td> </tr> <tr> <td height="50" class="text-left top"><?=htmlentities($_GET['msg'])?> </td> </tr> <tr> <td height="40" class="text-left top"><div style="float:left"><img src="images/icon_title.png" width="25" height="20" align="top" /><span class="title">ORDER HISTORY</span></div> <div style="float:right"><form action="order_history.php" method="get"> P.O. Date <input id="podate" name="podate" type="text" class="searchinput" value="<?=$podate?>" /> P.O. No. <input name="pono" type="text" class="searchinput" value="<?=$pono?>" /> O.C. Date <input id="orderdate" name="orderdate" type="text" class="searchinput" value="<?=$orderdate?>" /> O.C. No. <input name="orderno" type="text" class="searchinput" value="<?=$orderno?>" /> Product No. <input name="productno" type="text" class="searchinput" value="<?=$productno?>" /> <input name="submit" type="submit" value="" style="background-image: url(images/btn_search.png); background-color: transparent; width: 20px; height: 20px; border: 0px; vertical-align: middle" /> </form></div></td> </tr> <tr> <td class="text-left top"><table width="930" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="list-titleborder border-right list-bg1 text-left top" style="min-width:60px">P.O. No.</td> <td class="list-titleborder border-right list-bg1 text-left top" style="min-width:70px">P.O. Date</td> <td class="list-titleborder border-right list-bg1 text-left top" style="min-width:60px">O.C. No.</td> <td class="list-titleborder border-right list-bg1 text-left top" style="min-width:70px">O.C. Date</td> <td class="list-titleborder border-right list-bg1 text-left top" style="min-width:70px">Product No.</td> <td class="list-titleborder border-right list-bg1 text-left top">Packing</td> <td class="list-titleborder list-bg1 text-left top desc-width" style="padding-right:0">Description</td> <td class="list-titleborder border-right list-bg1 text-left top" style="padding:0"></td> <td class="list-titleborder border-right list-bg1 text-left top" style="min-width:60px">Order Qty</td> <td class="list-titleborder border-right list-bg1 text-left top">Shipped</td> <td class="list-titleborder border-right list-bg1 text-left top">Currency</td> <td class="list-titleborder border-right list-bg1 text-left top">Price</td> <td class="list-titleborder list-bg1 text-left top desc-width" style="padding-right:0; min-width:70px">Arrival Date</td> <td class="list-titleborder list-bg1 text-left top" style="padding:0"></td> </tr> <?php $i = 0; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { //$rowColor = $i++ % 2 == 0 ? 'list-bg2' : 'list-bg1'; $rowColor = 'list-bg1'; ?> <tr> <td class="list-txt border-bottom border-right <?=$rowColor?> text-left top"><?=strlen($row['po_no']) <= 15 ? $row['po_no'] : substr($row['po_no'], 0, 15) . '<br />' . substr($row['po_no'], 15)?></td> <td class="list-txt border-bottom border-right <?=$rowColor?> text-left top"><?=$row['po_date']?></td> <td class="list-txt border-bottom border-right <?=$rowColor?> text-left top"><?=$row['order_no']?></td> <td class="list-txt border-bottom border-right <?=$rowColor?> text-left top"><?=$row['order_date']?></td> <td class="list-txt border-bottom border-right <?=$rowColor?> text-left top"><?=$row['product_detail']?></td> <td class="list-txt border-bottom border-right <?=$rowColor?> text-left top"><?=$row['packing']?></td> <td class="list-txt border-bottom <?=$rowColor?> text-left top desc-width" style="padding-right:0"><?=$row['desc']?></td> <td class="list-txt border-bottom border-right <?=$rowColor?> text-left top" style="padding:5px 1px"> <?php if (!empty($row['desc2'])): ?> <input type="button" class="button ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" value="..." onclick="showDialog('<?=str_replace(array("'", '"'), array("\\'", '\\x22'), html_entity_decode('[' . $row['order_no'] . '] Product no. ' . $row['product_detail'] . ' (' . $row['packing'] . ') ' . $row['desc'], ENT_QUOTES))?>', $('#desc2_<?=$row['id']?>', $(this).parent().parent()))" /> <?php endif; ?> </td> <td class="list-txt border-bottom border-right <?=$rowColor?> top tdalignright"><?=$row['quantity']?></td> <td class="list-txt border-bottom border-right <?=$rowColor?> top tdalignright"><?=$row['shipped']?></td> <td class="list-txt border-bottom border-right <?=$rowColor?> text-left top"><?=$row['currency']?></td> <td class="list-txt border-bottom border-right <?=$rowColor?> top tdalignright"><?=$row['total_amount']?></td> <td class="list-txt border-bottom <?=$rowColor?> text-left top desc-width" style="padding-right:0"><?=$row['arrival_date']?></td> <td class="list-txt border-bottom <?=$rowColor?> text-left top" style="padding:5px 1px"> <?php if (!empty($row['arrival_desc'])): ?> <input type="button" class="button ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" value="..." onclick="showDialog('<?=str_replace(array("'", '"'), array("\\'", '\\x22'), html_entity_decode('[' . $row['order_no'] . '] Product no. ' . $row['product_detail'] . ' (' . $row['packing'] . ') ' . $row['desc'], ENT_QUOTES))?>', $('#arrival_desc_<?=$row['id']?>', $(this).parent().parent()))" /> <?php endif; ?> <div id="desc2_<?=$row['id']?>" style="display:none"><pre><?=tmp_show_desc2($row['desc2'])?></pre></div> <div id="arrival_desc_<?=$row['id']?>" style="display:none"><pre><?php if (!empty($row['arrival_desc'])) { echo 'Shipment Vessel Shipment Arrival ' . PHP_EOL; echo ' qty name date date ' . PHP_EOL; echo '======= ======================================== ============ ============ ' . PHP_EOL; } echo tmp_show_desc2($row['arrival_desc'], 80); ?></pre></div> </td> </tr> <?php } ?> </table></td> </tr> </table></td> </tr> <!-- Footer --> <tr> <td class="footer">COPYRIGHT © 2012 GLORIOUS COMPANY. ALL RIGHTS RESERVED</td> </tr> </table> </body> </html>
|