PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

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