PageRenderTime 26ms CodeModel.GetById 15ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/beta/inventory/editItem.asp

http://github.com/khaneh/Orders
ASP | 527 lines | 443 code | 44 blank | 40 comment | 39 complexity | 508056a099c563023bf59ddc152c3c08 MD5 | raw file
  1<%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2'Inventory (5)
  3PageTitle= " ����� ����"
  4SubmenuItem=6
  5if not Auth(5 , 6) then NotAllowdToViewThisPage()
  6
  7%>
  8<!--#include file="top.asp" -->
  9<!--#include File="../include_farsiDateHandling.asp"-->
 10<!--#include File="../include_JS_InputMasks.asp"-->
 11<%
 12'-----------------------------------------------------------------------------------------------------
 13'------------------------------------------------------------------------------ Update Item Properties
 14'-----------------------------------------------------------------------------------------------------
 15if request("act")="editPrice" then
 16
 17	StartDate		= SqlSafe(request.form("StartDate"))
 18	EndDate			= SqlSafe(request.form("EndDate"))
 19	UnitPrice		= cdbl(text2value(request.form("UnitPrice")))
 20	autoKey			= cdbl(text2value(request.form("autoKey")))
 21	InventoryItem	= cdbl(text2value(request.form("InventoryItem")))
 22
 23	CreatedDate		= shamsiToday()
 24	CreatedTime		= currentTime10()
 25	CreatedBy		= session("ID")
 26
 27	if UnitPrice=0 then
 28		response.write "<br><br>"				
 29		call showAlert ("���!<br><br>���� �� ���� ����� ���.",CONST_MSG_ERROR) 
 30		response.end
 31	end if
 32
 33	sql = "SELECT * FROM InventoryItemsUnitPrice WHERE (((StartDate <= '" & StartDate & "') AND (EndDate >= '" & StartDate & "')) OR ((StartDate <= '" & EndDate & "') AND (EndDate >= '" & EndDate & "')) OR ((StartDate >= '" & StartDate & "') AND (EndDate <= '" & EndDate & "')) ) AND (InventoryItem ='" & InventoryItem & "') AND (autoKey <> '" & autoKey & "')"
 34	set RS = conn.Execute (sql)
 35	if not RS.eof then
 36		response.redirect "?itemDetail=" & InventoryItem & "&errMsg=" & Server.URLEncode("���!<br><b>���� ����� ����� ����.</b><br><br>���� ���� � [ " & replace(RS("StartDate"),"/",".") & " �� " & replace(RS("EndDate"),"/",".") & "] ���� ��� ���. <br> ��� [ " & replace(StartDate,"/",".") & " �� " & replace(EndDate,"/",".") & "] ���� ���� ���.")
 37	end if
 38	RS.close
 39
 40	if autoKey > 0 then
 41		sql = "UPDATE InventoryItemsUnitPrice SET InventoryItem ='" & InventoryItem & "', UnitPrice ='" & UnitPrice & "', StartDate ='" & StartDate & "', EndDate ='" & EndDate & "', CreatedBy ='" & CreatedBy & "', CreatedDate ='" & CreatedDate & "', CreatedTime ='" & CreatedTime & "' WHERE (autoKey='" & autoKey & "')"
 42	else
 43		sql ="INSERT INTO InventoryItemsUnitPrice (InventoryItem, UnitPrice, StartDate, EndDate, CreatedBy, CreatedDate, CreatedTime) VALUES ('" & InventoryItem & "', '" & UnitPrice & "', '" & StartDate & "', '" & EndDate & "', '" & CreatedBy & "', '" & CreatedDate & "', '" & CreatedTime & "')"
 44	end if
 45	
 46	conn.execute(sql)
 47
 48	conn.close
 49	response.redirect "?itemDetail=" & InventoryItem & "&msg=" & Server.URLEncode("���� ��� ��.")
 50
 51
 52elseif request("submit")="��� ������ ����"then
 53
 54	id				= request.form("id") 
 55	oldQtty			= request.form("oldQtty") 
 56	qtty			= request.form("qtty") 
 57	Unit			= request.form("Unit") 
 58	comments		= request.form("comments") 
 59	ItemName		= request.form("ItemName") 
 60
 61	if cdbl(oldQtty) < cdbl(qtty) then
 62		'---------------------- Increase Item Qtty by Hand
 63		'---------------------- RelatedID = -2 , type = 2
 64		qttyUp = qtty - oldQtty
 65		mySql="INSERT INTO InventoryLog (ItemID, RelatedID, logDate, Qtty, owner, CreatedBy, IsInput, type, comments) VALUES ("& id & ", -2 ,N'"& shamsiToday() & "', "& qttyUp & ", -1 , "& session("id") & ", 1 , 2, N'"& comments & "')"
 66		conn.Execute mySql
 67		response.write "<BR><BR><BR><CENTER><li> ������ ������ "& ItemName & " �� ����� " & qttyUp& "&nbsp;"&Unit&" ����� ��</CENTER>"
 68	end if
 69	
 70	if cdbl(oldQtty) > cdbl(qtty) then
 71		'---------------------- Decrease Item Qtty by Hand
 72		'---------------------- RelatedID = -2 , type = 2
 73		qttyDown = oldQtty - qtty
 74		mySql = "INSERT INTO InventoryLog (ItemID, RelatedID, Qtty, logDate, owner, CreatedBy, IsInput, type, comments) VALUES ("& ID & ",-2,"& qttyDown& ",N'"& shamsiToday() & "', -1 ,"& session("ID") & ", 0, 2, N'"& comments & "')"
 75		conn.Execute mySql
 76		response.write "<BR><BR><BR><CENTER><li> ���� ������ "& ItemName & " �� ����� " & qttyDown & "&nbsp;"&Unit&" ����� ��</CENTER>"
 77	end if
 78
 79'-----------------------------------------------------------------------------------------------------
 80'------------------------------------------------------------------------------ Update Item Properties
 81'-----------------------------------------------------------------------------------------------------
 82elseif request("submit")="��� ������ ����"then
 83
 84	oldCatID		= request.form("oldCatID") 
 85	id				= request.form("id") 
 86	catItem			= request.form("catItem") 
 87	ItemName		= request.form("ItemName") 
 88	OldItemID		= request.form("OldItemID") 
 89	ownerAcc		= request.form("ownerAcc") 
 90	costingMethod	= request.form("cost") 
 91	Minim			= request.form("Minim") 
 92	oldQtty			= request.form("oldQtty") 
 93	qtty			= request.form("qtty") 
 94	Unit			= request.form("Unit") 
 95	outByOrder		= request.form("outByOrder")
 96	EditDate		= shamsiToday()
 97	EditBy			= session("ID")
 98
 99	if outByOrder="on" then
100		outByOrder = 1
101	else
102		outByOrder =0
103	end if
104
105
106	if cdbl(oldQtty) < cdbl(qtty) then
107		'---------------------- Request to Increase Item Qtty by Hand
108		qttyUp = qtty - oldQtty
109		response.write "<center><br><br>"
110		response.write "<li>��� �� ��� ������ ������ <b> "& ItemName & " </b> �� ����� <b>" & qttyUp& "&nbsp;"&Unit & " </b> �����.<br><br> ���� ���� ��� ����� ������ �� ���� ����:" 
111		%>
112		<FORM METHOD=POST ACTION="">
113			<INPUT TYPE="hidden" name="id" value="<%=id%>">
114			<INPUT TYPE="hidden" name="oldQtty" value="<%=oldQtty%>">
115			<INPUT TYPE="hidden" name="qtty" value="<%=qtty%>">
116			<INPUT TYPE="hidden" name="ItemName" value="<%=ItemName%>">
117			<INPUT TYPE="hidden" name="Unit" value="<%=Unit%>">
118			<TEXTAREA NAME="comments" ROWS="5" COLS="20"></TEXTAREA><BR><BR>
119			<INPUT TYPE="submit" name="submit" value="��� ������ ����">
120		</FORM>
121		</center>
122		<%
123	end if
124	
125	if cdbl(oldQtty) > cdbl(qtty) then
126		'---------------------- Request to Decrease Item Qtty by Hand
127		qttyDown = oldQtty - qtty
128		response.write "<center><br><br>"
129		response.write "<li>��� �� ��� ���� ������ <b> "& ItemName & " </b> �� ����� <b>" & qttyDown& "&nbsp;"&Unit & " </b> �����.<br><br> ���� ���� ��� ����� ������ �� ���� ����:" 
130		%>
131		<FORM METHOD=POST ACTION="">
132			<INPUT TYPE="hidden" name="id" value="<%=id%>">
133			<INPUT TYPE="hidden" name="oldQtty" value="<%=oldQtty%>">
134			<INPUT TYPE="hidden" name="qtty" value="<%=qtty%>">
135			<INPUT TYPE="hidden" name="ItemName" value="<%=ItemName%>">
136			<INPUT TYPE="hidden" name="Unit" value="<%=Unit%>">
137			<TEXTAREA NAME="comments" ROWS="5" COLS="20"></TEXTAREA><BR><BR>
138			<INPUT TYPE="submit" name="submit" value="��� ������ ����">
139		</FORM>
140		</center>
141		<%
142	end if
143	
144	response.write "<BR><BR><TABLE align=center style='border: solid 2pt black'><TR><TD>"
145	response.write "<li> �� ���� ���� = " & catItem& "<br>"
146	response.write "<li> ��� ���� = " & ItemName& "<br>"
147	response.write "<li> ���� ���� = " 
148	'if ownerAcc="-1" then 
149	'response.write 	"���� �ǁ � ���<br>"
150	'else
151	'response.write 	"����� ���� "& ownerAcc & "<br>"
152	'end if
153	response.write "<li> �� ���� = " & OldItemID& "<br>"
154	response.write "<li> ���� ���� ����� = " & costingMethod& "<br>"
155	response.write "<li> ����� ������ = " & Minim& "<br>"
156	response.write "<li> ����� = " & oldQtty& "<br>"
157	if outByOrder=1 then
158		response.write "<li> ���� �� ���� �����"
159	end if
160	response.write "<li> ���� = " & Unit& "<br>"
161	response.write "</TD></TR></TABLE>"
162
163'	Added By Alix 821118 
164'	-------------------------------
165'	Log The Edition Before Updating
166	conn.Execute("INSERT INTO InventoryItemsEditLog SELECT '"& EditDate & "' AS EditedOn, '"& EditBy & "' AS EditedBy, " & oldCatID & " as oldCategory, * FROM InventoryItems WHERE (ID = "& ID & ")")
167
168'	End of Log
169' -------------------------------
170
171	mySql="update InventoryItems set OldItemID="& OldItemID & ", owner="& ownerAcc & ", Name=N'"& ItemName & "', Minim="& Minim & ", Unit=N'"& Unit & "', costingMethod='"& costingMethod & "', outByOrder=" & outByOrder & " where id="	& id
172	conn.Execute mySql
173
174	mySql="update InventoryItemCategoryRelations set Cat_ID="& catItem & " where Item_ID="	& id
175	conn.Execute mySql
176
177	response.write "<center><br>����� ��� �� ������ ������ ��.</center>"
178	response.end 
179
180'-----------------------------------------------------------------------------------------------------
181'--------------------------------------------------------------------------------- Edit Qtty's (BATCH)
182'-----------------------------------------------------------------------------------------------------
183elseif request("submit")="����� ������ ��"then
184	'response.write "<br>" & replace(request.form,"&","<br>")
185	i=0
186	for each Qtty in request.form("Qtty") 
187		i=i+1
188		id = request.form("id")(i)
189		set RS4 = conn.Execute ("SELECT * FROM InventoryItems where id=" & id)
190		if RS4.eof then 
191			response.write "<br>���� ��� ������. �� ���� ����� ���� Ȑ����." 
192			response.end
193		else
194			oldQtty = RS4("Qtty")
195		end if
196
197		if clng(oldQtty) < clng(Qtty) then
198			'---------------------- Increase Item Qtty by Hand
199			'---------------------- RelatedID = -2 
200			qttyUp = qtty - oldQtty
201			mySql="INSERT INTO InventoryLog (ItemID, RelatedID, logDate, Qtty, owner, CreatedBy, IsInput, type) VALUES ("& id & ", -2 ,N'"& shamsiToday() & "', "& qttyUp & ", -1 , "& session("id") & ", 1 , 2)"
202			conn.Execute mySql
203		end if
204		
205		if clng(oldQtty) > clng(Qtty) then
206			'---------------------- Decrease Item Qtty by Hand
207			'---------------------- RelatedID = -2 
208			qttyDown = oldQtty - qtty
209			mySql = "INSERT INTO InventoryLog (ItemID, RelatedID, Qtty, logDate, owner, CreatedBy, IsInput, type) VALUES ("& ID & ",-2,"& qttyDown& ",N'"& shamsiToday() & "', -1 ,"& session("ID") & ", 0, 2)"
210			conn.Execute mySql
211		end if
212		
213	next
214end if
215
216'-----------------------------------------------------------------------------------------------------
217'--------------------------------------------------------------------------------- Report page Hearder
218'-----------------------------------------------------------------------------------------------------
219if request("itemDetail")="" then
220	%>
221	<BR><BR>
222	<FORM METHOD=POST ACTION="editItem.asp">
223	<%
224	catItem1 = request("catItem")
225	%>
226	<TABLE dir=rtl align=center width=600>
227	<TR bgcolor="#DDDDDD" >
228		<TD align=center >������ ����:
229		
230			<SELECT NAME="catItem" style='font-family: tahoma,arial ; font-size: 9pt; font-weight: bold' size="1" onchange="document.forms[0].submit()">
231			<option value="-1">���� ���� ���� </option>
232			<option value="-1">------------------</option>
233			<%
234				set RS4 = conn.Execute ("SELECT * FROM InventoryItemCategories")
235				while not (RS4.eof) %>
236					<OPTION value="<%=RS4("ID")%>"<%
237					if trim(catItem1) = trim(RS4("ID")) then
238					response.write " selected "
239					end if
240					%>>* <%=RS4("Name")%> </option>
241					<%	
242					RS4.MoveNext
243				wend
244				RS4.close
245				%>
246			</SELECT>
247		</TD>
248	</TR>
249	</table>
250	</FORM>
251	<%
252end if
253
254'-----------------------------------------------------------------------------------------------------
255'---------------------------------------------------------------------------- List Items of a category
256'-----------------------------------------------------------------------------------------------------
257if request("catItem") > 0 then
258	set RSS=Conn.Execute ("SELECT InventoryItems.ID, InventoryItems.OldItemID, InventoryItems.owner, InventoryItems.Minim, InventoryItems.Name, InventoryItems.Qtty, InventoryItems.CusQtty, InventoryItems.Unit, InventoryItems.costingMethod, InventoryItemCategories.Name AS Expr1 FROM InventoryItems INNER JOIN InventoryItemCategoryRelations ON InventoryItems.ID = InventoryItemCategoryRelations.Item_ID INNER JOIN InventoryItemCategories ON InventoryItemCategoryRelations.Cat_ID = InventoryItemCategories.ID WHERE (InventoryItemCategories.ID ="& catItem1 & ") and InventoryItems.enabled=1 order by OldItemID")	
259	%>
260	<TABLE dir=rtl align=center width=600>
261	<TR bgcolor="eeeeee">
262		<TD><!A HREF="default.asp?s=1"><SMALL>�� ����</SMALL></A></TD>
263		<TD><!A HREF="default.asp?s=2"><SMALL>��� ����</SMALL></A></TD>
264		<TD><!A HREF="default.asp?s=3"><SMALL>�����</SMALL></A></TD>
265		<TD><!A HREF="default.asp?s=3"><SMALL>����� ������</SMALL></A></TD>
266		<TD><!A HREF="default.asp?s=4"><SMALL>����� ������</SMALL></A></TD>
267		<TD><!A HREF="default.asp?s=5"><SMALL>����</SMALL></A></TD>
268		<TD><!A HREF="default.asp?s=6"><SMALL>���� �������</SMALL></A></TD>
269	</TR>
270	<FORM METHOD=POST ACTION="">
271	<INPUT TYPE="hidden" name="catItem" value="<%=catItem1%>">
272	<%
273	tmpCounter=0
274	Do while not RSS.eof
275		tmpCounter = tmpCounter + 1
276		if tmpCounter mod 2 = 1 then
277			tmpColor="#FFFFFF"
278			tmpColor2="#FFFFBB"
279		Else
280			tmpColor="#DDDDDD"
281			tmpColor2="#EEEEBB"
282		End if 
283
284		%>
285		<TR bgcolor="<%=tmpColor%>" height=25>
286			<TD align=center dir=ltr><%=RSS("OldItemID")%></TD>
287			<TD><A HREF="editItem.asp?itemDetail=<%=RSS("ID")%>"># <%=RSS("Name")%></A></TD>
288			<TD align=center dir=ltr>
289			<% if not Auth(5 , 7) then %>
290			<%=RSS("Qtty")%>
291			<% else %>
292			<INPUT TYPE="hidden" NAME="id" value="<%=RSS("id")%>" style="border:0pt; width:40pt; background-color:transparent">
293			<INPUT TYPE="text" NAME="Qtty" value="<%=RSS("Qtty")%>" style="border:0pt; width:40pt; background-color:transparent;text-align:center">
294			<% end if %>
295			</TD>
296			<TD align=center dir=ltr><a style="cursor:hand" onclick="window.open('cusItemDetails.asp?id=<%=RSS("ID")%>&name=<%=RSS("Name")%>','CusItemDetails','width=400,height=300')"><%=RSS("CusQtty")%></a></TD>
297			<TD align=center dir=ltr><%=RSS("Minim")%></TD>
298			<TD><%=RSS("Unit")%></TD>
299			<TD><%=RSS("costingMethod")%></TD>
300		</TR>
301			 
302		<% 
303		RSS.moveNext
304	Loop
305	%>
306	</TABLE><br>
307	<% if Auth(5 , 7) then %>
308	<CENTER><INPUT TYPE="submit" name="submit" value="����� ������ ��"></CENTER>
309	<% end if %>
310	</FORM>
311	<%
312end if
313
314'-----------------------------------------------------------------------------------------------------
315'---------------------------------------------------------------------------------- Details of an item
316'-----------------------------------------------------------------------------------------------------
317if request("itemDetail")<>"" then
318
319	set RS3 = conn.Execute ("SELECT InventoryItemCategories.id as catID, InventoryItems.ID, InventoryItems.outByOrder, InventoryItems.OldItemID, InventoryItems.owner, InventoryItems.Name, InventoryItems.Minim, InventoryItems.Qtty, InventoryItems.Unit, InventoryItems.costingMethod FROM InventoryItems INNER JOIN InventoryItemCategoryRelations ON InventoryItems.ID = InventoryItemCategoryRelations.Item_ID INNER JOIN InventoryItemCategories ON InventoryItemCategoryRelations.Cat_ID = InventoryItemCategories.ID WHERE (InventoryItems.ID = '"& sqlSafe(request("itemDetail")) & "')")
320	if RS3.EOF then
321		response.write "<br><br>"
322		call showAlert ("���!<br><br>���� ���� �� ����� ������",CONST_MSG_ERROR) 
323		response.end
324	end if
325	%>
326
327	<style>
328		.table12 {font-family: tahoma; font-size: 8pt; border:}
329		.table12 TR {height:20px; }
330		.table12 TH {direction:rtl; font-weight:normal;}
331		.table12 TD {direction:ltr; }
332	</style>
333
334	<SCRIPT LANGUAGE="JavaScript">
335	<!--
336	var noNextField = false;
337	function copyInfo(index){
338		var myObj=document.getElementsByTagName("table").item('prices').getElementsByTagName("tr").item(index);
339
340		document.all.autoKey.value=myObj.getElementsByTagName("input").item(0).value;
341
342		document.all.StartDate.value=myObj.getElementsByTagName("td").item(0).innerText;
343		document.all.EndDate.value=myObj.getElementsByTagName("td").item(1).innerText;
344		document.all.UnitPrice.value=myObj.getElementsByTagName("td").item(2).innerText;
345
346		document.all.ClearForm.style.visibility="visible";
347		document.all.BtnSubmit.value="������ ����";
348		document.all.StartDate.select();
349	}
350	function clearForm(){
351		document.all.autoKey.value="";
352		document.all.StartDate.value="";
353		document.all.EndDate.value="";
354		document.all.UnitPrice.value="";
355		document.all.BtnSubmit.value="��� ����";
356		document.all.ClearForm.style.visibility="hidden";
357		document.all.StartDate.select();
358	}
359	function hideIT()
360	{
361	//alert(document.all.aaa2.value)
362	if(document.all.aaa2.value==2) 
363		{
364			document.all.aaa1.style.visibility= 'visible'
365			document.all.ownerAcc.value = "<%=trim(RS3("owner"))%>"
366		}
367		else
368		{
369			document.all.aaa1.style.visibility= 'hidden'
370			document.all.ownerAcc.value = "-1"
371		}
372	}
373	//-->
374	</SCRIPT>
375
376	<BR>
377
378	<FORM METHOD=POST ACTION="?">
379	<INPUT TYPE="hidden" name="id" value="<%=RS3("ID")%>">
380	<TABLE border=0 align=center>
381	<TR>
382		<TD colspan=2 align=center><H3>������ ������� ����</H3></TD>
383	</TR>
384	<TR>
385		<TD align=left>��� ����</TD>
386		<TD align=right>
387			<INPUT TYPE="hidden" name="oldCatID" value="<%=RS3("catID")%>">
388			<SELECT NAME="catItem" style='font-family: tahoma,arial ; font-size: 9pt; font-weight: bold' size="1">
389			<option value="-1">���� ���� ���� </option>
390			<option value="-1">------------------</option>
391			<%
392				set RS4 = conn.Execute ("SELECT * FROM InventoryItemCategories")
393				while not (RS4.eof) %>
394					<OPTION value="<%=RS4("ID")%>"<%
395					if trim(RS3("catID")) = trim(RS4("ID")) then
396					response.write " selected "
397					end if
398					%>>* <%=RS4("Name")%> </option>
399					<%	
400					RS4.MoveNext
401				wend
402				RS4.close
403				%>
404			</SELECT>
405		</TD>
406	</TR>
407	<TR>
408		<TD align=left>��� ����</TD>
409		<TD align=right><INPUT TYPE="text" NAME="ItemName" value="<%=RS3("Name")%>" size=64></TD>
410	</TR>
411	<TR>
412		<TD align=left>�� ����</TD>
413		<TD align=right><INPUT TYPE="hidden" NAME="ownerAcc" value="-1"><INPUT TYPE="hidden" NAME="cost" value="FIFO"><INPUT TYPE="text" NAME="OldItemID" value="<%=RS3("OldItemID")%>"></TD>
414	</TR>
415	<TR>
416		<TD align=left>����� ������</TD>
417		<TD align=right><INPUT dir=ltr TYPE="text" NAME="Minim" value="<%=RS3("Minim")%>"></TD>
418	</TR>
419	<TR>
420		<TD align=left>����� ����</TD>
421		<TD align=right><INPUT TYPE="hidden" NAME="oldQtty" value="<%=RS3("Qtty")%>"><INPUT dir=ltr TYPE="text" NAME="qtty" value="<%=RS3("Qtty")%>"></TD>
422	</TR>
423	<TR>
424		<TD align=left>���� ������ ����</TD>
425		<TD align=right><INPUT TYPE="text" NAME="Unit" value="<%=RS3("Unit")%>"></TD>
426	</TR>
427	<TR>
428		<TD align=left><INPUT TYPE="checkbox" NAME="outByOrder" <% if RS3("outByOrder") then%> checked <% end if %>></TD>
429		<TD align=right>���� �� ���� �����</TD>
430	</TR>
431	<TR>
432		<TD align=left></TD>
433		<TD align=right height=20>
434		<BR><INPUT TYPE="submit" NamE="submit" value="��� ������ ����">
435		</TD>
436	</TR>
437	</TABLE>
438	</FORM>
439	<%
440	if Auth(5 , "D") then 'Set Market Price 
441	%>
442	<hr>
443		<FORM METHOD=POST ACTION="?act=editPrice">
444		<TABLE style="border:dashed 1px navy;" align=center>
445		<TR>
446			<TD colspan=2 align=center><H3>��� ���� ����� / BHR</H3></TD>
447		</TR>
448		<TR>
449			<TD align=left>��� ����</TD>
450			<TD align=right width=300><b><%=RS3("Name")%></b></TD>
451		</TR>
452		<TR>
453			<TD colspan=2 align=center>
454			<%
455					set RS4 = conn.Execute ("SELECT InventoryItemsUnitPrice.*, Users.RealName AS CreatorName FROM InventoryItemsUnitPrice INNER JOIN Users ON InventoryItemsUnitPrice.CreatedBy = Users.ID WHERE (InventoryItem='" & RS3("ID") & "') ORDER BY StartDate ")
456					if not RS4.eof then
457			%>			
458						<TABLE id="prices" class="table12" border=0 cellpadding=2 cellspacing=1 bgcolor="0">
459							<TR bgcolor="#AAAAAA">
460							<TH width=75>��</TD>
461							<TH width=75>��</TD>
462							<TH width=75>���� ����</TD>
463							<TH width=90>����</TD>
464						</TR>
465			<%
466						while not (RS4.eof) 
467							tmpCounter = tmpCounter + 1
468							if tmpCounter mod 2 = 1 then
469								tmpColor="#FFFFFF"
470								tmpColor2="#FFFFBB"
471							Else
472								tmpColor="#DDDDDD"
473								tmpColor2="#EEEEBB"
474							End if 
475			%>
476							<TR bgcolor="<%=tmpColor%>" style="cursor: hand;" onMouseOver="this.style.backgroundColor='<%=tmpColor2%>'" onMouseOut="this.style.backgroundColor='<%=tmpColor%>'" onclick="copyInfo(this.rowIndex)">
477								<TD><%=RS4("StartDate")%></TD>
478								<TD><%=RS4("EndDate")%></TD>
479								<TD><%=Separate(RS4("UnitPrice"))%></TD>
480								<TD style="direction:rtl" title="<%=RS4("CreatedDate") & "(" & RS4("CreatedTime") & ")"%>">
481									&nbsp;<%=RS4("CreatorName")%>
482									<INPUT TYPE="hidden" value="<%=RS4("autoKey")%>">
483								</TD>
484							</TR>
485			<%
486							RS4.MoveNext
487						wend
488			%>			</TABLE>			
489			<%
490					end if
491					RS4.close
492			%>
493			</TD>
494		</TR>
495		<TR>
496			<TD colspan=2 align=center><HR></TD>
497		</TR>
498		<TR>
499			<TD align=left>����� ����</TD>
500			<TD align=right><INPUT dir=ltr TYPE="text" NAME="StartDate" value="" onblur="acceptDate(this)" ></TD>
501		</TR>
502		<TR>
503			<TD align=left>����� �����</TD>
504			<TD align=right><INPUT dir=ltr TYPE="text" NAME="EndDate" value="" onblur="acceptDate(this)" ></TD>
505		</TR>
506		<TR>
507			<TD align=left>���� ���� (����)</TD>
508			<TD align=right><INPUT TYPE="text" NAME="UnitPrice" value="" onblur="this.value = val2txt(txt2val(this.value))"></TD>
509		</TR>
510		<TR>
511			<TD align=right>
512				<input type="button" value="����" name="ClearForm" onclick="clearForm()" style="visibility:hidden;">
513			</TD>
514			<TD align=right height=20>
515				<INPUT TYPE="hidden" name="autoKey" value="">
516				<INPUT TYPE="hidden" name="InventoryItem" value="<%=RS3("ID")%>">
517				<INPUT TYPE="submit" name="BtnSubmit" value="��� ����">
518			</TD>
519		</TR>
520		</TABLE>
521		</FORM>
522
523		<%
524	end if
525end if
526%>
527<!--#include file="tah.asp" -->