PageRenderTime 33ms CodeModel.GetById 24ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/beta/AR/dialog_invoiceItems.asp

http://github.com/khaneh/Orders
ASP | 110 lines | 104 code | 6 blank | 0 comment | 11 complexity | 95ba858a0182611d401e25624605f6e1 MD5 | raw file
  1<%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%>
  2<!--#include file="../config.asp" -->
  3<HTML>
  4<HEAD>
  5<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
  6<meta http-equiv="Content-Language" content="fa">
  7<style>
  8	Table { font-size: 9pt;}
  9	Input { font-family:tahoma; font-size: 9pt;}
 10</style>
 11<TITLE>���� �� � �����</TITLE>
 12</HEAD>
 13
 14<BODY>
 15<font face="tahoma">
 16<%
 17	name=request("name")&""
 18	if IsNumeric(name) then 
 19		if cint(name)>-100 then mySQL="select InvoiceItems.* from InvoiceItems inner join InvoiceItemCategoryRelations on InvoiceItemCategoryRelations.InvoiceItem = invoiceItems.ID where InvoiceItems.Enabled=1 and InvoiceItemCategoryRelations.InvoiceItemCategory=" & name
 20	else
 21		mySQL="SELECT * From InvoiceItems WHERE ((REPLACE([Name], ' ', '') LIKE REPLACE(N'%"& sqlSafe(name) & "%', ' ', ''))) AND (Enabled=1) ORDER BY [id]"
 22	end if
 23		Set RS1 = conn.Execute(mySQL)
 24
 25	if (RS1.eof) then %>
 26		<br><br><br><hr>
 27		<table align='center'>
 28			<tr><td bgcolor='#FFCCCC' dir='rtl' align='center'> ����� �� ��� ������ ���� ���</td>
 29			</tr>
 30		</table>
 31		<hr>
 32<%	else 
 33%>
 34	<TABLE ID="InvoiceItems" border="1" width="100%" cellspacing="1" cellpadding="5" dir="RTL">
 35		<tr bgcolor='#C3C3FF'>
 36			<td align='center' width="5%"> <input type="radio" disabled> </td>
 37			<td align='center' width="15%"> �� ���� </td>
 38			<td align='center'> ����� </td>
 39			<td align='center'>-</td>
 40			<td align='center'>��</td>
 41			<td align='center'>������</td>
 42		</tr>
 43<%		tempCounter=0
 44		while Not (RS1.EOF)
 45			tempCounter=tempCounter+1
 46			if (tempCounter Mod 2 = 1)then
 47				tempColor="#FFFFFF"
 48			else
 49				tempColor="#DDDDEE"
 50			end if
 51%>				<tr bgcolor='<%=tempColor%>'>
 52					<td align='center'><input type="radio" name="selectedItem" value="<%=RS1("ID")%>" onclick="selectItem(this)">&nbsp;</td>
 53					<td dir='ltr'><%=RS1("ID") %>&nbsp;</td>
 54					<td><%=RS1("Name")%>&nbsp;</td>
 55					<td><%=RS1("type")%></td>
 56					<td><%=RS1("fee")%></td>
 57					<td><%if RS1("hasVat") then response.write "����" else response.write "�����"%></td>
 58				</tr>
 59<%			RS1.movenext
 60		wend
 61%>
 62		<tr bgcolor='#C3C3FF'>
 63			<td align='center' colspan="3"><input type="submit" style="font-family:Tahoma" value="������" onclick="selectAndClose();">&nbsp;</td>
 64		</tr>
 65	</TABLE>
 66	<BR>
 67	<HR>
 68	<BR>
 69<%	end if    
 70conn.Close
 71%>
 72</font>
 73</BODY>
 74</HTML>
 75<script language="JavaScript">
 76<!--
 77var Arguments = new Array(4)
 78
 79function selectItem(src){
 80	rowNo=src.parentNode.parentNode.rowIndex;
 81//	thePrice=document.getElementsByName("selectedItem")[rowNo-1].value
 82	myRow=document.getElementById("InvoiceItems").getElementsByTagName("tr")[rowNo];
 83	Arguments[0]=myRow.getElementsByTagName("td")[1].innerText;// ID
 84	Arguments[1]=myRow.getElementsByTagName("td")[2].innerText;// Name
 85	Arguments[2]=myRow.getElementsByTagName("td")[3].innerText;// type
 86	Arguments[3]=myRow.getElementsByTagName("td")[4].innerText;// fee
 87	Arguments[4]=myRow.getElementsByTagName("td")[5].innerText;// hasVat
 88}
 89function selectAndClose(){
 90myString=Arguments.join("#");
 91window.dialogArguments.value=myString
 92window.close();
 93}
 94
 95function documentKeyDown() {
 96	var theKey = event.keyCode;
 97	if (theKey == 27) { 
 98		window.close();
 99	}
100}
101
102document.onkeydown = documentKeyDown;
103
104radio1=document.getElementsByName("selectedItem")[0];
105if (radio1){
106	radio1.checked=true;
107	selectItem(radio1);
108}
109//-->
110</script>