/beta/shopfloor/TraceOrder.asp

http://github.com/khaneh/Orders · ASP · 642 lines · 612 code · 28 blank · 2 comment · 41 complexity · 3d698fa6195f441d6af7e58251d93b78 MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2. 'shopfloor (3)
  3. PageTitle=" "
  4. SubmenuItem=3
  5. if not Auth(3 , 3) then NotAllowdToViewThisPage()
  6. %>
  7. <!--#include file="top.asp" -->
  8. <!--#include File="../include_farsiDateHandling.asp"-->
  9. <%
  10. Server.ScriptTimeout = 3600
  11. %>
  12. <SCRIPT LANGUAGE='JavaScript'>
  13. <!--
  14. function checkValidation(){
  15. if (document.all.search_box.value != ''){
  16. return true;
  17. }
  18. else{
  19. document.all.search_box.focus();
  20. return false;
  21. }
  22. }
  23. //-->
  24. </SCRIPT>
  25. <font face="tahoma">
  26. <%
  27. if request("act")="search" then
  28. %>
  29. <br><br>
  30. <TABLE border="4" cellspacing="0" cellpadding="0" width="600" align="center" bordercolor="#555599">
  31. <FORM METHOD=POST ACTION="TraceOrder.asp?act=search" onSubmit="return checkValidation();">
  32. <TR><TD>
  33. <TABLE border="0" cellspacing="0" cellpadding="5" dir="RTL" width="100%">
  34. <TR bgcolor="#AAAAEE">
  35. <TD> :</TD>
  36. <TD><INPUT TYPE="text" NAME="search_box" value="<%=request.form("search_box")%>"></TD>
  37. <TD><INPUT TYPE="submit" NAME="SubmitB" Value="" style="font-family:tahoma,arial; font-size:10pt;width:100px;"></TD>
  38. <TD align="left"><% if Auth(3 , 4) then %><A HREF="TraceOrder.asp?act=advancedSearch"> </A><% end if %></TD>
  39. </TR>
  40. </TABLE>
  41. </TD></TR>
  42. </FORM>
  43. </TABLE>
  44. <script language="JavaScript">
  45. <!--
  46. document.all.search_box.focus();
  47. //-->
  48. </script>
  49. <br>
  50. <%
  51. searchText=request("search_box")
  52. if isNumeric(searchText) then
  53. myCriteria= "radif_sefareshat = '"& clng(searchText) & "'"
  54. else
  55. searchText=sqlSafe(searchText)
  56. myCriteria= "REPLACE([company_name], ' ', '') LIKE REPLACE(N'%"& searchText & "%', ' ', '') OR REPLACE([customer_name], ' ', '') LIKE REPLACE(N'%"& searchText & "%', ' ', '')"
  57. end if
  58. mySQL="SELECT orders_trace.*, OrderTraceStatus.Icon FROM Orders INNER JOIN orders_trace ON Orders.ID = orders_trace.radif_sefareshat INNER JOIN OrderTraceStatus ON orders_trace.status = OrderTraceStatus.ID WHERE ("& myCriteria & ") AND (Orders.Closed=0) ORDER BY radif_sefareshat DESC"
  59. set RS1=Conn.Execute (mySQL)
  60. if not RS1.eof then
  61. tmpCounter=0
  62. %>
  63. <div align="left">
  64. <table border="1" cellspacing="0" cellpadding="0" dir="RTL">
  65. <TR bgcolor="#CCCCFF">
  66. <TD width="44"># </TD>
  67. <TD width="64"> </TD>
  68. <TD width="64"> </TD>
  69. <TD width="122"> </TD>
  70. <TD width="122"> </TD>
  71. <TD width="84"> </TD>
  72. <TD width="44"></TD>
  73. <TD width="73"></TD>
  74. <TD width="63"> </TD>
  75. <TD width="24"></TD>
  76. </TR>
  77. </table>
  78. </div>
  79. <div id="results" align="left" style="overflow:auto; width:752; height:330;border:0px;" dir="LTR" >
  80. <TABLE border="1" cellspacing="0" cellpadding="2" borderColor="#555588" dir="RTL">
  81. <% Do while not RS1.eof
  82. tmpCounter = tmpCounter + 1
  83. if tmpCounter mod 2 = 1 then
  84. tmpColor="#FFFFFF"
  85. Else
  86. tmpColor="#DDDDDD"
  87. End if
  88. %>
  89. <TR bgcolor="<%=tmpColor%>">
  90. <!-- <TD><%=tmpCounter%></TD> -->
  91. <TD width="40" DIR="LTR"><A HREF="manageOrder.asp?radif=<%=RS1("radif_sefareshat")%>" target="_blank"><%=RS1("radif_sefareshat")%></A></TD>
  92. <TD width="60" DIR="LTR"><%=RS1("order_date")%></TD>
  93. <TD width="60" DIR="LTR"><%=RS1("return_date") & " ("& RS1("return_time") & ")"%></TD>
  94. <TD width="118"><%=RS1("company_name") & "<br>:("& RS1("telephone")& ")"%>&nbsp;</TD>
  95. <TD width="118"><%=RS1("customer_name")%>&nbsp;</TD>
  96. <TD width="80"><%=RS1("order_title")%>&nbsp;</TD>
  97. <TD width="40"><%=RS1("order_kind")%></TD>
  98. <TD width="69"><%=RS1("marhale")%></TD>
  99. <TD width="59"><%=RS1("salesperson")%>&nbsp;</TD>
  100. <TD width="20"><IMG SRC="<%=RS1("Icon")%>" WIDTH="20" HEIGHT="20" BORDER=0 ALT=""></TD>
  101. </TR>
  102. <TR bgcolor="#FFFFFF">
  103. <TD colspan="10" style="height:10px"></TD>
  104. </TR>
  105. <% RS1.moveNext
  106. Loop
  107. %> <TR bgcolor="#ccccFF">
  108. <TD colspan="10"> : <%=tmpCounter%></TD>
  109. </TR>
  110. </TABLE>
  111. </div>
  112. <HR>
  113. <% elseif request("search_box")<>"" then
  114. %> <TABLE border="1" cellspacing="0" cellpadding="0" dir="RTL" align="center" width="600">
  115. <TR bgcolor="#FFFFDD">
  116. <TD align="center" style="height:40px;font-size:12pt;font-weight:bold;color:red"> .<br> <A HREF="orderTraceEdit.asp"> </A> .</TD>
  117. </TR>
  118. </TABLE>
  119. <% End if
  120. elseif request("act")="advancedSearch" then
  121. '------ Advanced Search
  122. %>
  123. <!--#include File="../include_JS_InputMasks.asp"-->
  124. <%
  125. Server.ScriptTimeout = 3600
  126. tmpTime=time
  127. tmpTime=Hour(tmpTime)&":"&Minute(tmpTime)
  128. if instr(tmpTime,":")<3 then tmpTime="0" & tmpTime
  129. if len(tmpTime)<5 then tmpTime=Left(tmpTime,3) & "0" & Right(tmpTime,1)
  130. %>
  131. <br><br>
  132. <TABLE border="4" cellspacing="0" cellpadding="0" width="700" align="center" bordercolor="#555599">
  133. <FORM METHOD=POST ACTION="TraceOrder.asp?act=advancedSearch" onSubmit="return checkValidation();">
  134. <TR><TD>
  135. <TABLE border="0" cellspacing="0" cellpadding="1" dir="RTL" width="100%" bgcolor="white">
  136. <TR bgcolor="#EEEEEE">
  137. <TD><INPUT TYPE="checkbox" NAME="check_sefaresh" onclick="check_sefaresh_Click()" checked></TD>
  138. <TD> </TD>
  139. <TD><INPUT TYPE="text" NAME="az_sefaresh" dir="LTR" value="<%=request.form("az_sefaresh")%>" size="8" maxlength="6" onKeyPress="return maskNumber(this);"></TD>
  140. <TD></TD>
  141. <TD><INPUT TYPE="text" NAME="ta_sefaresh" dir="LTR" value="<%=request.form("ta_sefaresh")%>" size="8" maxlength="6" onKeyPress="return maskNumber(this);" ></TD>
  142. <td rowspan="11" style="width:1px" bgcolor="#555599"></td>
  143. <TD><INPUT TYPE="checkbox" NAME="check_kind" onclick="check_kind_Click()" checked></TD>
  144. <TD> </TD>
  145. <TD colspan="3"><SELECT NAME="order_kind_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
  146. <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
  147. <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
  148. <OPTION value=" " <%if request.form("order_kind_box")=" " then response.write "selected" %> > </option>
  149. <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
  150. <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
  151. <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
  152. <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
  153. <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
  154. </SELECT></TD>
  155. </TR>
  156. <TR bgcolor="#555599">
  157. <td colspan="11" style="height:2px"></td>
  158. </TR>
  159. <TR>
  160. <TD><INPUT TYPE="checkbox" NAME="check_tarikh_sefaresh" onclick="check_tarikh_sefaresh_Click()" checked></TD>
  161. <TD> </TD>
  162. <TD><INPUT TYPE="text" NAME="az_tarikh_sefaresh" dir="LTR" value="<%=request.form("az_tarikh_sefaresh")%>" size="10" onKeyPress="return maskDate(this);" onBlur="if(acceptDate(this))document.all.ta_tarikh_sefaresh.value=this.value;" maxlength="10"></TD>
  163. <TD></TD>
  164. <TD><INPUT TYPE="text" NAME="ta_tarikh_sefaresh" dir="LTR" value="<%=request.form("ta_tarikh_sefaresh")%>" size="10" onKeyPress="return maskDate(this);" onblur="acceptDate(this)" maxlength="10"></TD>
  165. <TD><INPUT TYPE="checkbox" NAME="check_marhale" onclick="check_marhale_Click()" checked></TD>
  166. <TD></TD>
  167. <TD><SELECT NAME="marhale_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
  168. <%
  169. set RS_STEP=Conn.Execute ("SELECT * FROM OrderTraceSteps WHERE (IsActive=1)")
  170. Do while not RS_STEP.eof
  171. %>
  172. <OPTION value="<%=RS_STEP("ID")%>" <%if cint(request.form("marhale_box"))=cint(RS_STEP("ID")) then response.write "selected" %> ><%=RS_STEP("name")%></option>
  173. <%
  174. RS_STEP.moveNext
  175. loop
  176. %>
  177. </SELECT></TD>
  178. <TD><span id="marhale_not_check_label" style='font-weight:bold;color:red'></span></TD>
  179. <TD><INPUT TYPE="checkbox" NAME="marhale_not_check" onclick="marhale_not_check_Click();" checked></TD>
  180. </TR>
  181. <TR bgcolor="#555599">
  182. <td colspan="11" style="height:2px"></td>
  183. </TR>
  184. <TR bgcolor="#EEEEEE">
  185. <TD><INPUT TYPE="checkbox" NAME="check_tarikh_tahvil" onclick="check_tarikh_tahvil_Click()" checked></TD>
  186. <TD> </TD>
  187. <TD><INPUT TYPE="text" NAME="az_tarikh_tahvil" dir="LTR" value="<%=request.form("az_tarikh_tahvil")%>" size="10" onKeyPress="return maskDate(this);" onblur="acceptDate(this)" maxlength="10"></TD>
  188. <TD></TD>
  189. <TD><INPUT TYPE="text" NAME="ta_tarikh_tahvil" dir="LTR" value="<%=request.form("ta_tarikh_tahvil")%>" size="10" onKeyPress="return maskDate(this);" onblur="acceptDate(this)" maxlength="10"></TD>
  190. <TD><INPUT TYPE="checkbox" NAME="check_vazyat" onclick="check_vazyat_Click()" checked></TD>
  191. <TD></TD>
  192. <TD><SELECT NAME="vazyat_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
  193. <%
  194. set RS_STATUS=Conn.Execute ("SELECT * FROM OrderTraceStatus WHERE (IsActive=1)")
  195. Do while not RS_STATUS.eof
  196. %>
  197. <OPTION value="<%=RS_STATUS("ID")%>" <%if cint(request.form("vazyat_box"))=cint(RS_STATUS("ID")) then response.write "selected" %> ><%=RS_STATUS("Name")%></option>
  198. <%
  199. RS_STATUS.moveNext
  200. loop
  201. %>
  202. </SELECT></TD>
  203. <TD><span id="vazyat_not_check_label" style='font-weight:bold;color:red'></span></TD>
  204. <TD><INPUT TYPE="checkbox" NAME="vazyat_not_check" onclick="vazyat_not_check_Click();" checked></TD>
  205. </TR>
  206. <TR bgcolor="#555599">
  207. <td colspan="11" style="height:2px"></td>
  208. </TR>
  209. <TR>
  210. <TD colspan="5">&nbsp;</TD>
  211. <TD><INPUT TYPE="checkbox" NAME="check_salesperson" onclick="check_salesperson_Click()" checked></TD>
  212. <TD> </TD>
  213. <TD colspan="3"><SELECT NAME="salesperson_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
  214. <OPTION value="" <%if request.form("salesperson_box")="" then response.write "selected" %> ></option>
  215. <OPTION value="" <%if request.form("salesperson_box")="" then response.write "selected" %> ></option>
  216. <OPTION value="" <%if request.form("salesperson_box")="" then response.write "selected" %> ></option>
  217. <OPTION value="ѐ" <%if request.form("salesperson_box")="ѐ" then response.write "selected" %> >ѐ</option>
  218. <OPTION value="" <%if request.form("salesperson_box")="" then response.write "selected" %> ></option>
  219. <OPTION value="" <%if request.form("salesperson_box")="" then response.write "selected" %> ></option>
  220. <OPTION value="" <%if request.form("salesperson_box")="" then response.write "selected" %> ></option>
  221. <OPTION value=" " <%if request.form("salesperson_box")=" " then response.write "selected" %> > </option>
  222. <OPTION value="" <%if request.form("salesperson_box")="" then response.write "selected" %> ></option>
  223. <OPTION value="" <%if request.form("salesperson_box")="" then response.write "selected" %> ></option>
  224. <OPTION value="" <%if request.form("salesperson_box")="" then response.write "selected" %> ></option>
  225. </SELECT></TD>
  226. </TR>
  227. <TR bgcolor="#555599">
  228. <td colspan="11" style="height:2px"></td>
  229. </TR>
  230. <TR bgcolor="#EEEEEE">
  231. <TD><INPUT TYPE="checkbox" NAME="check_company_name" onclick="check_company_name_Click()" checked></TD>
  232. <TD> </TD>
  233. <TD colspan="3"><INPUT TYPE="text" NAME="company_name_box" value="<%=request.form("company_name_box")%>"></TD>
  234. <TD><INPUT TYPE="checkbox" NAME="check_telephone" onclick="check_telephone_Click()" checked></TD>
  235. <TD></TD>
  236. <TD colspan="3"><INPUT TYPE="text" NAME="telephone_box" value="<%=request.form("telephone_box")%>"></TD>
  237. </TR>
  238. <TR bgcolor="#555599">
  239. <td colspan="11" style="height:2px"></td>
  240. </TR>
  241. <TR>
  242. <TD><INPUT TYPE="checkbox" NAME="check_customer_name" onclick="check_customer_name_Click()" checked></TD>
  243. <TD> </TD>
  244. <TD colspan="3"><INPUT TYPE="text" NAME="customer_name_box" value="<%=request.form("customer_name_box")%>"></TD>
  245. <TD><INPUT TYPE="checkbox" NAME="check_order_title" onclick="check_order_title_Click()" checked></TD>
  246. <TD> </TD>
  247. <TD colspan="3"><INPUT TYPE="text" NAME="order_title_box" value="<%=request.form("order_title_box")%>"></TD>
  248. </TR>
  249. <TR bgcolor="#555599">
  250. <td colspan="11" style="height:2px"></td>
  251. </TR>
  252. <TR bgcolor="#AAAAEE">
  253. <td colspan="11" style="height:30px">
  254. <TABLE align="center" width="50%">
  255. <TR>
  256. <TD><INPUT TYPE="submit" Name="Submit" Value="" style="font-family:tahoma,arial; font-size:10pt;width:100px;"></TD>
  257. <TD>&nbsp;<INPUT disabled TYPE="button" onclick="if(document.selection.createRange().text != ''){document.execCommand('Delete');};"></TD>
  258. <TD align="left"><INPUT TYPE="button" Name="Cancel" Value=" " style="font-family:tahoma,arial; font-size:10pt;width:100px;" onclick="window.location='advancedsearch.asp';"></TD>
  259. </TR>
  260. </TABLE>
  261. </td>
  262. </TR>
  263. </TABLE>
  264. </TD></TR>
  265. </FORM>
  266. </TABLE>
  267. <br>
  268. <SCRIPT LANGUAGE='JavaScript'>
  269. <!--
  270. function check_sefaresh_Click(){
  271. if ( document.all.check_sefaresh.checked ) {
  272. document.all.az_sefaresh.style.visibility = "visible";
  273. document.all.ta_sefaresh.style.visibility = "visible";
  274. document.all.az_sefaresh.focus();
  275. }
  276. else{
  277. document.all.az_sefaresh.style.visibility = "hidden";
  278. document.all.ta_sefaresh.style.visibility = "hidden";
  279. }
  280. }
  281. function check_tarikh_sefaresh_Click(){
  282. if ( document.all.check_tarikh_sefaresh.checked ) {
  283. document.all.az_tarikh_sefaresh.style.visibility = "visible";
  284. document.all.ta_tarikh_sefaresh.style.visibility = "visible";
  285. document.all.az_tarikh_sefaresh.focus();
  286. }
  287. else{
  288. document.all.az_tarikh_sefaresh.style.visibility = "hidden";
  289. document.all.ta_tarikh_sefaresh.style.visibility = "hidden";
  290. }
  291. }
  292. function check_tarikh_tahvil_Click(){
  293. if ( document.all.check_tarikh_tahvil.checked ) {
  294. document.all.az_tarikh_tahvil.style.visibility = "visible";
  295. document.all.ta_tarikh_tahvil.style.visibility = "visible";
  296. document.all.az_tarikh_tahvil.focus();
  297. }
  298. else{
  299. document.all.az_tarikh_tahvil.style.visibility = "hidden";
  300. document.all.ta_tarikh_tahvil.style.visibility = "hidden";
  301. }
  302. }
  303. function check_company_name_Click(){
  304. if (document.all.check_company_name.checked) {
  305. document.all.company_name_box.style.visibility = "visible";
  306. document.all.company_name_box.focus();
  307. }
  308. else{
  309. document.all.company_name_box.style.visibility = "hidden";
  310. }
  311. }
  312. function check_customer_name_Click(){
  313. if (document.all.check_customer_name.checked) {
  314. document.all.customer_name_box.style.visibility = "visible";
  315. document.all.customer_name_box.focus();
  316. }
  317. else{
  318. document.all.customer_name_box.style.visibility = "hidden";
  319. }
  320. }
  321. function check_kind_Click(){
  322. if (document.all.check_kind.checked) {
  323. document.all.order_kind_box.style.visibility = "visible";
  324. document.all.order_kind_box.focus();
  325. }
  326. else{
  327. document.all.order_kind_box.style.visibility = "hidden";
  328. }
  329. }
  330. function check_marhale_Click(){
  331. if (document.all.check_marhale.checked) {
  332. document.all.marhale_box.style.visibility = "visible";
  333. document.all.marhale_box.focus();
  334. document.all.marhale_not_check.style.visibility = "visible";
  335. marhale_not_check_Click();
  336. }
  337. else{
  338. document.all.marhale_box.style.visibility = "hidden";
  339. document.all.marhale_not_check.style.visibility = "hidden";
  340. document.all.marhale_not_check_label.style.color='#BBBBBB'
  341. }
  342. }
  343. function check_vazyat_Click(){
  344. if (document.all.check_vazyat.checked) {
  345. document.all.vazyat_box.style.visibility = "visible";
  346. document.all.vazyat_box.focus();
  347. document.all.vazyat_not_check.style.visibility = "visible";
  348. vazyat_not_check_Click();
  349. }
  350. else{
  351. document.all.vazyat_box.style.visibility = "hidden";
  352. document.all.vazyat_not_check.style.visibility = "hidden";
  353. document.all.vazyat_not_check_label.style.color='#BBBBBB'
  354. }
  355. }
  356. function check_salesperson_Click(){
  357. if (document.all.check_salesperson.checked) {
  358. document.all.salesperson_box.style.visibility = "visible";
  359. document.all.salesperson_box.focus();
  360. }
  361. else{
  362. document.all.salesperson_box.style.visibility = "hidden";
  363. }
  364. }
  365. function check_telephone_Click(){
  366. if (document.all.check_telephone.checked) {
  367. document.all.telephone_box.style.visibility = "visible";
  368. document.all.telephone_box.focus();
  369. }
  370. else{
  371. document.all.telephone_box.style.visibility = "hidden";
  372. }
  373. }
  374. function check_order_title_Click(){
  375. if (document.all.check_order_title.checked) {
  376. document.all.order_title_box.style.visibility = "visible";
  377. document.all.order_title_box.focus();
  378. }
  379. else{
  380. document.all.order_title_box.style.visibility = "hidden";
  381. }
  382. }
  383. function marhale_not_check_Click(){
  384. if (document.all.marhale_not_check.checked) {
  385. document.all.marhale_not_check_label.style.color='red'
  386. }
  387. else{
  388. document.all.marhale_not_check_label.style.color='#BBBBBB'
  389. }
  390. }
  391. function vazyat_not_check_Click(){
  392. if (document.all.vazyat_not_check.checked) {
  393. document.all.vazyat_not_check_label.style.color='red'
  394. }
  395. else{
  396. document.all.vazyat_not_check_label.style.color='#BBBBBB'
  397. }
  398. }
  399. function Form_Load(){
  400. <%
  401. maybeAND = ""
  402. myCriteria = ""
  403. If request.form("check_sefaresh") = "on" Then
  404. if request.form("az_sefaresh") <> "" then
  405. myCriteria = myCriteria & maybeAND & "radif_sefareshat >= " & request.form("az_sefaresh")
  406. maybeAND=" AND "
  407. end if
  408. if request.form("ta_sefaresh") <> "" then
  409. myCriteria = myCriteria & maybeAND & "radif_sefareshat <= " & request.form("ta_sefaresh")
  410. maybeAND=" AND "
  411. end if
  412. If (request.form("az_sefaresh") = "") AND (request.form("ta_sefaresh") = "") then
  413. response.write "document.all.check_sefaresh.checked = false;" & vbCrLf
  414. response.write "document.all.az_sefaresh.style.visibility = 'hidden';" & vbCrLf
  415. response.write "document.all.ta_sefaresh.style.visibility = 'hidden';" & vbCrLf
  416. End if
  417. Else
  418. response.write "document.all.check_sefaresh.checked = false;" & vbCrLf
  419. response.write "document.all.az_sefaresh.style.visibility = 'hidden';" & vbCrLf
  420. response.write "document.all.ta_sefaresh.style.visibility = 'hidden';" & vbCrLf
  421. End If
  422. If request.form("check_tarikh_sefaresh") = "on" Then
  423. if request.form("az_tarikh_sefaresh") <> "" then
  424. myCriteria = myCriteria & maybeAND & "order_date >= '" & request.form("az_tarikh_sefaresh") & "'"
  425. maybeAND=" AND "
  426. end if
  427. if request.form("ta_tarikh_sefaresh") <> "" then
  428. myCriteria = myCriteria & maybeAND & "order_date <= '" & request.form("ta_tarikh_sefaresh") & "'"
  429. maybeAND=" AND "
  430. end if
  431. If (request.form("az_tarikh_sefaresh") = "") AND (request.form("ta_tarikh_sefaresh") = "") then
  432. response.write "document.all.check_tarikh_sefaresh.checked = false;" & vbCrLf
  433. response.write "document.all.az_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
  434. response.write "document.all.ta_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
  435. End if
  436. Else
  437. response.write "document.all.check_tarikh_sefaresh.checked = false;" & vbCrLf
  438. response.write "document.all.az_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
  439. response.write "document.all.ta_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
  440. End If
  441. If request.form("check_tarikh_tahvil") = "on" Then
  442. if request.form("az_tarikh_tahvil") <> "" then
  443. myCriteria = myCriteria & maybeAND & "return_date >= '" & request.form("az_tarikh_tahvil") & "'"
  444. maybeAND=" AND "
  445. end if
  446. if request.form("ta_tarikh_tahvil") <> "" then
  447. myCriteria = myCriteria & maybeAND & "return_date <= '" & request.form("ta_tarikh_tahvil") & "'"
  448. maybeAND=" AND "
  449. end if
  450. If (request.form("az_tarikh_tahvil") = "") AND (request.form("ta_tarikh_tahvil") = "") then
  451. response.write "document.all.check_tarikh_tahvil.checked = false;" & vbCrLf
  452. response.write "document.all.az_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
  453. response.write "document.all.ta_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
  454. End if
  455. Else
  456. response.write "document.all.check_tarikh_tahvil.checked = false;" & vbCrLf
  457. response.write "document.all.az_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
  458. response.write "document.all.ta_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
  459. End If
  460. If (request.form("check_company_name") = "on" AND request.form("company_name_box") <> "" ) then
  461. myCriteria = myCriteria & maybeAND & "company_name Like N'%" & request.form("company_name_box") &"%'"
  462. maybeAND=" AND "
  463. Else
  464. response.write "document.all.check_company_name.checked = false;" & vbCrLf
  465. response.write "document.all.company_name_box.style.visibility = 'hidden';" & vbCrLf
  466. End if
  467. If (request.form("check_customer_name") = "on" AND request.form("customer_name_box") <> "")then
  468. myCriteria = myCriteria & maybeAND & "customer_name Like N'%" & request.form("customer_name_box") &"%'"
  469. maybeAND=" AND "
  470. Else
  471. response.write "document.all.check_customer_name.checked = false;" & vbCrLf
  472. response.write "document.all.customer_name_box.style.visibility = 'hidden';" & vbCrLf
  473. End if
  474. If request.form("check_kind") = "on" then
  475. myCriteria = myCriteria & maybeAND & "order_kind = N'" & request.form("order_kind_box") & "'"
  476. maybeAND=" AND "
  477. Else
  478. response.write "document.all.check_kind.checked = false;" & vbCrLf
  479. response.write "document.all.order_kind_box.style.visibility = 'hidden';" & vbCrLf
  480. End if
  481. If request.form("check_marhale") = "on" then
  482. If request.form("marhale_not_check") = "on" then
  483. myCriteria = myCriteria & maybeAND & "NOT(step = " & request.form("marhale_box") & ")"
  484. Else
  485. myCriteria = myCriteria & maybeAND & "step = " & request.form("marhale_box")
  486. response.write "document.all.marhale_not_check.checked = false;" & vbCrLf
  487. response.write "document.all.marhale_not_check_label.style.color='#BBBBBB';"& vbCrLf
  488. End If
  489. maybeAND=" AND "
  490. Else
  491. response.write "document.all.check_marhale.checked = false;" & vbCrLf
  492. response.write "document.all.marhale_box.style.visibility = 'hidden';" & vbCrLf
  493. response.write "document.all.marhale_not_check.style.visibility = 'hidden';" & vbCrLf
  494. response.write "document.all.marhale_not_check_label.style.color='#BBBBBB';"& vbCrLf
  495. End if
  496. If request.form("check_vazyat") = "on" then
  497. If request.form("vazyat_not_check") = "on" then
  498. myCriteria = myCriteria & maybeAND & "NOT(status = " & request.form("vazyat_box") & ")"
  499. Else
  500. myCriteria = myCriteria & maybeAND & "status = " & request.form("vazyat_box")
  501. response.write "document.all.vazyat_not_check.checked = false;" & vbCrLf
  502. response.write "document.all.vazyat_not_check_label.style.color='#BBBBBB';"& vbCrLf
  503. End If
  504. maybeAND=" AND "
  505. Else
  506. response.write "document.all.check_vazyat.checked = false;" & vbCrLf
  507. response.write "document.all.vazyat_box.style.visibility = 'hidden';" & vbCrLf
  508. response.write "document.all.vazyat_not_check.style.visibility = 'hidden';" & vbCrLf
  509. response.write "document.all.vazyat_not_check_label.style.color='#BBBBBB';"& vbCrLf
  510. End if
  511. If request.form("check_salesperson") = "on" then
  512. myCriteria = myCriteria & maybeAND & "salesperson = N'" & request.form("salesperson_box") & "'"
  513. maybeAND=" AND "
  514. Else
  515. response.write "document.all.check_salesperson.checked = false;" & vbCrLf
  516. response.write "document.all.salesperson_box.style.visibility = 'hidden';" & vbCrLf
  517. End if
  518. If (request.form("check_order_title") = "on" AND request.form("order_title_box") <> "")then
  519. myCriteria = myCriteria & maybeAND & "order_title Like N'%" & request.form("order_title_box") &"%'"
  520. maybeAND=" AND "
  521. Else
  522. response.write "document.all.check_order_title.checked = false;" & vbCrLf
  523. response.write "document.all.order_title_box.style.visibility = 'hidden';" & vbCrLf
  524. End if
  525. If (request.form("check_telephone") = "on" AND request.form("telephone_box") <> "")then
  526. myCriteria = myCriteria & maybeAND & "telephone Like N'%" & request.form("telephone_box") &"%'"
  527. maybeAND=" AND "
  528. Else
  529. response.write "document.all.check_telephone.checked = false;" & vbCrLf
  530. response.write "document.all.telephone_box.style.visibility = 'hidden';" & vbCrLf
  531. End if
  532. %>
  533. }
  534. function checkValidation(){
  535. return true;
  536. }
  537. Form_Load();
  538. //-->
  539. </SCRIPT>
  540. <%
  541. if request("Submit")="" then
  542. IF maybeAND <> " AND " THEN
  543. response.write "Nothing !!!!!!!!!!"
  544. ELSE
  545. mySQL="SELECT orders_trace.*, OrderTraceStatus.Icon FROM Orders INNER JOIN orders_trace ON Orders.ID = orders_trace.radif_sefareshat INNER JOIN OrderTraceStatus ON orders_trace.status = OrderTraceStatus.ID WHERE ("& myCriteria & ") AND (Orders.Closed=0) ORDER BY radif_sefareshat DESC"
  546. set RS1=Conn.Execute (mySQL)
  547. if not RS1.eof then
  548. tmpCounter=0
  549. %>
  550. <div align="left">
  551. <table border="1" cellspacing="0" cellpadding="0" dir="RTL">
  552. <TR bgcolor="#CCCCFF">
  553. <TD width="44"># </TD>
  554. <TD width="64"> </TD>
  555. <TD width="64"> </TD>
  556. <TD width="122"> </TD>
  557. <TD width="122"> </TD>
  558. <TD width="84"> </TD>
  559. <TD width="44"></TD>
  560. <TD width="73"></TD>
  561. <TD width="63"> </TD>
  562. <TD width="24"></TD>
  563. </TR>
  564. </table>
  565. </div>
  566. <div id="results" align="left" style="overflow:auto; width:752; height:330;border:0px;" dir="LTR" >
  567. <TABLE border="1" cellspacing="0" cellpadding="2" borderColor="#555588" dir="RTL">
  568. <% Do while not RS1.eof
  569. tmpCounter = tmpCounter + 1
  570. if tmpCounter mod 2 = 1 then
  571. tmpColor="#FFFFFF"
  572. Else
  573. tmpColor="#DDDDDD"
  574. End if
  575. %>
  576. <TR bgcolor="<%=tmpColor%>">
  577. <TD width="40" DIR="LTR"><A HREF="manageOrder.asp?radif=<%=RS1("radif_sefareshat")%>" target="_blank"><%=RS1("radif_sefareshat")%></A></TD>
  578. <TD width="60" DIR="LTR"><%=RS1("order_date")%></TD>
  579. <TD width="60" DIR="LTR"><%=RS1("return_date") & " ("& RS1("return_time") & ")"%></TD>
  580. <TD width="118"><%=RS1("company_name") & "<br>:("& RS1("telephone")& ")"%>&nbsp;</TD>
  581. <TD width="118"><%=RS1("customer_name")%>&nbsp;</TD>
  582. <TD width="80"><%=RS1("order_title")%>&nbsp;</TD>
  583. <TD width="40"><%=RS1("order_kind")%></TD>
  584. <TD width="69"><%=RS1("marhale")%></TD>
  585. <TD width="59"><%=RS1("salesperson")%>&nbsp;</TD>
  586. <TD width="20"><IMG SRC="<%=RS1("icon")%>" WIDTH="20" HEIGHT="20" BORDER=0 ALT="">
  587. </TD>
  588. </TR>
  589. <TR bgcolor="#FFFFFF">
  590. <TD colspan="10" style="height:10px"></TD>
  591. </TR>
  592. <% RS1.moveNext
  593. Loop
  594. %> <TR bgcolor="#ccccFF">
  595. <TD colspan="10"> : <%=tmpCounter%></TD>
  596. </TR>
  597. </TABLE>
  598. </div>
  599. <BR>
  600. <% else
  601. %> <TABLE border="1" cellspacing="0" cellpadding="0" dir="RTL" align="center" width="600">
  602. <TR bgcolor="#FFFFDD">
  603. <TD align="center" style="height:40px;font-size:12pt;font-weight:bold;color:red"> .</TD>
  604. </TR>
  605. </TABLE>
  606. <hr>
  607. <% end if
  608. END IF
  609. end if
  610. end if
  611. Conn.Close
  612. %>
  613. </font>
  614. <!--#include file="tah.asp" -->