/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. <!--
  13. var Arguments = new Array(2)
  14. function documentKeyDown() {
  15. var theKey = event.keyCode;
  16. var GLA = 0
  17. var Acc = 0
  18. if (theKey == 27) {
  19. window.close();
  20. }
  21. else if (theKey == 13){
  22. check(document.all.GLAccount);
  23. if ((document.all.GLAccountName.value != " " ) && (document.all.GLAccountName.value != "! " ) && (document.all.GLAccountName.value != " " ))
  24. GLA=document.all.GLAccount.value
  25. check(document.all.Account);
  26. if ((document.all.AccountName.value != " " ) && (document.all.AccountName.value != "! " ) && (document.all.AccountName.value != " " ))
  27. Acc=document.all.Account.value
  28. if (GLA != 0){
  29. window.dialogArguments.value=GLA+"#"+Acc;
  30. window.close();
  31. }
  32. }
  33. else if (theKey==9){
  34. event.keyCode=0;
  35. if (document.all.GLAccount.value=="")
  36. document.all.GLAccount.focus();
  37. else if (document.all.Account.value=="")
  38. document.all.Account.focus();
  39. else
  40. document.all.GLAccount.focus();
  41. }
  42. }
  43. document.onkeydown = documentKeyDown;
  44. function onMyLoad(){
  45. if (window.dialogArguments){
  46. document.getElementById('dlgDispTxt').innerHTML=window.dialogArguments.value;
  47. window.dialogArguments.value=""
  48. window.dialogArguments.value=""
  49. }
  50. document.all.GLAccount.focus();
  51. }
  52. //-->
  53. </script>
  54. <!--#include file="../config.asp" -->
  55. </HEAD>
  56. <BODY leftmargin=0 topmargin=0 bgcolor='#DDDDFF' onload="onMyLoad()" style="font-family:tahoma;" DIR=RTL>
  57. <BR>
  58. <Center>
  59. <TABLE>
  60. <TR>
  61. <TD colspan='2'><span id='dlgDispTxt' style="width:350px;"> </span></TD>
  62. </TR>
  63. <TR>
  64. <TD align=center></TD>
  65. <TD align=center></TD>
  66. </TR>
  67. <TR>
  68. <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>
  69. <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>
  70. </TR>
  71. <TR>
  72. <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>
  73. <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>
  74. </TR>
  75. </TABLE>
  76. <input type="hidden" Name='tmpDlgArg' value=''>
  77. <input type="hidden" Name='tmpDlgTxt' value=''>
  78. <SCRIPT LANGUAGE="JavaScript">
  79. <!--
  80. var dialogActive=false;
  81. function mask(src){
  82. var theKey=event.keyCode;
  83. if (theKey==32){
  84. event.keyCode=9
  85. document.all.tmpDlgArg.value="#"
  86. if (src.name=='GLAccount'){
  87. document.all.tmpDlgTxt.value=" :"
  88. dialogActive=true
  89. window.showModalDialog('../dialog_GenInput.asp',document.all.tmpDlgTxt,'dialogHeight:200px; dialogWidth:440px; dialogTop:; dialogLeft:; edge:None; center:Yes; help:No; resizable:No; status:No;');
  90. dialogActive=false
  91. if (document.all.tmpDlgTxt.value !="") {
  92. dialogActive=true
  93. 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;');
  94. dialogActive=false
  95. if (document.all.tmpDlgArg.value!="#"){
  96. Arguments=document.all.tmpDlgArg.value.split("#")
  97. src.value=Arguments[0];
  98. document.all.GLAccountName.value=Arguments[1];
  99. }
  100. }
  101. }
  102. else if (src.name=='Account') {
  103. document.all.tmpDlgTxt.value=" :"
  104. dialogActive=true
  105. window.showModalDialog('../dialog_GenInput.asp',document.all.tmpDlgTxt,'dialogHeight:200px; dialogWidth:440px; dialogTop:; dialogLeft:; edge:None; center:Yes; help:No; resizable:No; status:No;');
  106. dialogActive=false
  107. if (document.all.tmpDlgTxt.value !="") {
  108. dialogActive=true
  109. 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;');
  110. dialogActive=true
  111. if (document.all.tmpDlgArg.value!="#"){
  112. Arguments=document.all.tmpDlgArg.value.split("#")
  113. src.value=Arguments[0];
  114. document.all.AccountName.value=Arguments[1];
  115. }
  116. }
  117. }
  118. }
  119. else if ((theKey >= 48 && theKey <= 57) || theKey==13 ) // [0]-[9] and [Enter] are acceptible
  120. return true;
  121. else
  122. return false;
  123. }
  124. function check(src){
  125. if (!dialogActive){
  126. badCode = false;
  127. if (window.XMLHttpRequest) {
  128. var objHTTP=new XMLHttpRequest();
  129. } else if (window.ActiveXObject) {
  130. var objHTTP = new ActiveXObject("Microsoft.XMLHTTP");
  131. }
  132. if (src.name=='GLAccount') {
  133. objHTTP.open('GET','../accounting/xml_GLAccount.asp?id='+src.value,false)
  134. objHTTP.send()
  135. tmpStr = unescape(objHTTP.responseText)
  136. document.all.GLAccountName.value=tmpStr;
  137. }
  138. else if (src.name=='Account') {
  139. objHTTP.open('GET','../accounting/xml_CustomerAccount.asp?id='+src.value,false)
  140. objHTTP.send()
  141. tmpStr = unescape(objHTTP.responseText)
  142. document.all.AccountName.value=tmpStr;
  143. }
  144. }
  145. }
  146. //-->
  147. </SCRIPT></BODY>
  148. </HTML>
  149. <%
  150. Response.CacheControl="no-cache"
  151. Response.AddHeader "pragma", "no-cache"
  152. Server.ScriptTimeout = 600
  153. Response.Expires= -1
  154. if (session("ID")="") then
  155. session.abandon
  156. response.redirect "../login.asp?err= "
  157. end if
  158. 'conStr="DRIVER={SQL Server};SERVER=(local);DATABASE=sefareshat;UID=sefadmin; PWD=5tgb;"
  159. 'conStr = "Provider=SQLNCLI10.1;Persist Security Info=False;User ID=sefadmin;Initial Catalog=sefareshat;Data Source=(local);PWD=5tgb;"
  160. 'Set conn = Server.CreateObject("ADODB.Connection")
  161. 'conn.open conStr
  162. %>