/beta/order/Inquiry.asp
http://github.com/khaneh/Orders · ASP · 2088 lines · 1850 code · 144 blank · 94 comment · 208 complexity · c083b6c85a1802c3070a0020ba546cc2 MD5 · raw file
Large files are truncated click here to view the full file
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
- 'Order (2)
- PageTitle=""
- SubmenuItem=9
- if not Auth(2 , 9) then NotAllowdToViewThisPage() '
- %>
- <!--#include file="top.asp" -->
- <!--#include File="../include_farsiDateHandling.asp"-->
- <!--#include File="../include_UtilFunctions.asp"-->
- <!--#include File="../include_JS_InputMasks.asp"-->
- <%
- 'Server.ScriptTimeout = 3600
- %>
- <STYLE>
- .CustTable {font-family:tahoma; width:80%; border:1 solid black; direction: RTL; background-color:black;}
- .CustTable td {padding:5;}
- .CustTable a {text-decoration:none;color:#000088}
- .CustTable a:hover {text-decoration:underline;}
- .CusTableHeader {background-color: #33AACC; text-align: center; font-weight:bold;}
- .CusTD1 {background-color: #CCCC66; text-align: left; font-weight:bold;}
- .CusTD2 {background-color: #DDDDDD; direction: LTR; text-align: right; font-size:9pt;}
- .CusTD3 {background-color: #DDDDDD; direction: LTR; text-align: center; font-size:9pt;}
- .CusTD4 {background-color: #CCCC66; direction: LTR; text-align: center; font-size:9pt;}
- </STYLE>
- <%
- '-----------------------------
- ' Trace Quote
- '-----------------------------
- if Request.QueryString("act")="" then
- %>
- <SCRIPT LANGUAGE='JavaScript'>
- <!--
- function checkValidation(){
- if (document.all.search_box.value != ''){
- return true;
- }
- else{
- document.all.search_box.focus();
- return false;
- }
- }
- //-->
- </SCRIPT>
- <hr>
- <TABLE border="4" cellspacing="0" cellpadding="0" width="600" align="center" bordercolor="#555599">
- <TR><TD>
- <TABLE border="0" cellspacing="0" cellpadding="5" dir="RTL" width="100%">
- <!-- Trace Quote -->
- <FORM METHOD=POST ACTION="?act=search" onSubmit="return checkValidation();">
- <TR bgcolor="#AAAAEE"><TD colspan="4">
- <FONT SIZE="" COLOR="#555599" ><B> :</B></FONT>
- </TD></TR>
- <TR bgcolor="#AAAAEE">
- <TD> :</TD>
- <TD><INPUT TYPE="text" NAME="search_box" value="<%=request.form("search_box")%>"></TD>
- <TD><INPUT TYPE="submit" NAME="SubmitB" Value="" style="font-family:tahoma,arial; font-size:10pt;width:100px;"></TD>
- <TD align="left"><% if Auth(2 , 5) then %><A HREF="?act=advancedSearch"> </A><% End If %></TD>
- </TR>
- </FORM>
- </TABLE>
- </TD></TR>
- <TR><TD>
- <TABLE border="0" cellspacing="0" cellpadding="5" dir="RTL" width="100%">
- <!-- Input Quote -->
- <FORM METHOD=POST ACTION="?act=quoteInpCustSearch" onsubmit="if (document.all.CustomerNameSearchBox.value=='') return false;">
- <TR bgcolor="#AAAAEE">
- <TD>
- <FONT SIZE="" COLOR="#555599" ><B> :</B></FONT>
- </TD>
- </TR>
- <TR bgcolor="#AAAAEE">
- <TD> :
- <INPUT TYPE="text" NAME="CustomerNameSearchBox">
- <INPUT TYPE="submit" value=""><br>
- <SCRIPT LANGUAGE="JavaScript">
- document.all.CustomerNameSearchBox.focus();
- </SCRIPT>
- </TD>
- </TR>
- </FORM>
- </TABLE>
- </TD></TR>
- </TABLE>
- <script language="JavaScript">
- document.all.search_box.focus();
- </script>
- <hr>
- <%
- '
- elseif Request.QueryString("act")="search" then
- %>
- <hr>
- <TABLE border="4" cellspacing="0" cellpadding="0" width="600" align="center" bordercolor="#555599">
- <FORM METHOD=POST ACTION="?act=search" onSubmit="return checkValidation();">
- <TR><TD>
- <TABLE border="0" cellspacing="0" cellpadding="5" dir="RTL" width="100%">
- <TR bgcolor="#AAAAEE">
- <TD> :</TD>
- <TD><INPUT TYPE="text" NAME="search_box" value="<%=request.form("search_box")%>"></TD>
- <TD><INPUT TYPE="submit" NAME="SubmitB" Value="" style="font-family:tahoma,arial; font-size:10pt;width:100px;"></TD>
- <TD align="left"><A HREF="?act=advancedSearch"> </A></TD>
- </TR>
- </TABLE>
- </TD></TR>
- </FORM>
- </TABLE>
- <script language="JavaScript">
- <!--
- document.all.search_box.focus();
- //-->
- </script>
- <hr>
- <%
-
- search=request("search_box")
- if search="" then
- 'By Default show Open Quotes of Current User
- myCriteria= "Quotes.CreatedBy = " & session("ID")
- elseif isNumeric(search) then
- search=clng(search)
- myCriteria= "Quotes.ID = '"& search & "'"
- else
- search=sqlSafe(search)
- myCriteria= "REPLACE([company_name], ' ', '') LIKE REPLACE(N'%"& search & "%', ' ', '') OR REPLACE([customer_name], ' ', '') LIKE REPLACE(N'%"& search & "%', ' ', '')"
- End If
- mySQL= "SELECT Quotes.*, OrderTraceStatus.Name AS StatusName, OrderTraceStatus.Icon , Invoices.ID AS InvoiceID, Invoices.Approved, Invoices.Voided, Invoices.Issued "&_
- " FROM Quotes INNER JOIN "&_
- " OrderTraceStatus ON OrderTraceStatus.ID = Quotes.status LEFT OUTER JOIN "&_
- " Invoices INNER JOIN "&_
- " InvoiceQuoteRelations ON Invoices.ID = InvoiceQuoteRelations.Invoice ON Quotes.ID = InvoiceQuoteRelations.Quote "&_
- " WHERE ("& myCriteria & ") "&_
- " ORDER BY Quotes.order_date DESC, Quotes.ID DESC "
- set RS1=Conn.Execute (mySQL)
- if not RS1.eof then
- tmpCounter=0
- %>
- <div align="center" dir="LTR" >
- <table border="1" cellspacing="0" cellpadding="2" dir="RTL" borderColor="#555588" >
- <TR valign=top bgcolor="#CCCCFF">
- <TD width="41"># </TD>
- <TD width="65"> <br> </TD>
- <TD width="130"> - </TD>
- <TD width="110"> </TD>
- <TD width="36"></TD>
- <TD width="76"></TD>
- <TD width="56"> </TD>
- <TD width="40"></TD>
- </TR>
- <% Do while not RS1.eof
- if isnull(RS1("InvoiceID")) then
- InvoiceStatus="<span style='color:red;'><b></b></span>"
- else
- if RS1("Voided") then
- style="style='color:Red' Title=' '"
- elseif RS1("Issued") then
- style="style='color:Red' Title=' '"
- elseif RS1("Approved") then
- style="style='color:Green' Title=' '"
- else
- style="style='color:#3399FF' Title=' '"
- end if
- InvoiceStatus="<A " & style & " HREF='../AR/AccountReport.asp?act=showInvoice&invoice=" & RS1("InvoiceID")& "' Target='_blank'>" & RS1("InvoiceID") & "</A>"
- end if
-
- tmpCounter = tmpCounter + 1
- if tmpCounter mod 2 = 1 then
- tmpColor="#FFFFFF"
- Else
- tmpColor="#EEEEEE"
- End If
- %>
- <TR valign=top bgcolor="<%=tmpColor%>">
- <TD width="40" DIR="LTR"><A HREF="?act=show"e=<%=RS1("ID")%>" target="_blank"><%=RS1("ID")%></A></TD>
- <TD width="65" DIR="LTR"><%=RS1("order_date")%><br><%=RS1("return_date") & " ("& RS1("return_time") & ")"%></TD>
- <TD width="130"><%=RS1("company_name")%><br><span style='color:gray'><%=RS1("customer_name")%></span><br>:(<%=RS1("telephone")%>) </TD>
- <TD width="80"><%=RS1("order_title")%> </TD>
- <TD width="40"><%=RS1("order_kind")%></TD>
- <TD width="85"><%=RS1("marhale")%></TD>
- <TD width="50"><%=RS1("salesperson")%> </TD>
- <TD width="30"><%=InvoiceStatus%> </TD>
- </TR>
- <TR bgcolor="#FFFFFF">
- <TD colspan="10" style="height:10px"></TD>
- </TR>
- <% RS1.moveNext
- Loop
- %> <TR bgcolor="#ccccFF">
- <TD colspan="10"> : <%=tmpCounter%></TD>
- </TR>
- </TABLE>
- </div>
- <HR>
- <%
- elseif request("search_box")<>"" Then
-
- %> <TABLE border="1" cellspacing="0" cellpadding="0" dir="RTL" align="center" width="600">
- <TR bgcolor="#FFFFDD">
- <TD align="center" style="height:40px;font-size:12pt;font-weight:bold;color:red;padding:5px;"> <br>
- ( )<br><br>
- <A HREF="?act=show"e=<%=request("search_box")%>" style="color:blue;"> </A> .</TD>
- </TR>
- </TABLE>
- <%
- End If
- '----------------------------------------------------------------------------------------------------------
- elseif Request.QueryString("act")="approve" then
- if isnumeric(request("quote")) then
- quote=request("quote")
- set rs = Conn.Execute("select * form Quotes where id=" & quote)
- If RS1.EOF then
- response.write "<BR><BR><BR><BR><CENTER> </CENTER>"
- response.end
- End If
- msg=""
- if IsNull(rs("qtty")) then msg="ǎ <br>"
- if IsNull(rs("paperZise") or rs("paperZise")="") then msg=msg &" <br>"
- if IsNull(rs("property") or rs("property")="") then msg=msg & " <br>"
- set typeProp = server.createobject("MSXML2.DomDocument")
- set orderProp = server.createobject("MSXML2.DomDocument")
- orderProp.loadXML(rs("property"))
- orderType= rs("type")
- set rs=Conn.Execute("select * from OrderTraceTypes where id="&orderType)
- typeProp.loadXML(rs("property"))
- set rs=nothing
- oldTmp="---first---"
- for each tmp in orderProp.selectNodes("//key")
- if oldTmp <> tmp.parentNode.nodeName then
- oldTmp = tmp.parentNode.nodeName
- key = "/keys/" & oldTmp & "/key"
- oldGroup="---first---"
- oldLabel="---first---"
- maxID=-1
- oldID=-1
- rowEmpty=false
- for each mykey in orderProp.SelectNodes(key)
- id=myKey.GetAttribute("id")
- if maxID<id then maxID=id
- next
- for id = 0 to maxID
- For Each myKey In orderProp.SelectNodes(key & "[@id='" & id & "']")
- thisName = myKey.GetAttribute("name")
- set typeKey = typeProp.selectNodes(key & "[@name='" & thisName & "']")(0)
- thisType = typeKey.GetAttribute("type")
- thisLabel= typeKey.GetAttribute("label")
- thisGroup= typeKey.GetAttribute("group")
- thisItem = typeKey.GetAttribute("item")
- if thisName="description" then thisDesc = myKey.text
-
- isRow =false
- if thisName<>"" then
- isRow=true
- 'if ((oldGroup<>thisGroup or oldID<>id) and oldGroup <> "---first---") then
- if oldGroup<>thisGroup or oldID<>id then
- 'if typeKey.GetAttribute("grouplabel")<>""
- a=2
- end if
- 'if oldLabel<>thisLabel and thisType<>"radio" then
-
- end if
- 'desc=
-
- oldGroup=thisGroup
- oldLabel=thisLabel
- oldID=id
- next
- next
- end if
- next
- 'Conn.Execute("update Quotes set qApproved=1 where id=" & quote)
- end if
- 'response.redirect "?act=show"e=" & quote
- elseif Request.QueryString("act")="show" then
- if isnumeric(request("quote")) then
- quote=request("quote")
- 'mySQL="SELECT Accounts.ID AS AccID, Accounts.AccountTitle, Quotes.* FROM Accounts INNER JOIN Quotes ON Accounts.ID = Quotes.Customer WHERE (Quotes.ID='"& quote & "')"
- mySQL= "SELECT Quotes.*, Accounts.ID AS AccID, Accounts.AccountTitle, "&_
- "Invoices.ID AS InvoiceID, Invoices.Approved, Invoices.Voided, Invoices.Issued "&_
- "FROM Quotes INNER JOIN "&_
- "Accounts ON Accounts.ID = Quotes.Customer LEFT OUTER JOIN "&_
- "InvoiceQuoteRelations INNER JOIN "&_
- "Invoices ON InvoiceQuoteRelations.Invoice = Invoices.ID ON InvoiceQuoteRelations.Quote = Quotes.ID "&_
- "WHERE (Quotes.ID='"& quote & "')"
- 'response.write mySQL
- set RS1=conn.execute (mySQL)
- If RS1.EOF then
- response.write "<BR><BR><BR><BR><CENTER> </CENTER>"
- response.end
- End If
- If RS1("Step")=4 then
- stamp="<div style='border:2 dashed red;width:150px; text-align:center; padding: 10px;color:red;font-size:15pt;font-weight:bold;'> </div>"
- End If
- %>
- <table border="0" cellpadding="0" cellspacing="0" align="center">
- <tr height="10">
- <td colspan=2></td>
- </tr>
- <tr height="10">
- <td width="150"></td>
- <td valign="top"><div style='position:absolute;'><%=stamp%></div></td>
- </tr>
- <tr height="20">
- <td colspan=2></td>
- </tr>
- </table>
- <CENTER>
- <%if not CBool(rs1("qApproved")) then%>
- <input type="button" value="" Class="GenButton" onclick="window.location='?act=editQuote"e=<%=quote%>';">
- <input title=" ϡ ԝ ." type="button" value="" Class="GenButton" onclick="window.location='?act=approve"e=<%=quote%>';">
- <%else%>
- <% If RS1("Step")<>5 Then %>
- <input type="button" value=" " Class="GenButton" onclick="window.location='?act=convertToOrder"e=<%=quote%>';">
- <% Else %>
- <font color="red"> (<b> </b>)</font>
- <% End If %>
- <%end if%>
- <input type="button" value="߁ " Class="GenButton" onclick="window.location='?act=copy"e=<%=quote%>';">
- <%' ReportLogRow = PrepareReport ("OrderForm.rpt", "Order_ID", quote, "/beta/dialog_printManager.asp?act=Fin") %>
- <!--INPUT TYPE="button" value=" ǁ " Class="GenButton" style="border:1 solid blue;" onclick="printThisReport(this,<% 'ReportLogRow%>);"-->
- <% If isnull(RS1("InvoiceID")) Then %>
- <input type="button" value=" " Class="GenButton" onclick="window.location='../AR/InvoiceInput.asp?act=getInvoice&selectedCustomer=<%=RS1("AccID")%>&selectedQuotes=<%=quote%>';">
- <% Else %>
- <input type="button" value=" (<%=RS1("InvoiceID")%>)" Class="GenButton" style="color:#3399FF;" onclick="window.location='../AR/AccountReport.asp?act=showInvoice&invoice=<%=RS1("InvoiceID")%>';">
- <% End If %>
-
- </CENTER>
-
- <BR>
- <TABLE class="" cellspacing="0" cellpadding="2" align="center" style="background-color:#CCCCCC; color:black; direction:RTL; width:700; border: 2 solid #555599;">
- <TR bgcolor="#555599">
- <TD align="left"><FONT COLOR="YELLOW">:</FONT></TD>
- <TD align="right" colspan=5 height="25px">
- <span id="customer" style="color:yellow;"><%' after any changes in this span "./Customers.asp" must be revised%>
- <span><%=RS1("AccID") & " - "& RS1("AccountTitle")%></span>.
- </span>
- </TD>
- </TR>
-
- <TR bgcolor="#555599" height=30 style="color:yellow;">
- <TD align="left"> :</TD>
- <TD align="right"><%=RS1("ID")%></TD>
- <TD align="left">:</TD>
- <TD><span dir="LTR"><%=RS1("order_date")%></span></TD>
- <TD align="left">:</TD>
- <TD align="right"><%=RS1("order_time")%></TD>
- </TR>
- <TR height=30>
- <TD align="left"> :</TD>
- <TD><%=RS1("company_name")%></TD>
- <TD align="left"> :</TD>
- <TD align="right" dir=LTR><%=RS1("return_date")%></TD>
- <TD align="left"> :</TD>
- <TD align="right" dir=LTR><%=RS1("return_time")%></TD>
- </TR>
- <TR height=30>
- <TD align="left"> :</TD>
- <TD><%=RS1("customer_name")%></TD>
- <TD align="left"> :</TD>
- <TD><%=RS1("order_kind")%></TD>
- <TD align="left"> :</TD>
- <TD><%=RS1("salesperson")%> </TD>
- </TR>
- <TR height=30>
- <TD align="left">:</TD>
- <TD><%=RS1("telephone")%></TD>
- <TD align="left"> :</TD>
- <TD colspan="3"><%=RS1("order_title")%></TD>
- </TR>
-
- <TR height=30>
- <td align="left">:</td>
- <td><%=rs1("qtty")%></td>
- <TD align="left">:</TD>
- <TD><%=RS1("PaperSize")%></TD>
- <TD align="left"> :</TD>
- <TD>
- <%if RS1("productionDuration") = 0 then
- response.write "<font color=red></font>"
- else
- response.write RS1("productionDuration") & " "
- end if %>
-
- </TD>
- </TR>
- <TR height=30>
- <TD align="left">:</TD>
- <TD colspan="3"><%=RS1("marhale")%></TD>
- <TD align="left"> :</TD>
- <TD><span class="price"><%=RS1("Price")%></span></TD>
- </TR>
- <TR height=30>
- <TD align="left" valign="top" colspan="3"> :</TD>
- <TD colspan="3">
- <%if not IsNull(RS1("Notes")) then response.write replace(RS1("Notes"),chr(13),"<br>")%>
- </TD>
- </TR>
- </TABLE>
- <%
- set rs = conn.Execute("select *,users.RealName from QuoteLogs inner join Users on QuoteLogs.LastUpdatedBy=users.ID where QuoteLogs.QuoteID=" & quote & " and QuoteLogs.ID in (select min(id) from QuoteLogs group by QuoteID,productionDuration)")
- if not rs.eof then
- %>
- <TABLE class="" cellspacing="0" cellpadding="2" align="center" style="background-color:#CCCCCC; color:black; direction:RTL; width:700; border: 2 solid #555599;">
- <tr bgcolor="#555599" height=30 style="color:yellow;">
- <td></td>
- <td></td>
- <td> </td>
- <td></td>
- </tr>
- <%
- while not rs.eof
- response.write "<tr><td>" & rs("LastUpdatedDate") & "</td><td>" & rs("LastUpdatedTime") & "</td><td>"
- if CInt(rs("productionDuration"))=0 then
- response.write "<font color=red></font>"
- else
- response.write rs("productionDuration") & " "
- end if
- response.write "</td><td>" & rs("RealName") & "</td></tr>"
- rs.moveNext
- wend
- %>
- <tr>
-
- </tr>
- </table>
- <%
- end if
- %>
- <BR>
- <%
- if (not (IsNull(rs1("property")) or rs1("property")="")) then
- %>
- <div> </div>
- <%
- set rs=Conn.Execute("select * from OrderTraceTypes where id="&rs1("type"))
- set typeProp = server.createobject("MSXML2.DomDocument")
- set orderProp = server.createobject("MSXML2.DomDocument")
-
- orderProp.loadXML(rs1("property"))
- typeProp.loadXML(rs("property"))
- set rs=nothing
- sub showKey(key)
- oldGroup="---first---"
- oldLabel="---first---"
- maxID=-1
- oldID=-1
- rowEmpty=false
- for each mykey in orderProp.SelectNodes(key)
- id=myKey.GetAttribute("id")
- if maxID<id then maxID=id
- next
- thisRow = "<div class='myRow'>"'<div class='exteraArea' id='" & Replace(key,"/","-") & "-0'>"
- for id = 0 to maxID
- For Each myKey In orderProp.SelectNodes(key & "[@id='" & id & "']")
- thisName = myKey.GetAttribute("name")
- set typeKey = typeProp.selectNodes(key & "[@name='" & thisName & "']")(0)
- thisType = typeKey.GetAttribute("type")
- thisLabel= typeKey.GetAttribute("label")
- thisGroup= typeKey.GetAttribute("group")
- if thisType="radio" then
- radioID = CInt(myKey.text)
- set typeKey = typeProp.selectNodes(key & "[@name='" & thisName & "']")(radioID - 1)
- thisType = typeKey.GetAttribute("type")
- thisLabel= typeKey.GetAttribute("label")
- thisGroup= typeKey.GetAttribute("group")
- end if
- isRow =false
- if Replace(key,"/","-")="keys-service-key" then response.write "::--------::" & myKey.text
- if thisName<>"" then
- isRow=true
- if oldID<>id then thisRow = thisRow & "<div class='exteraArea' id='" & Replace(key,"/","-") & "-" & id & "'>"
- if (oldGroup<>thisGroup and oldID=id and oldGroup <> "---first---") then thisRow = thisRow & "</div>"
- if oldGroup<>thisGroup or oldID<>id then
- thisRow = thisRow & "<div class='mySection'>"
- if typeKey.GetAttribute("grouplabel")<>"" then thisRow = thisRow & "<b>" & typeKey.GetAttribute("grouplabel") & "</b>"
- end if
- if oldLabel<>thisLabel and thisType<>"radio" then thisRow = thisRow & "<label class='myLabel'>" & thisLabel & ": </label>"
-
- if left(thisType,6)="option" then set myOptions=typeKey
- myText=""
- select case thisType
- case "option"
- for each optKey in myOptions.selectNodes("option")
- if optKey.text=myKey.text then
- myText = optKey.GetAttribute("label")
- exit for
- end if
- next
- case "option-other"
- if left(myKey.text,6)="other:" then
- myText = mid(myKey.text,7)
- else
- for each optKey in myOptions.selectNodes("option")
- if optKey.text=myKey.text then
- myText = optKey.GetAttribute("label")
- exit for
- end if
- next
- end if
- if myText="" then myText = myKey.text
- case "check"
- if left(myKey.text,2)="on" then myText = "<img src='/images/Checkmark-32.png' width='15px'>"
- case "radio"
- myText=thisLabel
- case else
- myText = myKey.text
- end select
- set myOptions=nothing
- thisRow = thisRow & "<span class='myProp'>" & myText & "</span>"
- else
- if id=0 then
- thisRow=""
- rowEmpty=true
- end if
- end if
- oldGroup=thisGroup
- oldLabel=thisLabel
- oldID=id
- if typeKey.GetAttribute("br")="yes" then thisRow = thisRow & "<br><br>"
- Next
- if isRow then thisRow = thisRow & "</div></div>"
- next
- 'response.write maxID
- if not rowEmpty then thisRow = thisRow & "</div>" '"<div id='extreArea" &Replace(key,"/","-")& "'></div>"
- response.write thisRow 'prependTo
- ' response.write
- end sub
- oldTmp="---first---"
- for each tmp in orderProp.selectNodes("//key")
- if oldTmp<>tmp.parentNode.nodeName then
- oldTmp=tmp.parentNode.nodeName
- call showKey("/keys/" & oldTmp & "/key")
- end if
- next
- ' call showKey("/keys/printing/key")
- ' call showKey("keys/binding/key")
- ' call showKey("keys/service/key")
- ' call showKey("keys/delivery/key")
-
- end if
- %>
- <br><br>
- <table class="CustTable" cellspacing='1' align=center style="width:700; ">
- <tr>
- <td colspan="2" class="CusTableHeader"><span style="width:450;text-align:center;"> </span><span style="width:100;text-align:left;background-color:red;"><input class="GenButton" type="button" value=" " onclick="window.location = '../home/message.asp?RelatedTable=quotes&RelatedID=<%=quote%>&retURL=<%=Server.URLEncode("../order/Inquiry.asp?act=show"e=""e)%>';"></span></td>
- </tr>
- <%
- mySQL="SELECT * FROM Messages INNER JOIN Users ON Messages.MsgFrom = Users.ID WHERE (Messages.RelatedTable = 'quotes') AND (Messages.RelatedID = "& quote & ") ORDER BY Messages.ID DESC"
- Set RS = conn.execute(mySQL)
- if NOT RS.eof then
- tmpCounter=0
- Do While NOT RS.eof
- tmpCounter=tmpCounter+1
- %>
- <tr class="<%if (tmpCounter MOD 2) = 1 then response.write "CusTD3" else response.write "CusTD4" %>">
- <td> <%=RS("RealName")%><br>
- <%=RS("MsgDate")%> <BR> <%=RS("MsgTime")%>
- </td>
- <td dir='RTL'><%=replace(RS("MsgBody"),chr(13),"<br>")%></td>
- </tr>
- <%
- RS.moveNext
- Loop
- else
- %>
- <tr class="CusTD3">
- <td colspan="2"></td>
- </tr>
- <%
- end if
- RS.close
- %>
- </table><BR>
- <%
- end if
- elseif Request.QueryString("act")="advancedSearch" then
- '------ Advanced Search
- %>
- <!--#include File="../include_JS_InputMasks.asp"-->
- <%
- 'Server.ScriptTimeout = 3600
- tmpTime=time
- tmpTime=Hour(tmpTime)&":"&Minute(tmpTime)
- if instr(tmpTime,":")<3 then tmpTime="0" & tmpTime
- if len(tmpTime)<5 then tmpTime=Left(tmpTime,3) & "0" & Right(tmpTime,1)
- if request("resultsCount")="" OR not isnumeric(request("resultsCount")) then
- resultsCount = 50
- else
- resultsCount = cint(request("resultsCount"))
- end if
- %>
- <hr>
- <TABLE border="4" cellspacing="0" cellpadding="0" width="700" align="center" bordercolor="#555599">
- <FORM METHOD=POST ACTION="?act=advancedSearch" onSubmit="return checkValidation();">
- <TR><TD>
- <TABLE border="0" cellspacing="0" cellpadding="1" dir="RTL" width="100%" bgcolor="white">
- <TR bgcolor="#EEEEEE">
- <TD><INPUT TYPE="checkbox" NAME="check_sefaresh" onclick="check_sefaresh_Click()" checked></TD>
- <TD> </TD>
- <TD><INPUT TYPE="text" NAME="az_sefaresh" dir="LTR" value="<%=request.form("az_sefaresh")%>" size="8" maxlength="6" onKeyPress="return maskNumber(this);"></TD>
- <TD></TD>
- <TD><INPUT TYPE="text" NAME="ta_sefaresh" dir="LTR" value="<%=request.form("ta_sefaresh")%>" size="8" maxlength="6" onKeyPress="return maskNumber(this);" ></TD>
- <td rowspan="12" style="width:1px" bgcolor="#555599"></td>
- <TD><INPUT TYPE="checkbox" NAME="check_kind" onclick="check_kind_Click()" checked></TD>
- <TD> </TD>
- <TD colspan="3"><SELECT NAME="order_kind_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
- <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
- <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
- <OPTION value=" " <%if request.form("order_kind_box")=" " then response.write "selected" %> > </option>
- <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
- <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
- <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
- <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
- <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
- <OPTION value="" <%if request.form("order_kind_box")="" then response.write "selected" %> ></option>
- </SELECT></TD>
- </TR>
- <TR bgcolor="#555599">
- <td colspan="11" style="height:2px"></td>
- </TR>
- <TR>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_tarikh_sefaresh" onclick="check_tarikh_sefaresh_Click()" checked>
- </TD>
- <TD> </TD>
- <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>
- <TD></TD>
- <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>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_marhale" onclick="check_marhale_Click()" checked>
- </TD>
- <TD></TD>
- <TD>
- <SELECT NAME="marhale_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
- <%
- set RS_STEP=Conn.Execute ("SELECT * FROM QuoteSteps WHERE (IsActive=1)")
- Do while not RS_STEP.eof
- %>
- <OPTION value="<%=RS_STEP("ID")%>" <%if cint(request("marhale_box"))=cint(RS_STEP("ID")) then response.write "selected" %> ><%=RS_STEP("name")%></option>
- <%
- RS_STEP.moveNext
- loop
- RS_STEP.close
- %>
- </SELECT>
- </TD>
- <TD>
- <span id="marhale_not_check_label" style='font-weight:bold;color:red'></span>
- </TD>
- <TD>
- <INPUT TYPE="checkbox" NAME="marhale_not_check" onclick="marhale_not_check_Click();" checked>
- </TD>
- </TR>
- <TR bgcolor="#555599">
- <td colspan="11" style="height:2px"></td>
- </TR>
- <TR bgcolor="#EEEEEE">
- <TD>
- <INPUT TYPE="checkbox" NAME="check_tarikh_tahvil" onclick="check_tarikh_tahvil_Click()" checked>
- </TD>
- <TD> </TD>
- <TD>
- <INPUT TYPE="text" NAME="az_tarikh_tahvil" dir="LTR" value="<%=request.form("az_tarikh_tahvil")%>" size="10" onblur="acceptDate(this)" maxlength="10" onKeyPress="return maskDate(this);">
- </TD>
- <TD></TD>
- <TD>
- <INPUT TYPE="text" NAME="ta_tarikh_tahvil" dir="LTR" value="<%=request.form("ta_tarikh_tahvil")%>" onblur="acceptDate(this)" maxlength="10" size="10" onKeyPress="return maskDate(this);">
- </TD>
- <td colspan="5"></td>
-
- </TR>
- <TR bgcolor="#EEEEEE">
- <TD colspan="5"> </TD>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_closed" onclick="check_closed_Click()" checked>
- </TD>
- <TD colspan="4">
- <span id="check_closed_label" style='color:black;'> </span>
- </TD>
- </TR>
- <TR bgcolor="#555599">
- <td colspan="11" style="height:2px"></td>
- </TR>
- <TR>
- <TD colspan="5"> </TD>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_salesperson" onclick="check_salesperson_Click()" checked>
- </TD>
- <TD> </TD>
- <TD colspan="3">
- <SELECT NAME="salesperson_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
- <% set RSV=Conn.Execute ("SELECT RealName,id FROM Users WHERE Display=1 ORDER BY RealName")
- Do while not RSV.eof
- %>
- <option value="<%=RSV("RealName")%>"
- <%
- if request.form("salesperson_box")="" then
- if RSV("id")=session("id") then response.write " selected "
- else
- if RSV("RealName")=request.form("salesperson_box") then response.write " selected "
- end if
- %> >
- <%=RSV("RealName")%>
- </option>
- <%
- RSV.moveNext
- Loop
- RSV.close
- %>
- </SELECT>
- </TD>
- </TR>
- <TR bgcolor="#555599">
- <td colspan="11" style="height:2px"></td>
- </TR>
- <TR bgcolor="#EEEEEE">
- <TD>
- <INPUT TYPE="checkbox" NAME="check_company_name" onclick="check_company_name_Click()" checked>
- </TD>
- <TD> </TD>
- <TD colspan="3">
- <INPUT TYPE="text" NAME="company_name_box" value="<%=request.form("company_name_box")%>">
- </TD>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_telephone" onclick="check_telephone_Click()" checked>
- </TD>
- <TD></TD>
- <TD colspan="3">
- <INPUT TYPE="text" NAME="telephone_box" value="<%=request.form("telephone_box")%>">
- </TD>
- </TR>
- <TR bgcolor="#555599">
- <td colspan="11" style="height:2px"></td>
- </TR>
- <TR>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_customer_name" onclick="check_customer_name_Click()" checked>
- </TD>
- <TD> </TD>
- <TD colspan="3">
- <INPUT TYPE="text" NAME="customer_name_box" value="<%=request.form("customer_name_box")%>">
- </TD>
- <TD>
- <INPUT TYPE="checkbox" NAME="check_order_title" onclick="check_order_title_Click()" checked>
- </TD>
- <TD> </TD>
- <TD colspan="3">
- <INPUT TYPE="text" NAME="order_title_box" value="<%=request.form("order_title_box")%>">
- </TD>
- </TR>
- <TR bgcolor="#555599">
- <td colspan="11" style="height:2px"></td>
- </TR>
- <TR bgcolor="#AAAAEE">
- <td colspan="11" style="height:30px">
- <TABLE align="center" width="50%">
- <TR>
- <TD><INPUT TYPE="submit" Name="Submit" Value="" style="font-family:tahoma,arial; font-size:10pt;width:100px;"></TD>
- <TD align="left"><INPUT TYPE="button" Name="Cancel" Value=" " style="font-family:tahoma,arial; font-size:10pt;width:100px;" onclick="window.location='?act=advancedSearch';"></TD>
- </TR>
- <TR>
- <TD align="left"> :</TD>
- <TD> <INPUT TYPE="Text" Name="resultsCount" value="<%=resultsCount%>" maxlength="4" size="4" onKeyPress="return maskNumber(this);"></TD>
- </TR>
- </TABLE>
- </td>
- </TR>
- </TABLE>
- </TD></TR>
- </FORM>
- </TABLE>
- <hr>
- <SCRIPT LANGUAGE='JavaScript'>
- <!--
- function check_sefaresh_Click(){
- if ( document.all.check_sefaresh.checked ) {
- document.all.az_sefaresh.style.visibility = "visible";
- document.all.ta_sefaresh.style.visibility = "visible";
- document.all.az_sefaresh.focus();
- }
- else{
- document.all.az_sefaresh.style.visibility = "hidden";
- document.all.ta_sefaresh.style.visibility = "hidden";
- }
- }
- function check_tarikh_sefaresh_Click(){
- if ( document.all.check_tarikh_sefaresh.checked ) {
- document.all.az_tarikh_sefaresh.style.visibility = "visible";
- document.all.ta_tarikh_sefaresh.style.visibility = "visible";
- document.all.az_tarikh_sefaresh.focus();
- }
- else{
- document.all.az_tarikh_sefaresh.style.visibility = "hidden";
- document.all.ta_tarikh_sefaresh.style.visibility = "hidden";
- }
- }
- function check_tarikh_tahvil_Click(){
- if ( document.all.check_tarikh_tahvil.checked ) {
- document.all.az_tarikh_tahvil.style.visibility = "visible";
- document.all.ta_tarikh_tahvil.style.visibility = "visible";
- document.all.az_tarikh_tahvil.focus();
- }
- else{
- document.all.az_tarikh_tahvil.style.visibility = "hidden";
- document.all.ta_tarikh_tahvil.style.visibility = "hidden";
- }
- }
- function check_company_name_Click(){
- if (document.all.check_company_name.checked) {
- document.all.company_name_box.style.visibility = "visible";
- document.all.company_name_box.focus();
- }
- else{
- document.all.company_name_box.style.visibility = "hidden";
- }
- }
- function check_customer_name_Click(){
- if (document.all.check_customer_name.checked) {
- document.all.customer_name_box.style.visibility = "visible";
- document.all.customer_name_box.focus();
- }
- else{
- document.all.customer_name_box.style.visibility = "hidden";
- }
- }
- function check_kind_Click(){
- if (document.all.check_kind.checked) {
- document.all.order_kind_box.style.visibility = "visible";
- document.all.order_kind_box.focus();
- }
- else{
- document.all.order_kind_box.style.visibility = "hidden";
- }
- }
- function check_marhale_Click(){
- if (document.all.check_marhale.checked) {
- document.all.marhale_box.style.visibility = "visible";
- document.all.marhale_box.focus();
- document.all.marhale_not_check.style.visibility = "visible";
- marhale_not_check_Click();
- }
- else{
- document.all.marhale_box.style.visibility = "hidden";
- document.all.marhale_not_check.style.visibility = "hidden";
- document.all.marhale_not_check_label.style.color='#BBBBBB'
- }
- }
- function check_salesperson_Click(){
- if (document.all.check_salesperson.checked) {
- document.all.salesperson_box.style.visibility = "visible";
- document.all.salesperson_box.focus();
- }
- else{
- document.all.salesperson_box.style.visibility = "hidden";
- }
- }
- function check_telephone_Click(){
- if (document.all.check_telephone.checked) {
- document.all.telephone_box.style.visibility = "visible";
- document.all.telephone_box.focus();
- }
- else{
- document.all.telephone_box.style.visibility = "hidden";
- }
- }
- function check_order_title_Click(){
- if (document.all.check_order_title.checked) {
- document.all.order_title_box.style.visibility = "visible";
- document.all.order_title_box.focus();
- }
- else{
- document.all.order_title_box.style.visibility = "hidden";
- }
- }
- function marhale_not_check_Click(){
- if (document.all.marhale_not_check.checked) {
- document.all.marhale_not_check_label.style.color='red'
- }
- else{
- document.all.marhale_not_check_label.style.color='#BBBBBB'
- }
- }
- function vazyat_not_check_Click(){
- if (document.all.vazyat_not_check.checked) {
- document.all.vazyat_not_check_label.style.color='red'
- }
- else{
- document.all.vazyat_not_check_label.style.color='#BBBBBB'
- }
- }
- function check_closed_Click(){
- if (document.all.check_closed.checked) {
- document.all.check_closed_label.style.color='black'
- }
- else{
- document.all.check_closed_label.style.color='#BBBBBB'
- }
- }
- function Form_Load(){
- <%
- maybeAND = ""
- myCriteria = ""
- If request.form("check_sefaresh") = "on" Then
- if request.form("az_sefaresh") <> "" then
- myCriteria = myCriteria & maybeAND & " Quotes.ID >= " & request.form("az_sefaresh")
- maybeAND=" AND "
- End If
- if request.form("ta_sefaresh") <> "" then
- myCriteria = myCriteria & maybeAND & " Quotes.ID <= " & request.form("ta_sefaresh")
- maybeAND=" AND "
- End If
- If (request.form("az_sefaresh") = "") AND (request.form("ta_sefaresh") = "") then
- response.write "document.all.check_sefaresh.checked = false;" & vbCrLf
- response.write "document.all.az_sefaresh.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.ta_sefaresh.style.visibility = 'hidden';" & vbCrLf
- End If
- Else
- response.write "document.all.check_sefaresh.checked = false;" & vbCrLf
- response.write "document.all.az_sefaresh.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.ta_sefaresh.style.visibility = 'hidden';" & vbCrLf
- End If
- If request.form("check_tarikh_sefaresh") = "on" Then
- if request.form("az_tarikh_sefaresh") <> "" then
- myCriteria = myCriteria & maybeAND & "order_date >= '" & request.form("az_tarikh_sefaresh") & "'"
- maybeAND=" AND "
- End If
- if request.form("ta_tarikh_sefaresh") <> "" then
- myCriteria = myCriteria & maybeAND & "order_date <= '" & request.form("ta_tarikh_sefaresh") & "'"
- maybeAND=" AND "
- End If
- If (request.form("az_tarikh_sefaresh") = "") AND (request.form("ta_tarikh_sefaresh") = "") then
- response.write "document.all.check_tarikh_sefaresh.checked = false;" & vbCrLf
- response.write "document.all.az_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.ta_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
- End If
- Else
- response.write "document.all.check_tarikh_sefaresh.checked = false;" & vbCrLf
- response.write "document.all.az_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.ta_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
- End If
- If request.form("check_tarikh_tahvil") = "on" Then
- if request.form("az_tarikh_tahvil") <> "" then
- myCriteria = myCriteria & maybeAND & "return_date >= '" & request.form("az_tarikh_tahvil") & "'"
- maybeAND=" AND "
- End If
- if request.form("ta_tarikh_tahvil") <> "" then
- myCriteria = myCriteria & maybeAND & "return_date <= '" & request.form("ta_tarikh_tahvil") & "'"
- maybeAND=" AND "
- End If
- If (request.form("az_tarikh_tahvil") = "") AND (request.form("ta_tarikh_tahvil") = "") then
- response.write "document.all.check_tarikh_tahvil.checked = false;" & vbCrLf
- response.write "document.all.az_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.ta_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
- End If
- Else
- response.write "document.all.check_tarikh_tahvil.checked = false;" & vbCrLf
- response.write "document.all.az_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.ta_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
- End If
- If (request.form("check_company_name") = "on" AND request.form("company_name_box") <> "" ) then
- myCriteria = myCriteria & maybeAND & "company_name Like N'%" & request.form("company_name_box") &"%'"
- maybeAND=" AND "
- Else
- response.write "document.all.check_company_name.checked = false;" & vbCrLf
- response.write "document.all.company_name_box.style.visibility = 'hidden';" & vbCrLf
- End If
- If (request.form("check_customer_name") = "on" AND request.form("customer_name_box") <> "")then
- myCriteria = myCriteria & maybeAND & "customer_name Like N'%" & request.form("customer_name_box") &"%'"
- maybeAND=" AND "
- Else
- response.write "document.all.check_customer_name.checked = false;" & vbCrLf
- response.write "document.all.customer_name_box.style.visibility = 'hidden';" & vbCrLf
- End If
- If request.form("check_kind") = "on" then
- myCriteria = myCriteria & maybeAND & "order_kind = N'" & request.form("order_kind_box") & "'"
- maybeAND=" AND "
- Else
- response.write "document.all.check_kind.checked = false;" & vbCrLf
- response.write "document.all.order_kind_box.style.visibility = 'hidden';" & vbCrLf
- End If
- If request("check_marhale") = "on" then
- If request("marhale_not_check") = "on" then
- myCriteria = myCriteria & maybeAND & "NOT(step = " & request("marhale_box") & ")"
- Else
- myCriteria = myCriteria & maybeAND & "step = " & request("marhale_box")
- response.write "document.all.marhale_not_check.checked = false;" & vbCrLf
- response.write "document.all.marhale_not_check_label.style.color='#BBBBBB';"& vbCrLf
- End If
- maybeAND=" AND "
- Else
- response.write "document.all.check_marhale.checked = false;" & vbCrLf
- response.write "document.all.marhale_box.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.marhale_not_check.style.visibility = 'hidden';" & vbCrLf
- response.write "document.all.marhale_not_check_label.style.color='#BBBBBB';"& vbCrLf
- End If
- If request.form("check_salesperson") = "on" then
- myCriteria = myCriteria & maybeAND & "salesperson = N'" & request.form("salesperson_box") & "'"
- maybeAND=" AND "
- Else
- response.write "document.all.check_salesperson.checked = false;" & vbCrLf
- response.write "document.all.salesperson_box.style.visibility = 'hidden';" & vbCrLf
- End If
- If (request.form("check_order_title") = "on" AND request.form("order_title_box") <> "")then
- myCriteria = myCriteria & maybeAND & "order_title Like N'%" & request.form("order_title_box") &"%'"
- maybeAND=" AND "
- Else
- response.write "document.all.check_order_title.checked = false;" & vbCrLf
- response.write "document.all.order_title_box.style.visibility = 'hidden';" & vbCrLf
- End If
- If (request.form("check_telephone") = "on" AND request.form("telephone_box") <> "")then
- myCriteria = myCriteria & maybeAND & "telephone Like N'%" & request.form("telephone_box") &"%'"
- maybeAND=" AND "
- Else
- response.write "document.all.check_telephone.checked = false;" & vbCrLf
- response.write "document.all.telephone_box.style.visibility = 'hidden';" & vbCrLf
- End If
- If request("check_closed") = "on" then
- myCriteria = myCriteria & maybeAND & "Quotes.Closed=0"
- Else
- If request("Submit")="" then
- response.write "document.all.check_closed.checked = false;" & vbCrLf
- response.write "document.all.check_closed_label.style.color='#BBBBBB';" & vbCrLf
- End If
- End If
- %>
- }
- function checkValidation(){
- return true;
- }
- Form_Load();
- //-->
- </SCRIPT>
- <%
- if request("Submit")="" then
- IF maybeAND <> " AND " THEN
- response.write "Nothing !!!!!!!!!!"
- ELSE
- mySQL= "SELECT Quotes.*, OrderTraceStatus.Name AS StatusName, OrderTraceStatus.Icon , Invoices.ID AS InvoiceID, Invoices.Approved, Invoices.Voided, Invoices.Issued, DRV_invoice.price "&_
- " FROM Quotes INNER JOIN "&_
- " OrderTraceStatus ON OrderTraceStatus.ID = Quotes.status LEFT OUTER JOIN "&_
- " Invoices INNER JOIN "&_
- " InvoiceQuoteRelations ON Invoices.ID = InvoiceQuoteRelations.Invoice ON Quotes.ID = InvoiceQuoteRelations.Quote "&_
- " left outer join (select Invoice,SUM(InvoiceLines.Price +InvoiceLines.Vat - InvoiceLines.Discount -InvoiceLines.Reverse) as price from InvoiceLines inner join Invoices on invoiceLines.invoice=invoices.id where invoices.voided=0 group by Invoice) DRV_invoice on Invoices.ID=DRV_invoice.Invoice "&_
- " WHERE ("& myCriteria & ") "&_
- " ORDER BY Quotes.order_date DESC, Quotes.ID DESC "
- ' mySQL= "SELECT Quotes.*, OrderTraceStatus.Name AS StatusName, OrderTraceStatus.Icon "&_
- ' " FROM Quotes JOIN OrderTraceStatus ON OrderTraceStatus.ID = Quotes.status "&_
- ' " WHERE ("& myCriteria & ") ORDER BY order_date DESC, Quotes.ID DESC"
- '
- 'response.write mySQL
- set RS1=Conn.Execute (mySQL)
- if not RS1.eof then
- tmpCounter=0
- %>
- <div align="center" dir="LTR">
- <TABLE border="1" cellspacing="0" cellpadding="1" dir="RTL" borderColor="#555588">
- <TR bgcolor="#CCCCFF">
- <TD width="41"># </TD>
- <TD width="46"> </TD>
- <TD width="56"> </TD>
- <TD width="116"> </TD>
- <TD width="106"> </TD>
- <TD > </TD>
- <TD width="36"></TD>
- <TD width="46"></TD>
- <TD width="36"> </TD>
- <TD width="40"></TD>
- <td width="50"></td>
- </TR>
- <% Do while not RS1.eof and tmpCounter < resultsCount
- tmpCounter = tmpCounter + 1
- if tmpCounter mod 2 = 1 then
- tmpColor="#FFFFFF"
- Else
- tmpColor="#DDDDDD"
- End If
- if RS1("Closed") then
- tmpStyle="background-color:#FFCCCC;"
- else
- tmpStyle=""
- End If
-
- if isnull(RS1("InvoiceID")) then
- InvoiceStatus="<span style='color:red;'><b></b></span>"
- else
- if RS1("Voided") then
- style="style='color:Red' Title=' '"
- elseif RS1("Issued") then
- style="style='color:Red' Title=' '"
- elseif RS1("Approved") then
- style="style='color:Green' Title=' '"
- else
- style="style='color:#3399FF' Title=' '"
- end if
- InvoiceStatus="<A " & style & " HREF='../AR/AccountReport.asp?act=showInvoice&invoice=" & RS1("InvoiceID")& "' Target='_blank'>" & RS1("InvoiceID") & "</A>"
- end if
- %>
- <TR bgcolor="<%=tmpColor%>" title="<%=RS1("StatusName")%>">
- <TD DIR="LTR"><A HREF="?act=show"e=<%=RS1("ID")%>" target="_blank"><%=RS1("ID")%></A></TD>
- <TD DIR="LTR"><%=RS1("order_date")%></TD>
- <TD DIR="LTR"><%=RS1("return_date") & " ("& RS1("return_time") & ")"%></TD>
- <TD ><%=RS1("company_name") & "<br>:("& RS1("telephone")& ")"%> </TD>
- <TD ><%=RS1("customer_name")%> </TD>
- <TD ><%=RS1("order_title")%> </TD>
- <TD ><%=RS1("order_kind")%></TD>
- <TD style="<%=tmpStyle%>"><%=RS1("marhale")%></TD>
- <TD ><%=RS1("salesperson")%> </TD>
- <TD ><%=InvoiceStatus%> </TD>
- <td><%if isnull(RS1("price")) then response.write "----" else response.write Separate(RS1("price")) end if %></td>
- </TR>
- <TR bgcolor="#FFFFFF">
- <TD colspan="12" style="height:10px"></TD>
- </TR>
- <% RS1.moveNext
- Loop
- if tmpCounter >= resultsCount then
- %> <TR bgcolor="#CCCCCC">
- <TD align="center" colspan="10" style="padding:15px;font-size:12pt;color:red;cursor:hand;" onclick="document.all.resultsCount.focus();"><B> <%=resultsCount%> .</B></TD>
- </TR>
- <% else
- %> <TR bgcolor="#ccccFF">
- <TD colspan="10"> : <%=tmpCounter%></TD>
- </TR>
- <% end if
- %>
- </TABLE>
- </div>
- <BR>
- <% else
- %> <TABLE border="1" cellspacing="0" cellpadding="0" dir="RTL" align="center" width="600">
- <TR bgcolor="#FFFFDD">
- <TD align="center" style="height:40px;font-size:12pt;font-weight:bold;color:red"> .</TD>
- </TR>
- </TABLE>
- <hr>
- <% End If
- End If
- End If
- ' Trace Quote End.
- '-----------------------------
- '-----------------------------
- ' Quote Input
- '-----------------------------
- elseif Request.QueryString("act")="quoteInpCustSearch" then
- if isnumeric(request("CustomerNameSearchBox")) then
- conn.close
- response.redirect "?act=getQuote&selectedCustomer=" & request("CustomerNameSearchBox")
- elseif request("CustomerNameSearchBox") <> "" then
- SA_TitleOrName=request("CustomerNameSearchBox")
- mySQL="SELECT * FROM Accounts WHERE (REPLACE(AccountTitle, ' ', '') LIKE REPLACE(N'%"& sqlSafe(SA_TitleOrName) & "%', ' ', '') ) ORDER BY AccountTitle"
- Set RS1 = conn.Execute(mySQL)
- if (RS1.eof) then
- conn.close
- response.redirect "?errmsg=" & Server.URLEncode(" .<br><a href='../CRM/AccountEdit.asp?act=getAccount'> Ͽ</a>")
- end if
- SA_TitleOrName=request("CustomerNameSearchBox")
- SA_Action="return true;"
- SA_SearchAgainURL="Inquiry.asp"
- SA_StepText=" : "
- %>
- <br>
- <FORM METHOD=POST ACTION="?act=getType">
- <!--#include File="../AR/include_SelectAccount.asp"-->
- </FORM>
- <%
- end if
- elseif Request.QueryString("act")="getType" then
- customerID=request("selectedCustomer")
- mySQL="SELECT * FROM Accounts WHERE (ID='"& CustomerID & "')"
- Set RS1 = conn.Execute(mySQL)
- if (RS1.eof) then
- conn.close
- response.redirect "?errmsg=" & Server.URLEncode(" .<br><a href='..//CRM/AccountEdit.asp?act=getAccount'> Ͽ</a>")
- end if
- %>
- <br>
- <div dir='rtl'>
- <B> : </B>
- </div>
- <form method="post" action="?act=getQuote">
- <input name="selectedCustomer" type="hidden" value="<%=customerID%>">
- <SELECT NAME="OrderType" style='font-family: tahoma,arial ; font-size: 9pt; font-weight: bold; width: 100px' tabIndex="7">
- <OPTION value="-1" style='color:red;'> </option>
- <%
- Set RS2 = conn.Execute("SELECT [User] as ID, DefaultOrderType FROM UserDefaults WHERE ([User] = "& session("ID") & ") OR (UserDefaults.[User] = 0) ORDER BY ABS(UserDefaults.[User]) DESC")
- defaultOrderType=RS2("DefaultOrderType")
- RS2.close
- Set RS2 = Nothing
- set RS_TYPE=Conn.Execute ("SELECT ID, Name FROM OrderTraceTypes WHERE (IsActive=1) ORDER BY ID")
- Do while not RS_TYPE.eof
- %>
- <OPTION value="<%=RS_TYPE("ID")%>" <%if RS_TYPE("ID")=defaultOrderType then response.write "selected"%>><%=RS_TYPE("Name")%></option>
- <%
- RS_TYPE.moveNext
- loop
- RS_TYPE.close
- set RS_TYPE = nothing
- %>
- </SELECT>
- <input type="submit" value="">
- </form>
- <%
- elseif Request.QueryString("act")="getQuote" then
- customerID=request("selectedCustomer")
- mySQL="SELECT * FROM Accounts WHERE (ID='"& CustomerID & "')"
- Set RS1 = conn.Execute(mySQL)
- if (RS1.eof) then
- conn.close
- response.redirect "?errmsg=" & Server.URLEncode(" .<br><a href='..//CRM/AccountEdit.asp?act=getAccount'> Ͽ</a>")
- end if
- rs1.close
- set rs1=nothing
- set rs=Conn.Execute("select * from OrderTraceTypes where id=" & request("orderType"))
- if rs.eof then
- conn.close
- response.redirect "?errmsg=" & server.urlEncode(" ")
- end if
- orderTypeID=rs("id")
- rs.close
- set rs=nothing
-
- %>
- <script type="text/javascript" src="calcOrder.js"></script>
- <script type="text/javascript">
- function checkValidation() {
- if ($('input[name="CustomerName"]').val().replace(/^\s*|\s*$/g,'')==''){
- alert(" ");
- $('input[name="CustomerName"]').focus();
- //$("input#Submit").prop("disabled",true);
- return false;
- } else if ($('input[name="SalesPerson"]').val().replace(/^\s*|\s*$/g,'')==''){
- alert(" ");
- $('input[name="SalesPerson"]').focus();
- //$("input#Submit").prop("disabled",true);
- return false;
- } else if ($('input[name="ReturnDate"]').val().replace(/^\s*|\s*$/g,'')==''){
- alert(" ");
- $('input[name="ReturnDate"]').focus();
- //$("input#Submit").prop("disabled",true);
- return false;
- } else if ($('input[name="ReturnTime"]').val().replace(/^\s*|\s*$/g,'')==''){
- alert(" () ");
- $('input[name="ReturnTime"]').focus();
- //$("input#Submit").prop("disabled",true);
- return false;
- } else if ($('input[name="OrderTitle"]').val().replace(/^\s*|\s*$/g,'')==''){
- alert(" ");
- $('input[name="OrderTitle"]').focus();
- //$("input#Submit").prop("disabled",true);
- return false;
- } else {
- return makeOutXML();
- }
- }
- TransformXmlURL("/service/xml_getOrderProperty.asp?act=getProperty&type=<%=orderTypeID%>","/xsl/orderEditProperty.xsl", function(result){
- $("#orderDetails").html(result);
- readyForm();
- });
- TransformXmlURL("/service/xml_getOrderProperty.asp?act=getNew&isOrder=&typeID=<%=orderTypeID%>&id=<%=CustomerID%>","/xsl/orderEditHeader.xsl", function(result){
- $("#orderHeader").html(result);
- });
- </script>
-
- <br>
- <div dir='rtl'><B> : </B>
- </div>
- <br>
- <!-- -->
- <hr>
- <FORM METHOD=POST ACTION="?act=submitQuote" onSubmit="return checkValidation();">
- <div id="orderHeader"></div>
- <div class="downBtn">
- <hr/>
- <INPUT TYPE="submit" id='Submit' Name="Submit" Value="" style="width:100px;" tabIndex="14">
- <INPUT TYPE="button" Name="Cancel" Value="" style="width:100px;" onClick="window.location='Inquiry.asp';" tabIndex="15">
- </div>
- </FORM>
- <div id='orderDetails'></div>
- <%
- set orderProp=nothing
- elseif Request.QueryString("act")="submitQuote" then
- //-------------------------------------------------------…