PageRenderTime 24ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/beta/cashReg/NewCashReg.asp

http://github.com/khaneh/Orders
ASP | 114 lines | 108 code | 5 blank | 1 comment | 6 complexity | f59d67683afecd7ad6034d892c4d92a4 MD5 | raw file
  1<%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2'CashRegister (9)
  3PageTitle="������"
  4SubmenuItem=5
  5if not Auth(9 , 5) then NotAllowdToViewThisPage()
  6
  7%>
  8<!--#include file="top.asp" -->
  9<!--#include File="../include_farsiDateHandling.asp"-->
 10<!--#include File="../include_JS_InputMasks.asp"-->
 11
 12<%
 13function Link2Trace(OrderNo)
 14	Link2Trace="<A HREF='../order/orderEdit.asp?e=n&radif="& OrderNo & "' target='_balnk'>"& OrderNo & "</A>"
 15end function
 16
 17%>
 18<style>
 19	.RcpMainTable { font-family:tahoma; font-size: 9pt; border: 2px solid #000088; padding:0; direction: RTL; width:500px;}
 20	.RcpMainTable Tr {Height:25px; border: 1px solid black;}
 21	.RcpMainTable Input { font-family:tahoma; font-size: 9pt; width:120px; border: 1px solid black; text-align:right; direction: LTR;}
 22	.RcpMainTable Select { font-family:tahoma; font-size: 9pt; width:120px;}
 23</style>
 24<font face="tahoma">
 25<%
 26if request("act")="submitNew" then
 27	if request("Cashier")="" OR request("Banker")="" then 
 28		response.clear
 29		conn.close
 30		response.redirect "./NewCashReg.asp?errmsg=" & server.urlencode("�������� �� ��� �� ������ ����� ���...")
 31	end if
 32	mySQL="SELECT * FROM CashRegisters WHERE (IsOpen=1) AND (Cashier='"& request("Cashier") & "')"
 33	Set RS1= conn.Execute(mySQL)
 34	if not RS1.eof then 
 35		response.clear
 36		conn.close
 37		response.redirect "./NewCashReg.asp?errmsg=" & server.urlencode("��� ���� �������� ��� ���� �� ����� ��� �����!<br>��� �� ��� ����� ��� �� ���� ����.")
 38	end if
 39	OpeningAmount=text2value(request("OpeningAmount"))
 40	mySQL="INSERT INTO CashRegisters (Cashier, Banker, OpenDate, NameDate, OpenedBy, IsOpen, IsApproved, OpeningAmount, CashAmountA, CashAmountB, ChequeAmount, ChequeQtty, ShortOverAmount) VALUES ('" &_ 
 41	request("Cashier") & "', '"& request("Banker") & "', N'"& shamsiToday() & "', N'"& request("NameDate") & "', '"& session("ID") & "', '"& 1 & "', '"& 0 & "', '"& OpeningAmount & "', '"& OpeningAmount & "', 0,0,0,0)"
 42	conn.Execute(mySQL)
 43%><br><br>
 44	<TABLE width='70%' align='center'>
 45	<TR>
 46		<TD align=center bgcolor=yellow style='border: solid 1pt black'><BR><b><%="�� ������ �� ����� ���� ����� �� ����� ��� �� ���."%></b><BR><BR></TD>
 47	</TR>
 48	</TABLE>
 49<%
 50else%>
 51<BR><BR>
 52	<FORM METHOD=POST ACTION="?act=submitNew">
 53	<TABLE class='RcpMainTable' align='center'>
 54	<TR>
 55		<TD align='left'>����� �����:</TD>
 56		<TD><INPUT TYPE="text" style="text-align:left;" Name="NameDate" value="<%=shamsiToday()%>" onblur="acceptDate(this)"></TD>
 57		<TD align='left'>&nbsp;</TD>
 58		<TD>&nbsp;</TD>
 59	</TR>
 60	<TR>
 61		<TD align='left'>��������:</TD>
 62		<TD><SELECT NAME="Cashier">
 63			<option Value=""> -- ������ ���� -- </option>
 64<%			mySQL="SELECT * FROM Users WHERE Display=1 ORDER BY RealName"
 65			Set RS1 = conn.Execute(mySQL)
 66			do while not (RS1.eof)
 67%>				<option Value="<%=RS1("ID")%>"><%=RS1("RealName")%></option>
 68<%
 69				RS1.movenext
 70			loop
 71			RS1.close
 72%>			</SELECT>
 73		</TD>
 74		<TD align='left'>���:</TD>
 75		<TD><SELECT NAME="Banker">
 76			<option Value=""> -- ������ ���� -- </option>
 77<%			mySQL="SELECT * FROM Bankers WHERE (IsBankAccount <> 1)"
 78			Set RS1 = conn.Execute(mySQL)
 79			do while not (RS1.eof)
 80%>				<option Value="<%=RS1("ID")%>"><%=RS1("Name")%></option>
 81<%
 82				RS1.movenext
 83			loop
 84			RS1.close
 85%>			</SELECT>
 86		</TD>
 87	</TR>
 88	<TR>
 89		<TD align='left'>������ �����:</TD>
 90		<TD><INPUT TYPE="text" Name="OpeningAmount" onblur="setPrice(this);" onKeyPress="return maskNumber(this);"></TD>
 91		<TD align='left'>&nbsp;</TD>
 92		<TD>&nbsp;</TD>
 93	</TR>
 94	<TR>
 95		<TD colspan="4" align='center'><INPUT style="width:70px;text-align:center;" TYPE="submit" value="�����"></TD>
 96	</TR>
 97	</TABLE>
 98	</FORM>
 99	<SCRIPT LANGUAGE="JavaScript">
100	<!--
101document.all.OpeningAmount.focus();
102
103function setPrice(src){
104		src.value=val2txt(txt2val(src.value));
105}
106	
107	//-->
108	</SCRIPT>
109<%
110end if
111conn.Close
112%>
113</font>
114<!--#include file="tah.asp" -->