PageRenderTime 22ms CodeModel.GetById 10ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/beta/bank/dialog_GetDestination.asp

http://github.com/khaneh/Orders
ASP | 170 lines | 158 code | 8 blank | 4 comment | 45 complexity | 87927c0d102e653e61dc3e7e0f772488 MD5 | raw file
  1<%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%>
  2<HTML>
  3<HEAD>
  4<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
  5<meta http-equiv="Content-Language" content="fa">
  6<style>
  7	Table { font-size: 9pt;}
  8	Input { font-family:tahoma; font-size: 9pt;}
  9</style>
 10<TITLE>���� ����</TITLE>
 11<script language="JavaScript">
 12<!--
 13var Arguments = new Array(2)
 14
 15function documentKeyDown() {
 16	var theKey = event.keyCode;
 17	var GLA = 0
 18	var Acc = 0
 19	if (theKey == 27) { 
 20		window.close();
 21	}
 22	else if (theKey == 13){
 23		check(document.all.GLAccount);
 24		if ((document.all.GLAccountName.value != "���� ��� " ) && (document.all.GLAccountName.value != "���! " ) && (document.all.GLAccountName.value != "���� ����� ���� �����" ))
 25			GLA=document.all.GLAccount.value
 26		check(document.all.Account);
 27		if ((document.all.AccountName.value != "���� ��� " ) && (document.all.AccountName.value != "���! " ) && (document.all.AccountName.value != "���� ����� ���� �����" ))
 28			Acc=document.all.Account.value
 29		if (GLA != 0){
 30			window.dialogArguments.value=GLA+"#"+Acc;
 31			window.close();
 32		}
 33	}
 34	else if (theKey==9){
 35		event.keyCode=0;
 36		if (document.all.GLAccount.value=="")
 37			document.all.GLAccount.focus();
 38		else if (document.all.Account.value=="")
 39			document.all.Account.focus();
 40		else
 41			document.all.GLAccount.focus();
 42	}
 43}
 44
 45document.onkeydown = documentKeyDown;
 46
 47function onMyLoad(){
 48	if (window.dialogArguments){
 49		document.getElementById('dlgDispTxt').innerHTML=window.dialogArguments.value;
 50		window.dialogArguments.value=""
 51		window.dialogArguments.value=""
 52	}
 53	document.all.GLAccount.focus();
 54}
 55
 56//-->
 57</script>
 58<!--#include file="../config.asp" -->
 59</HEAD>
 60<BODY leftmargin=0 topmargin=0 bgcolor='#DDDDFF' onload="onMyLoad()" style="font-family:tahoma;" DIR=RTL>
 61<BR>
 62<Center>
 63<TABLE>
 64<TR>
 65	<TD colspan='2'><span id='dlgDispTxt' style="width:350px;">��� ����� ����</span></TD>
 66</TR>
 67<TR>
 68	<TD align=center>������</TD>
 69	<TD align=center>����</TD>
 70</TR>
 71<TR>
 72	<TD><INPUT dir="LTR" TYPE="text" NAME="Account" maxlength="6" value="<%=Account%>" onKeyPress='return mask(this);' onBlur='check(this);' style="width:250px;border:solid 1pt black"></TD>
 73	<TD><INPUT dir="LTR" TYPE="text" NAME="GLAccount" maxlength="5" value="<%=GLAccount%>" onKeyPress='return mask(this);' onBlur='check(this);' style="width:100px;border:solid 1pt black"></TD>
 74</TR>
 75<TR>
 76	<TD><TextArea NAME="AccountName" id="AccountName" readonly style="width:250px;height:40px;font-family:tahoma;font-size:9pt;background:transparent; border:solid 1px white"><%=AccountName%></TextArea></TD>
 77	<TD><TextArea NAME="GLAccountName" id="GLAccountName" readonly  style="width:100px;height:40px;font-family:tahoma;font-size:9pt;background:transparent; border:solid 1px white;"><%=GLAccountName%></TextArea></TD>
 78</TR>
 79</TABLE>
 80<input type="hidden" Name='tmpDlgArg' value=''>
 81<input type="hidden" Name='tmpDlgTxt' value=''>
 82<SCRIPT LANGUAGE="JavaScript">
 83<!--
 84var dialogActive=false;
 85
 86	function mask(src){ 
 87		var theKey=event.keyCode;
 88		if (theKey==32){
 89			event.keyCode=9
 90			document.all.tmpDlgArg.value="#"
 91			if (src.name=='GLAccount'){
 92				document.all.tmpDlgTxt.value="����� �� ��� ���� ��� ����:"
 93				dialogActive=true
 94				window.showModalDialog('../dialog_GenInput.asp',document.all.tmpDlgTxt,'dialogHeight:200px; dialogWidth:440px; dialogTop:; dialogLeft:; edge:None; center:Yes; help:No; resizable:No; status:No;');
 95				dialogActive=false
 96				if (document.all.tmpDlgTxt.value !="") {
 97					dialogActive=true
 98					window.showModalDialog('../accounting/dialog_selectGL.asp?act=select&name='+escape(document.all.tmpDlgTxt.value),document.all.tmpDlgArg,'dialogHeight:500px; dialogWidth:380px; dialogTop:; dialogLeft:; edge:Raised; center:Yes; help:No; resizable:Yes; status:No;');
 99					dialogActive=false
100					if (document.all.tmpDlgArg.value!="#"){
101						Arguments=document.all.tmpDlgArg.value.split("#")
102						src.value=Arguments[0];
103						document.all.GLAccountName.value=Arguments[1];
104					}
105				}
106			}
107			else if (src.name=='Account') {
108				document.all.tmpDlgTxt.value="����� �� ��� ���� ��� ������:"
109				dialogActive=true
110				window.showModalDialog('../dialog_GenInput.asp',document.all.tmpDlgTxt,'dialogHeight:200px; dialogWidth:440px; dialogTop:; dialogLeft:; edge:None; center:Yes; help:No; resizable:No; status:No;');
111				dialogActive=false
112				if (document.all.tmpDlgTxt.value !="") {
113					dialogActive=true
114					window.showModalDialog('../AR/dialog_SelectAccount.asp?act=select&search='+escape(document.all.tmpDlgTxt.value), document.all.tmpDlgArg, 'dialogWidth:780px; dialogHeight:500px; dialogTop:; dialogLeft:; edge:Raised; center:Yes; help:No; resizable:Yes; status:No;');
115					dialogActive=true
116					if (document.all.tmpDlgArg.value!="#"){
117						Arguments=document.all.tmpDlgArg.value.split("#")
118						src.value=Arguments[0];
119						document.all.AccountName.value=Arguments[1];
120					}
121				}
122			}
123		}
124		else if ((theKey >= 48 && theKey <= 57) || theKey==13 ) // [0]-[9] and [Enter] are acceptible
125			return true;
126		else
127			return false;
128	}
129
130function check(src){ 
131	if (!dialogActive){
132		badCode = false;
133		if (window.XMLHttpRequest) {
134				var objHTTP=new XMLHttpRequest();
135			} else if (window.ActiveXObject) {
136				var objHTTP = new ActiveXObject("Microsoft.XMLHTTP");
137			}
138		if (src.name=='GLAccount') {
139			objHTTP.open('GET','../accounting/xml_GLAccount.asp?id='+src.value,false)
140			objHTTP.send()
141			tmpStr = unescape(objHTTP.responseText)
142			document.all.GLAccountName.value=tmpStr;
143		}
144		else if (src.name=='Account') {
145			objHTTP.open('GET','../accounting/xml_CustomerAccount.asp?id='+src.value,false)
146			objHTTP.send()
147			tmpStr = unescape(objHTTP.responseText)
148			document.all.AccountName.value=tmpStr;
149		}
150	}
151}
152//-->
153</SCRIPT></BODY>
154</HTML>
155<% 
156Response.CacheControl="no-cache"
157Response.AddHeader "pragma", "no-cache"
158Server.ScriptTimeout = 600
159Response.Expires= -1
160if (session("ID")="") then
161	session.abandon
162	response.redirect "../login.asp?err=���� ���� ��� ���� ���� ���� ����� ����"
163end if
164
165'conStr="DRIVER={SQL Server};SERVER=(local);DATABASE=sefareshat;UID=sefadmin; PWD=5tgb;"
166'conStr = "Provider=SQLNCLI10.1;Persist Security Info=False;User ID=sefadmin;Initial Catalog=sefareshat;Data Source=(local);PWD=5tgb;"
167
168'Set conn = Server.CreateObject("ADODB.Connection")
169'conn.open conStr
170%>