/beta/home/default_old.asp

http://github.com/khaneh/Orders · ASP · 273 lines · 253 code · 9 blank · 11 comment · 23 complexity · 71e7c844b979a69b8b5c36beff2219f9 MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2. 'Home (0)
  3. session("id")=6
  4. PageTitle= " "
  5. SubmenuItem=1
  6. if not Auth(0 , 1) then NotAllowdToViewThisPage()
  7. captionFGColor = "#C6C6D7"
  8. captionBGColor = "#F4F4FE"
  9. MsgBodyColor = "#F4F4FE" '"#FFFFEE"
  10. UrgentMsgBodyColor = "#FFDDDD"
  11. VeryUrgentMsgBodyColor = "yellow"
  12. OrderReadyMsgBodyColor = "#33FF99" '#00CCFF
  13. VeryUrgentMsgScrlColor = "#FFFFCC"
  14. MsgMainColor = "#FFFFFF"
  15. %>
  16. <!--#include file="top.asp" -->
  17. <!--#include File="../include_farsiDateHandling.asp"-->
  18. <!--#include File="../include_JS_InputMasks.asp"-->
  19. <style>
  20. .scrollOrderReady {
  21. scrollbar-3dlight-color: <%=captionFGColor%>;
  22. scrollbar-arrow-color: <%=captionFGColor%>;
  23. scrollbar-base-color: <%=captionFGColor%>;
  24. scrollbar-darkshadow-color: <%=captionFGColor%>;
  25. scrollbar-face-color: <%=OrderReadyMsgBodyColor%>;
  26. scrollbar-highlight-color: <%=OrderReadyMsgBodyColor%>;
  27. scrollbar-shadow-color: <%=captionFGColor%>
  28. width:170; height:160; overflow:auto;
  29. }
  30. .scrollNorm {
  31. scrollbar-3dlight-color: <%=captionFGColor%>;
  32. scrollbar-arrow-color: <%=captionFGColor%>;
  33. scrollbar-base-color: <%=captionFGColor%>;
  34. scrollbar-darkshadow-color: <%=captionFGColor%>;
  35. scrollbar-face-color: <%=MsgMainColor%>;
  36. scrollbar-highlight-color: <%=MsgMainColor%>;
  37. scrollbar-shadow-color: <%=captionFGColor%>
  38. width:170; height:160; overflow:auto;
  39. }
  40. .scrollUrg {
  41. scrollbar-3dlight-color: <%=MsgMainColor%>;
  42. scrollbar-arrow-color: <%=MsgMainColor%>;
  43. scrollbar-base-color: <%=MsgMainColor%>;
  44. scrollbar-darkshadow-color: <%=MsgMainColor%>;
  45. scrollbar-face-color: <%=UrgentMsgBodyColor%>;
  46. scrollbar-highlight-color: <%=UrgentMsgBodyColor%>;
  47. scrollbar-shadow-color: <%=MsgMainColor%>
  48. width:170; height:160; overflow:auto;
  49. }
  50. .scrollSpec {
  51. scrollbar-3dlight-color: <%=MsgMainColor%>;
  52. scrollbar-arrow-color: <%=MsgMainColor%>;
  53. scrollbar-base-color: <%=MsgMainColor%>;
  54. scrollbar-darkshadow-color: <%=MsgMainColor%>;
  55. scrollbar-face-color: <%=VeryUrgentMsgScrlColor%>;
  56. scrollbar-highlight-color: <%=VeryUrgentMsgScrlColor%>;
  57. scrollbar-shadow-color: <%=MsgMainColor%>
  58. width:170; height:160; overflow:auto;
  59. }
  60. .ArchiveDiv {
  61. scrollbar-3dlight-color: <%=captionBGColor%>;
  62. scrollbar-arrow-color: <%=captionBGColor%>;
  63. scrollbar-base-color: <%=captionBGColor%>;
  64. scrollbar-darkshadow-color: <%=captionBGColor%>;
  65. scrollbar-face-color: <%=captionFGColor%>;
  66. scrollbar-highlight-color: <%=captionBGColor%>;
  67. scrollbar-shadow-color: <%=captionBGColor%>
  68. width:180; height:400; overflow:auto;
  69. }
  70. .captionBut {
  71. border: solid 1pt white;
  72. cursor:hand;
  73. background-color: <%=captionFGColor%>;
  74. width:10
  75. }
  76. .captionBut a { text-decoration:none; color: black;}
  77. </style>
  78. <center>
  79. <BR><BR>
  80. <TABLE>
  81. <TR>
  82. <TD valign=top>
  83. <TABLE width=530 border=0 align=center cellpadding=0 cellspacing=6>
  84. <TR>
  85. <TD colspan='3' height='1'></TD>
  86. </TR>
  87. <TR>
  88. <%
  89. if request("act") = "close" then
  90. MySQL = "UPDATE Messages SET IsRead = 1 WHERE (id = "& request("id") & ")"
  91. conn.Execute (MySQL)
  92. end if
  93. if request("act") = "minimize" then
  94. MySQL = "UPDATE Messages SET IsSmall = 1 WHERE (id = "& request("id") & ")"
  95. conn.Execute (MySQL)
  96. end if
  97. if request("act") = "mazimize" then
  98. MySQL = "UPDATE Messages SET IsSmall = 0 WHERE (id = "& request("id") & ")"
  99. conn.Execute (MySQL)
  100. end if
  101. '--------------------------------------------------------------------------------
  102. '--------------------------------------------------------------------------------
  103. '--------------------------------------------------------------------------------
  104. '--------------------------------------------------------------------------------
  105. MySQL = "SELECT * FROM Messages WHERE (MsgTo = "& session("id") & ") and (IsRead = 0) and (IsSmall = 0) order by id DESC"
  106. set RSM = conn.Execute (MySQL)
  107. cnt = 0
  108. Do While Not (RSM.eof)
  109. set RSV=Conn.Execute ("SELECT RealName FROM Users where ID=" & RSM("MsgFrom"))
  110. %>
  111. <TD valign=top bgcolor=<% if RSM("Urgent")=0 then %><%=MsgMainColor%><% elseif RSM("Urgent")=2 then %><%=VeryUrgentMsgBodyColor%><% elseif RSM("Urgent")=3 then %><%=OrderReadyMsgBodyColor%><% else %><%=UrgentMsgBodyColor%><% end if %> width=170 height=170 bgcolor=white style='border: solid 1pt black '>
  112. <div>
  113. <div style=" height:10;position: relative; top:0; left:0">
  114. <TABLE cellpadding=0 cellspacing=0 width=100% >
  115. <TR height=5 bgcolor=<%=captionBGColor%>>
  116. <TD title="" class="captionBut"><A class="" onclick="return confirm(' Ͽ')" HREF="default.asp?act=close&id=<%=RSM("id")%>"> X </A></TD>
  117. <TD title="" class="captionBut"><A HREF="default.asp?act=minimize&id=<%=RSM("id")%>">&nbsp;v </A></TD>
  118. <TD align=left valign=top width=15><FONT COLOR="<%=SelectedMenuColor%>">: </FONT></TD>
  119. <TD align=right valign=top width=75><div style="width:75px; text-overflow : ellipsis; overflow : hidden;"><NOBR>&nbsp; <%=RSV("RealName")%></NOBR></div></TD>
  120. <TD class="captionBut"><A HREF="message.asp?act=reply&id=<%=RSM("id")%>&retURL=<%=Server.URLEncode("default.asp")%>"></a></TD>
  121. <TD class="captionBut"><A HREF="message.asp?act=forward&id=<%=RSM("id")%>&retURL=<%=Server.URLEncode("default.asp")%>"></a></TD>
  122. </TR>
  123. <TR height=1 bgcolor=black>
  124. <td colspan=6></td>
  125. </TR>
  126. </TABLE>
  127. </div>
  128. <div <% if RSM("Urgent")=0 then %>class="scrollNorm"<% elseif RSM("Urgent")=1 then %>class="scrollUrg"<% elseif RSM("Urgent")=2 then %>class="scrollSpec"<% elseif RSM("Urgent")=3 then %>class="scrollOrderReady"<% end if %>">
  129. <TABLE cellpadding=0 cellspacing=0 width=100% border=0>
  130. <TR>
  131. </TR>
  132. <% if RSM("Urgent")=2 then %>
  133. <TR>
  134. <TD align=center colspan=2> <FONT size=5 COLOR="<%=SelectedMenuColor%>"> </FONT>
  135. <hr noshade style="height:1"></TD>
  136. </TR>
  137. <% end if %>
  138. <TR>
  139. <TD align=left valign=top width=45> <FONT COLOR="<%=SelectedMenuColor%>">: </FONT></TD>
  140. <TD align=right valign=top width=125>&nbsp; <span dir=ltr><%=RSM("MsgDate")%></span></TD>
  141. </TR>
  142. <TR>
  143. <TD align=left valign=top width=45> <FONT COLOR="<%=SelectedMenuColor%>">: </FONT></TD>
  144. <TD align=right valign=top width=125>&nbsp; <%=RSM("MsgTime")%></TD>
  145. </TR>
  146. <% if NOT RSM("IsReply")=0 and not RSM("replyTo")=0 then %>
  147. <TR>
  148. <TD align=left class="" valign=top width=45> <FONT COLOR="<%=SelectedMenuColor%>">:</FONT></TD>
  149. <%
  150. MySQL = "SELECT MsgBody FROM Messages WHERE (id = "& RSM("replyTo") & ")"
  151. set RSO = conn.Execute (MySQL)
  152. if not RSO.eof then
  153. %>
  154. <TD align=right valign=top width=125>
  155. <TEXTAREA NAME="" ROWS="1" readonly COLS="25" style="font-family: tahoma; font-size: 7pt; border: none; background: transparent" title="<%=RSO("MsgBody")%>"><%=RSO("MsgBody")%></TEXTAREA>
  156. </TD>
  157. </TR>
  158. <%
  159. end if
  160. RSO.close
  161. end if
  162. if RSM("RelatedTable")<>"NaN" and RSM("RelatedID")<>"0" then %>
  163. <TR>
  164. <TD align=left valign=top width=45> <FONT COLOR="<%=SelectedMenuColor%>">: </FONT> </TD>
  165. <TD align=right valign=top width=125><%
  166. RelatedTable = "NaN"
  167. if trim(RSM("RelatedTable")) = "orders" then
  168. RelatedTable=" "
  169. RelatedLink = "../order/TraceOrder.asp?act=show&order=" & RSM("RelatedID")
  170. elseif trim(RSM("RelatedTable")) = "accounts" then
  171. RelatedTable=" "
  172. RelatedLink = "../CRM/AccountInfo.asp?act=show&SelectedCustomer="& RSM("RelatedID")
  173. elseif trim(RSM("RelatedTable")) = "invoices" then
  174. RelatedTable=" "
  175. RelatedLink = "../AR/AccountReport.asp?act=showInvoice&invoice=" & RSM("RelatedID")
  176. end if
  177. %> <A HREF="<%=RelatedLink%>" target="_blank"><%=RelatedTable%> <%=RSM("RelatedID")%></A> </TD>
  178. </TR>
  179. <% end if %>
  180. <TR height=3>
  181. <TD align=right colspan=2>
  182. <hr noshade style="height:1">
  183. </TD>
  184. </TR>
  185. <TR>
  186. <TD align=right colspan=2>
  187. <%=replace(RSM("MsgBody"),chr(13),"<br>")%>
  188. </TD>
  189. </TR>
  190. </TABLE>
  191. </div>
  192. </div>
  193. </TD>
  194. <%
  195. cnt = cnt + 1
  196. if cnt mod 3 = 0 then
  197. response.write "</tr><tr>"
  198. end if
  199. RSM.MoveNext
  200. Loop
  201. RSM.close
  202. %>
  203. <td valign=top>
  204. </td>
  205. </TR>
  206. </TABLE>
  207. </TD>
  208. <TD valign=top>
  209. <TABLE width=170 border=0 align=center cellpadding=0 cellspacing=6 >
  210. <TR height=100% >
  211. <TD width=170 valign=top height=100% style="border-right: 2pt dashed; border-top: 2pt dashed; border-color: white" >
  212. <CENTER style="background-color:<%=captionFGColor%>"> </CENTER>
  213. <div class="ArchiveDiv">
  214. <table cellpadding=0 cellspacing=4 >
  215. <%
  216. '--------------------------------------------------------------------------------
  217. '--------------------------------------------------------------------------------
  218. '--------------------------------------------------------------------------------
  219. '--------------------------------------------------------------------------------
  220. MySQL = "SELECT * FROM Messages WHERE (MsgTo = "& session("id") & ") and (IsRead = 0) and (IsSmall = 1) order by id DESC"
  221. set RSM = conn.Execute (MySQL)
  222. cnt2 = 0
  223. Do While Not (RSM.eof)
  224. set RSV=Conn.Execute ("SELECT RealName FROM Users where ID=" & RSM("MsgFrom"))
  225. %>
  226. <tr valign=top><TD valign=top bgcolor=<% if RSM("Urgent")=0 then %><%=MsgMainColor%><% elseif RSM("Urgent")=2 then %><%=VeryUrgentMsgBodyColor%><% elseif RSM("Urgent")=3 then %><%=OrderReadyMsgBodyColor%><% else %><%=UrgentMsgBodyColor%><% end if %> width=170 height=40 bgcolor=white style='border: solid 1pt black '>
  227. <TABLE cellpadding=0 cellspacing=0 width=100% title="<%=replace(RSM("MsgBody"),"""","`")%>" >
  228. <TR height=5 bgcolor=<%=captionBGColor%>>
  229. <A onclick="return confirm(' Ͽ')" HREF="default.asp?act=close&id=<%=RSM("id")%>"><TD class="captionBut"> X</TD></A>
  230. <A HREF="default.asp?act=mazimize&id=<%=RSM("id")%>"><TD class="captionBut">^</TD></A>
  231. <TD align=right valign=top width=200> &nbsp;<%=RSV("RealName")%> </TD>
  232. <TD align=left valign=top width=60><span dir=ltr><%=RSM("msgDate")%></span></TD>
  233. </TR>
  234. <TR height=1 bgcolor=black>
  235. <td colspan=5></td>
  236. </TR>
  237. <TR >
  238. <td colspan=5 ><INPUT readonly TYPE="text" size=35 style="font-family:tahoma; font-size:10; background: transparent; border: solid 0pt " value="<%=replace(left(RSM("MsgBody"),50),"""","`")%>"></td>
  239. </TR>
  240. </TABLE>
  241. </TD></tr>
  242. <%
  243. cnt2 = cnt2 + 1
  244. if cnt2 mod 4 = 0 then
  245. 'response.write "</table></td><td valign=top><table cellpadding=0 cellspacing=4>"
  246. cnt = cnt + 1
  247. if cnt mod 4 = 0 then
  248. 'response.write "</table></td></tr><tr><td valign=top><table cellpadding=0 cellspacing=4>"
  249. end if
  250. end if
  251. RSM.MoveNext
  252. Loop
  253. RSM.close
  254. %>
  255. </table>
  256. </div>
  257. </TD>
  258. </td>
  259. </TR>
  260. </TABLE>
  261. </TD>
  262. </TR>
  263. </TABLE>
  264. <!--#include file="tah.asp" -->