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
|
<?php $formid = "Order"; require_once "inc/configure.php";
$opr_param['opr_code'] = "CASO"; search_orderField($_REQUEST['act'], $_REQUEST['customer'], $_REQUEST['launchdate_start'], $_REQUEST['launchdate_end'], $_REQUEST['deliverydate_start'], $_REQUEST['deliverydate_end'], $_REQUEST['finished'], $_REQUEST['status'] );
?><!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" /> <title>ENZA</title> <link rel="stylesheet" type="text/css" href="css/style.css" /> <?php require_once "inc/jsheader.php"; ?>
<script> $(document).ready(function() { $( "#launchdate_start" ).datepicker({ dateFormat: "yy-mm-dd", showOn: "both", /* buttonImage: "images/calendar.gif", buttonImageOnly: true,*/ defaultDate: "<?=$_REQUEST['launchdate_start']?>" }); $( "#launchdate_end" ).datepicker({ dateFormat: "yy-mm-dd", showOn: "both", /* buttonImage: "images/calendar.gif", buttonImageOnly: true,*/ defaultDate: "<?=$_REQUEST['launchdate_end']?>" });
$( "#deliverydate_start" ).datepicker({ dateFormat: "yy-mm-dd", showOn: "both", /* buttonImage: "images/calendar.gif", buttonImageOnly: true,*/ defaultDate: "<?=$_REQUEST['deliverydate_start']?>" }); $( "#deliverydate_end" ).datepicker({ dateFormat: "yy-mm-dd", showOn: "both", /* buttonImage: "images/calendar.gif", buttonImageOnly: true,*/ defaultDate: "<?=$_REQUEST['deliverydate_end']?>" }); $(".focus").focus(); }); </script>
</head> <body> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top" class="top"><?php require"mod_webhead.php"; ?></td> </tr> <tr> <td><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="200" valign="top" class="menu_bg"><?php require"mod_menu.php"; ?> <br/> <span class="mod_menu"><a href="ord_deptcheckinform.php?dept=<?=$opr_param['opr_code']?>" target="_new" class="fboxs uibutton" ><?=DEPARTMENT?><?=WS?><?=CHECKIN?></a></span> <form action="ord_castcheckout_modifyform.php" name="mybarcodeform" id="mybarcodeform" method="post" enctype="multipart/form-data"> <span class="stext1"><br/><?=DELIVERY_NOTE?><?=WS?><?=NUMBER?>:</span><br/> <input type="text" name="barcode" class="focus shortfield" /> <input type="submit" name="S" value="<?=SUBMIT?>" /> </form></td> <td valign="top" class="padding1"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr></tr> <tr> <td class="c1_bg"> <form action="<?=realbasename($_SERVER['REQUEST_URI'])?>" method="post"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="search"> <tr> <td width="120" valign="top" ><?=ORDER?>:<br /> <span class="stext1"><?=CASTING?><?=WS?><?=CHECKOUT?>:</span></td> <td valign="top"> <table> <tr> <td class="stext2"><?=CASTING?><?=WS?><?=COMPANY?></td> <td class="stext2" colspan="2"><select name="customer"><option value=""></option><?=master_supplier($_REQUEST['customer'], true, 'iscasting=1')?></select></td> </tr> <tr> <td class="stext2"><?=LAUNCH_DATE?></td> <td class="stext2"><input type="text" name="launchdate_start" id="launchdate_start" value="<?=$_REQUEST['launchdate_start']?>" class="shortfield" /></td> <td class="stext2"><input type="text" name="launchdate_end" id="launchdate_end" value="<?=$_REQUEST['launchdate_end']?>" class="shortfield" /></td> </tr>
<tr> <td class="stext2"><?=EXPECTED?><?=WS?><?=RETURN_?><?=WS?><?=DATE?></td> <td class="stext2"><input type="text" name="deliverydate_start" id="deliverydate_start" value="<?=$_REQUEST['deliverydate_start']?>" class="shortfield" /></td> <td class="stext2"><input type="text" name="deliverydate_end" id="deliverydate_end" value="<?=$_REQUEST['deliverydate_end']?>" class="shortfield" /></td> </tr> <tr> <td class="stext2"><?=FINISHED?></td> <td class="stext2" colspan="2"><input type="checkbox" name="finished" <?=empty($_REQUEST['finished'])?'':'checked="checked"'?> /></td> </tr> </table> </td> <td align="right" valign="top"><input type="image" src="image/btn_search.jpg" width="64" height="20" /> <a href="ord_castdeal_addform.php" ><img src="image/btn_new.jpg" width="52" height="20" /></a> <a href="<?=basename($_SERVER['PHP_SELF'])?>" title="<?=CLEAR?>"><img src="image/icon_close.jpg" width="20" height="20" align="top" alt="<?=CLEAR?>" /></a></td> </tr> <!-- <tr> <td height="25" colspan="3" valign="bottom" class="stext2"> </td> </tr>--> </table></form> </td> </tr> <tr> <td valign="top" class="c2_bg"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"> <table width="100%" id="product_table" border="0" cellpadding="0" cellspacing="0" class="tablelist"> <tr> <th><?=DELIVERY_NOTE?><?=WS?><?=NUMBER?></th> <th><?=CASTING?><?=WS?><?=COMPANY?></th> <th><?=LAUNCH_DATE?></th> <th><?=QTY?></th> <th><?=PART?><?=WS?><?=QTY?></th> <th><?=RETURN_?><?=WS?><?=DATE?></th> </tr> <?php $sql_clause=''; $sql_param= array();
/* if( !empty($_REQUEST['finished']) ){ $sql_clause .= 'dbo.ord_main.finished = :finished '; $sql_param[':finished'] = '1'; } else { $sql_clause .= '( dbo.ord_main.finished <> :finished OR dbo.ord_main.finished IS NULL )'; $sql_param[':finished'] = '1'; }*/ if( !empty($_REQUEST['customer']) ){ $sql_clause .= 'AND (castingcompany=:castingcompany) '; $sql_param[':castingcompany'] = $_REQUEST['customer']; $sql_param[':castingcompany'] = $_REQUEST['customer']; } if( !empty($_REQUEST['launchdate_start']) ){ $sql_clause .= 'AND launch_date>=:launchdate_start '; $sql_param[':launchdate_start'] = $_REQUEST['launchdate_start']; } if( !empty($_REQUEST['launchdate_end']) ){ $sql_clause .= 'AND launch_date<=:launchdate_end '; $sql_param[':launchdate_end'] = $_REQUEST['launchdate_end']; }
if( !empty($_REQUEST['deliverydate_start']) ){ $sql_clause .= 'AND exp_returndate>=:deliverydate_start '; $sql_param[':deliverydate_start'] = $_REQUEST['deliverydate_start']; } if( !empty($_REQUEST['deliverydate_end']) ){ $sql_clause .= 'AND exp_returndate<=:deliverydate_end '; $sql_param[':deliverydate_end'] = $_REQUEST['deliverydate_end']; } if($sql_clause){ //remove first "AND" //$sql_clause = substr($sql_clause, 3); //$sql_clause = preg_replace('/AND/', '', $sql_clause, 1); } $sql = "SELECT * FROM (SELECT dbo.ord_txcasd.delnote_nbr, dbo.ord_txcasd.castingcompany, Min(dbo.ord_txcasd.createdate) AS launch_date, Sum(dbo.ord_dtl.qty) as ttlqty, Sum(dbo.ord_txcasd.part_qty) AS part_qty, Max(dbo.ord_txcasd.exp_returndate) as exp_returndate FROM dbo.ord_txmain INNER JOIN dbo.ord_txcasd ON dbo.ord_txcasd.txmain_refid = dbo.ord_txmain.refid INNER JOIN dbo.ord_dtl ON dbo.ord_txmain.orddtl_refid = dbo.ord_dtl.refid WHERE dbo.ord_txmain.opr_code = 'CASO' GROUP BY dbo.ord_txcasd.delnote_nbr, dbo.ord_txcasd.castingcompany) as castdeal where (1=1) $sql_clause ORDER BY delnote_nbr ASC"; $sth = $dbh->prepare($sql); $q = $sth->execute( $sql_param ); //echo $sth->getSQL( $sql_param ) . HTML_EOL; pdo_showerror($sth, $q); while($row = $sth->fetch()) { ?> <tr> <td class="code"><a href="ord_castcheckout_modifyform.php?delnote_nbr=<?=$row['delnote_nbr']?>" ><?=$row['delnote_nbr']?></a></td> <td><?=resolveCode_masterSupplier($row['castingcompany'])?></td> <td><?=datef($row['launch_date'])?></td> <td align="center"><?=numf($row['ttlqty'])?></td> <td align="center"><?=numf($row['part_qty'])?></td> <td><?=datef($row['exp_returndate'])?></td> </tr> <?php } ?> </table></td> <!-- <td width="150" valign="top" class="product_image"><img src="image/image2.jpg" width="150" height="150" /></td>--> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> </table>
</body> </html>
|