/beta/menu2.asp

http://github.com/khaneh/Orders · ASP · 252 lines · 191 code · 30 blank · 31 comment · 36 complexity · 4a70c1d2d136fb7b3e5f0bf49cf538f9 MD5 · raw file

  1. <!--#include file="config.asp" -->
  2. <%
  3. AppBgColor = "#BBBBBB" 'Other:"#99AACC"
  4. AppFgColor = "#C3DBEB" '"#DEEBD9"
  5. SelectedMenuColor = "#0E5499"
  6. UnSelectedMenuColor = "#309261"
  7. SelectedSubMenuColor = "#DEEBD9" '"#C3DBEB"
  8. UnSelectedSubMenuColor = "#0E5499" ' "#609250"
  9. TabWidth=65
  10. ImgTabSelected="/images/tab-1.gif"
  11. ImgTabNotSelected="/images/tab-2.gif"
  12. Function WriteMessagesStatus()
  13. result=""
  14. MySQL="SELECT (SELECT COUNT(*) AS CntTotal FROM Messages WHERE (MsgTo = '"& session("ID") & "') AND (IsRead = 0) AND (IsSmall = 0)) AS CntTotal, (SELECT COUNT(*) AS CntTotal FROM Messages WHERE (MsgTo = '"& session("ID") & "') AND (IsRead = 0) AND (IsSmall = 0) AND (Urgent = 2)) AS CntUrgent2, (SELECT COUNT(*) AS CntTotal FROM Messages WHERE (MsgTo = '"& session("ID") & "') AND (IsRead = 0) AND (IsSmall = 0) AND (Urgent = 3)) AS CntUrgent3"
  15. set tmpRS1=Conn.Execute (MySQL)
  16. if not tmpRS1.EOF then
  17. result="<A href='../home/default.asp?sub=1'><span style='font-size:10pt;color:#CCCCCC;'><FONT Face='wingdings'>*</FONT> (" & tmpRS1("CntTotal") & ") </span>"
  18. if tmpRS1("CntUrgent2")>0 then
  19. result = result & "<span style='font-size:10pt;color:yellow;'><FONT Face='wingdings'>*</FONT> (" & tmpRS1("CntUrgent2") & ") </span>"
  20. end if
  21. if tmpRS1("CntUrgent3")>0 then
  22. result = result & "<span style='font-size:10pt;color:#33FF99;'><FONT Face='wingdings'>*</FONT> (" & tmpRS1("CntUrgent3") & ") </span>"
  23. end if
  24. result = result & "</A>"
  25. else
  26. result = "&nbsp;"
  27. end if
  28. tmpRS1.close
  29. set tmpRS1 = Nothing
  30. '-------------------------------------- this added by sam--------------------------------------------------
  31. MySQL = "SELECT Extention FROM Users WHERE ID = " & session("ID")
  32. set tmpRS1 = Conn.Execute (MySQL)
  33. if not tmpRS1.EOF then
  34. dim xml
  35. set xml = server.CreateObject("MSXML2.ServerXMLHTTP")
  36. xml.open "GET", "https://192.168.0.9/test/getvmi.php?exten=" & tmpRS1("Extention"), false
  37. xml.SetOption(2) = 13056
  38. xml.send
  39. vmCount = xml.ResponseText
  40. set xml = Nothing
  41. if CInt(vmCount) > 0 then
  42. result = result & "<span style='font-size:10pt;color:red;'><FONT Face='wingdings'>*</FONT> (" & vmCount & ") </span>"
  43. end if
  44. end if
  45. tmpRS1.close
  46. '----------------------------------------------------------------------------------------------------------
  47. set tmpRS1 = nothing
  48. WriteMessagesStatus = result
  49. End Function
  50. %>
  51. <HTML>
  52. <HEAD>
  53. <meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
  54. <meta http-equiv="Content-Language" content="fa">
  55. <TITLE> <%=PageTitle%> </TITLE>
  56. <style>
  57. body { font-family: tahoma; font-size: 8pt;}
  58. body A { Text-Decoration : none ;}
  59. Input { font-family: tahoma; font-size: 9pt;}
  60. td { font-family: tahoma; font-size: 8pt;}
  61. .tt { font-family: tahoma; font-size: 10pt; color:yellow;}
  62. .tt2 { font-family: tahoma; font-size: 8pt; color:yellow;}
  63. .inputBut { font-family: tahoma; font-size: 8pt; richness: 10}
  64. .t7pt { font-size: 8pt;}
  65. .t8pt { font-size: 10pt;}
  66. .alak a { color: #cccccc; text-decoration: none; font-size: 10pt;}
  67. .alak2 a { color: black; text-decoration: none; font-size: 10pt; }
  68. .GenButton { font-family:tahoma; font-size: 9pt; border: 1px solid black; height:20px; }
  69. </style>
  70. </HEAD>
  71. <BODY bgcolor=<%=AppBgColor%> topmargin=0 leftmargin=0><!<% if onunload<>"" then %> onunload="<%=onunload%>"<% end if %> >
  72. <TABLE topmargin=0 leftmargin=0 align=center width=760 border=0>
  73. <TR>
  74. <TD align=LEFT><%=session("OpenGLName")%> - <% if session("differentGL") then%> <FONT SIZE="" COLOR="yellow"><B> </B></FONT><% end if %></TD>
  75. <TD align=right> <%=session("CSRName")%> </TD>
  76. </TR>
  77. </TABLE><%
  78. if application("syslock") <> "" and application("syslock") <> session("id") then
  79. response.write "<BR><BR><BR><BR><BR><CENTER><H1> "& application("syslockerName") & " </H1></CENTER>"
  80. response.end
  81. end if
  82. if menuItem="0" then
  83. rootLink="../"
  84. else
  85. rootLink="../"
  86. end if
  87. CSRName = session("CSRName")
  88. %>
  89. <BR>
  90. <TABLE cellspacing=0 cellpadding=0 width=760 border=0 dir=rtl align=center>
  91. <TR >
  92. <TD>
  93. <TABLE cellspacing=0 cellpadding=0>
  94. <TR height=30 class="alak">
  95. <%if Auth(0 , 0) then %>
  96. <%if menuItem="0" then %>
  97. <TD class=tt width="<%=TabWidth%>" align=center background='<%=ImgTabSelected%>'> </TD>
  98. <%else %>
  99. <TD class=tt width="<%=TabWidth%>" align=center background='<%=ImgTabNotSelected%>' ><A HREF='<%=rootLink%>home'> </A></TD>
  100. <%end if %>
  101. <%end if %>
  102. <%if Auth(1 , 0) then %>
  103. <%if menuItem="1" then %>
  104. <TD class="tt2" width="<%=TabWidth%>" align=center background='<%=ImgTabSelected%>'> <br> </TD>
  105. <%else %>
  106. <TD class="tt2" width="<%=TabWidth%>" align=center background='<%=ImgTabNotSelected%>' ><A style='font-size:8pt;' HREF='<%=rootLink%>CRM/AccountInfo.asp?act=search'> <br> </A></TD>
  107. <%end if %>
  108. <%end if %>
  109. <%if Auth(2 , 0) then %>
  110. <%if menuItem="2" then %>
  111. <TD class=tt2 width="<%=TabWidth%>" align=center background='<%=ImgTabSelected%>'></TD>
  112. <%else %>
  113. <TD class=tt2 width="<%=TabWidth%>" align=center background='<%=ImgTabNotSelected%>' ><A style='font-size:8pt;' HREF='<%=rootLink%>order/orderInput.asp'></A></TD>
  114. <%end if %>
  115. <%end if %>
  116. <%if Auth(3 , 0) then %>
  117. <%if menuItem="3" then %>
  118. <TD class=tt width="<%=TabWidth%>" align=center background='<%=ImgTabSelected%>'></TD>
  119. <%else %>
  120. <TD class=tt width="<%=TabWidth%>" align=center background='<%=ImgTabNotSelected%>' ><A HREF='<%=rootLink%>shopfloor'></A></TD>
  121. <%end if %>
  122. <%end if %>
  123. <%if Auth(4 , 0) then %>
  124. <%if menuItem="4" then %>
  125. <TD class=tt width="<%=TabWidth%>" align=center background='<%=ImgTabSelected%>'></TD>
  126. <%else %>
  127. <TD class=tt width="<%=TabWidth%>" align=center background='<%=ImgTabNotSelected%>' ><A HREF='<%=rootLink%>purchase'></A></TD>
  128. <%end if %>
  129. <%end if %>
  130. <%if Auth(5 , 0) then %>
  131. <%if menuItem="5" then %>
  132. <TD class=tt width="<%=TabWidth%>" align=center background='<%=ImgTabSelected%>'></TD>
  133. <%else %>
  134. <TD class=tt width="<%=TabWidth%>" align=center background='<%=ImgTabNotSelected%>' ><A HREF='<%=rootLink%>inventory'></A></TD>
  135. <%end if %>
  136. <%end if %>
  137. <%if Auth(6 , 0) then %>
  138. <%if menuItem="6" then %>
  139. <TD class=tt2 width="<%=TabWidth%>" align=center background='<%=ImgTabSelected%>'> </TD>
  140. <%else %>
  141. <TD class=tt2 width="<%=TabWidth%>" align=center background='<%=ImgTabNotSelected%>' ><A style='font-size:8pt;' HREF='<%=rootLink%>AR/Invoice.asp'> </A></TD>
  142. <%end if %>
  143. <%end if %>
  144. <%if Auth(7 , 0) then %>
  145. <%if menuItem="7" then %>
  146. <TD class=tt2 width="<%=TabWidth%>" align=center background='<%=ImgTabSelected%>'> </TD>
  147. <%else %>
  148. <TD class=tt2 width="<%=TabWidth%>" align=center background='<%=ImgTabNotSelected%>' ><A style='font-size:8pt;' HREF='<%=rootLink%>AP/voucherInput.asp'> </A></TD>
  149. <%end if %>
  150. <%end if %>
  151. <%if Auth("B" , 0) then %>
  152. <%if menuItem="B" then %>
  153. <TD class=tt2 width="<%=TabWidth%>" align=center background='<%=ImgTabSelected%>'> </TD>
  154. <%else %>
  155. <TD class=tt2 width="<%=TabWidth%>" align=center background='<%=ImgTabNotSelected%>' ><A style='font-size:8pt;' HREF='<%=rootLink%>AO/AccountReport.asp?act=search'> </A></TD>
  156. <%end if %>
  157. <%end if %>
  158. <%if Auth(8 , 0) then %>
  159. <%if menuItem="8" then %>
  160. <TD class=tt2 width="<%=TabWidth%>" align=center background='<%=ImgTabSelected%>'></TD>
  161. <%else %>
  162. <TD class=tt2 width="<%=TabWidth%>" align=center background='<%=ImgTabNotSelected%>' ><A style='font-size:8pt;' HREF='<%=rootLink%>accounting/GLMemoInput.asp'></A></TD>
  163. <%end if %>
  164. <%end if %>
  165. <%if Auth(9 , 0) then %>
  166. <%if menuItem="9" then %>
  167. <TD class=tt width="<%=TabWidth%>" align=center background='<%=ImgTabSelected%>'></TD>
  168. <%else %>
  169. <TD class=tt width="<%=TabWidth%>" align=center background='<%=ImgTabNotSelected%>' ><A HREF='<%=rootLink%>cashReg/ReceiptInput.asp'></A></TD>
  170. <%end if %>
  171. <%end if %>
  172. <%if Auth("A" , 0) then %>
  173. <%if menuItem="A" then %>
  174. <TD class=tt width="<%=TabWidth%>" align=center background='<%=ImgTabSelected%>'></TD>
  175. <%else %>
  176. <TD class=tt width="<%=TabWidth%>" align=center background='<%=ImgTabNotSelected%>' ><A HREF='<%=rootLink%>bank/cheq.asp'></A></TD>
  177. <%end if %>
  178. <%end if %>
  179. </TR>
  180. </TABLE>
  181. </TD>
  182. </TR>
  183. <TR BGCOLOR="<%=SelectedMenuColor%>">
  184. <TD height=20>
  185. <div id="MessagesStatusPanel">
  186. <%=WriteMessagesStatus()%>
  187. </div>
  188. <%
  189. ' --- LOGGING
  190. ' if not DONT_LOG_THIS then
  191. ' function pad (inpStr,padSize)
  192. ' result = inpStr
  193. ' while len(result) < padSize
  194. ' result = "0" & result
  195. ' wend
  196. ' pad = result
  197. ' end function
  198. '
  199. '
  200. ' rform = sqlSafe(request.form)
  201. ' rquerystring = sqlSafe(request.querystring)
  202. '
  203. ' tmpDate = date()
  204. ' tmpTime = time()
  205. ' rdate = year(tmpDate) & "/" & pad(Month(tmpDate),2) & "/" & pad(Day(tmpDate),2)
  206. ' rtime = hour(tmpTime) & ":" & minute(tmpTime) & ":" & second(tmpTime)
  207. ' httpReferer = sqlSafe(Request.ServerVariables("HTTP_REFERER"))
  208. ' clientIP = Request.ServerVariables("REMOTE_ADDR")
  209. ' rURL = Request.ServerVariables("URL")
  210. ' errBy = session("id")
  211. '
  212. ' errSQL = "INSERT INTO useageLog (errDate, errTime, errBy, url, httpReferer, clientIP, requestForm, requestQuerystring) VALUES ('" & rdate & "','" & rtime & "'," & errBy & ",'" & rURL & "' ,N'" & httpReferer & "','" & clientIP & "','" & left(rform,500) & "','" & rquerystring & "')"
  213. '
  214. ' Conn.Execute errSQL
  215. '
  216. ' end if
  217. ' --- LOGGING end
  218. %>
  219. </TD>
  220. </TR>
  221. <TR >
  222. <TD >