/beta/Inquiry/Inquiry.asp
ASP | 152 lines | 142 code | 6 blank | 4 comment | 9 complexity | 0fe7b0d969a525827cc80384351aa807 MD5 | raw file
1<%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><% 2'AR (6) 3PageTitle="���� �������" 4SubmenuItem=1 5%> 6<!--#include file="top.asp" --> 7<!--#include File="../include_farsiDateHandling.asp"--> 8<!--#include File="../include_JS_InputMasks.asp"--> 9 10<% 11function ShowErrorMessage(msg) 12 response.write "<table align='center' cellpadding='5'><tr><td bgcolor='#FFCCCC' dir='rtl' align='center'> ��� ! <br>"& msg & "<br></td></tr></table><br>" 13end function 14 15function Link2Trace(OrderNo) 16 Link2Trace="<A HREF='../order/TraceOrder.asp?act=show&order="& OrderNo & "' target='_balnk'>"& OrderNo & "</A>" 17end function 18 19%> 20<style> 21 Table { font-size: 9pt;} 22 .InvRowInput { font-family:tahoma; font-size: 9pt; border: none; background-color: #F0F0F0; text-align:right;} 23 .InvHeadInput { font-family:tahoma; font-size: 9pt; border: none; background-color: #CCCC88; text-align:center;} 24 .InvRowInput2 { font-family:tahoma; font-size: 9pt; border: none; background-color: #F0FFF0; text-align:right;} 25 .InvHeadInput2 { font-family:tahoma; font-size: 9pt; border: none; background-color: #AACC77; text-align:center;} 26 .InvHeadInput3 { font-family:tahoma; font-size: 9pt; border: none; background-color: #F0F0F0; text-align:right;} 27 .InvGenInput { font-family:tahoma; font-size: 9pt; border: none; } 28 .InvGenButton { font-family:tahoma; font-size: 9pt; border: 1px solid black; } 29</style> 30<SCRIPT LANGUAGE="JavaScript"> 31<!-- 32var okToProceed=false; 33var currentRow=0; 34//--> 35</SCRIPT> 36<% 37 38if request("act")="submitsearch" then 39' response.redirect "AccountReport.asp?act=showInvoice&invoice=" & InvoiceID 40 if isnumeric(request("inquiry")) then 41 response.redirect "AccountReport.asp?act=showInquiry&inquiry=" & request("inquiry") 42 elseif trim(request("query")) = "" then 43 Conn.close 44 response.redirect "?errmsg=" & Server.URLEncode("���� �э �������!") 45 end if 46 47 if isnumeric(request("query")) then 48 'User has entered an ORDER NUMBER 49 OrderID=clng(request("query")) 50 mySQL="SELECT InquiryOrderRelations.Inquiry FROM InquiryOrderRelations INNER JOIN Inquiries ON InquiryOrderRelations.Inquiry = Inquiries.ID WHERE (InquiryOrderRelations.[Order] = '"& OrderID & "') AND (Inquiries.IsReverse = 0) AND (Inquiries.Voided = 0)" 51 Set rs = Server.CreateObject("ADODB.Recordset") 52 rs.open mySQL, Conn, 3, 3 53 if rs.eof then 54 rs.close 55 mySQL="SELECT InquiryOrderRelations.Inquiry FROM InqueryOrderRelations INNER JOIN Inquiries ON InquiryOrderRelations.Inquiry = Inquires.ID WHERE (InquiryOrderRelations.[Order] = '"& OrderID & "') AND (Inquiries.IsReverse = 0)" 56 rs.open mySQL, Conn, 3, 3 57 if not rs.eof then 58 InquiryID=rs("Inquiry") 59 Conn.close 60 response.redirect "AccountReport.asp?act=showInquiry&inquiry=" & InquiryID 61 else 62 Conn.close 63 response.redirect "?errmsg=" & Server.URLEncode("����� ����� �� ��� ������� ���� ���.") 64 end if 65 else 66 if rs.RecordCount>1 then 67 tempWriteAnd="" 68 inquiryList="��� ����� �� ��� ������ ��� ����� ���:<br>" 69 Do While not rs.eof 70 inquiryList=inquiryList & tempWriteAnd & "<A HREF='AccountReport.asp?act=showInquiry&inquiry="& rs("inquiry") &"' target='_blank'>" & rs("inquiry") & "</A>" 71 tempWriteAnd=" � " 72 rs.moveNext 73 Loop 74 inquiryList=inquiryList & "<br>�� ��� �����" 75 response.write "<br><br>" 76 call showAlert (inquiryList ,CONST_MSG_ALERT) 77 else 78 InquiryID=rs("Inquiry") 79 Conn.close 80 response.redirect "AccountReport.asp?act=showInquiry&inquiry=" & InquiryID 81 end if 82 end if 83 else 84 'User has entered an ACCOUNT NAME 85 SA_TitleOrName=request("query") 86 SA_Action="return true;" 87 SA_SearchAgainURL="InquiryInput.asp" 88 SA_StepText="��� ��� : ������ ����" 89%> 90 <FORM METHOD=POST ACTION="?act=showInquiries"> 91 <!--#include File="include_SelectAccount.asp"--> 92 </FORM> 93<% 94 end if 95elseif request("act")="showInquiry" then 96 cusID=request("selectedCustomer") 97 if cusID <> "" and isnumeric(cusID) then 98 mySQL="SELECT TOP 1 AccountTitle FROM Accounts WHERE (ID = '"& clng(cusID) & "')" 99 set RS1=Conn.execute(mySQL) 100 AccountTitle = RS1("AccountTitle") 101%> 102 <br><br> 103 <!--#include file="include_CustomerInquiries.asp" --> 104<% 105 end if 106else%> 107 <br> 108 <br> 109 <FORM METHOD=POST ACTION="?act=submitsearch"> 110 <div dir='rtl'><B><FONT SIZE="" COLOR="red"> ����� �������: </FONT><BR>����� ���� ��� ���� �� ����� �����</B> 111 <INPUT TYPE="text" NAME="query" onfocus="document.getElementsByName('inquiry')[0].value='';"> 112 <INPUT class="GenButton" TYPE="submit" Name="submitShow" value="�����"> ����� �������: 113 <INPUT style="font-family:Tahoma;width:100px;" TYPE="text" NAME="inquiry"> 114 </div> 115 </FORM> 116<!-- ����� ���� ��� ���� �� ����� �����--> 117 <%if Auth(6 , 1) then %> 118 <br> 119 <hr width="90%" align="center"> 120 <br> 121 <FORM METHOD=POST ACTION="InquiryInput.asp?act=submitsearch"> 122 <div dir='rtl'><B><FONT SIZE="" COLOR="red"> ������� ����: </FONT><BR>����� ���� ��� ���� �� ����� �����</B> 123 <INPUT TYPE="text" NAME="query"> 124 <INPUT class="GenButton" TYPE="submit" value="�����"><br> 125 </div> 126 </FORM> 127 <%end if %> 128<!-- ����� ���� ������� --> 129 <%if Auth(6 , 3) then %> 130 <br> 131 <hr width="90%" align="center"> 132 <br> 133 <br> 134 <FORM METHOD=POST ACTION="InquiryEdit.asp?act=search"> 135 <div dir='rtl'> <B><FONT SIZE="" COLOR="red">����� �������:</FONT><BR> ����� ����� �� ���� ����</B> 136 <INPUT style="font-family:Tahoma;" TYPE="text" NAME="order" onfocus="document.getElementsByName('inquiry')[1].value='';"> 137 <INPUT class="GenButton" TYPE="submit" value="�����..."> ����� �������: 138 <INPUT style="font-family:Tahoma;width:100px;" TYPE="text" NAME="inquiry"> 139 </div> 140 </FORM> 141 <%end if %> 142 143 <SCRIPT LANGUAGE="JavaScript"> 144 <!-- 145 document.getElementsByName("query")[0].focus(); 146 //--> 147 </SCRIPT> 148<% 149end if 150conn.Close 151%> 152<!--#include file="tah.asp" -->