/beta/CRM/AccountEdit.asp

http://github.com/khaneh/Orders · ASP · 1021 lines · 929 code · 58 blank · 34 comment · 122 complexity · bdb863ac2b39d0ae38e928d4b43f1615 MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2. 'CRM (1)
  3. PageTitle= " "
  4. if request("act")="getAccount" or request("act")="submitcustomer" then
  5. SubmenuItem=2
  6. if not Auth(1 , 2) then NotAllowdToViewThisPage()
  7. else
  8. SubmenuItem=3
  9. if not Auth(1 , 3) then NotAllowdToViewThisPage()
  10. end if
  11. editFlag = 0
  12. AccType = 2
  13. %>
  14. <!--#include file="top.asp" -->
  15. <!--#include File="../include_farsiDateHandling.asp"-->
  16. <!--#include File="../include_JS_InputMasks.asp"-->
  17. <style>
  18. .CustGenTable { font-family:tahoma; font-size: 9pt;}
  19. .CustGenInput { font-family:tahoma; font-size: 9pt;}
  20. </STYLE>
  21. <SCRIPT LANGUAGE="JavaScript">
  22. <!--
  23. var okToProceed=false;
  24. var tempKeyBuffer;
  25. function myKeyDownHandler(){
  26. tempKeyBuffer=window.event.keyCode;
  27. }
  28. function myKeyPressHandler(){
  29. // alert (tempKeyBuffer)
  30. if (tempKeyBuffer>=65 && tempKeyBuffer<=90){
  31. window.event.keyCode=tempKeyBuffer+32;
  32. }
  33. else if(tempKeyBuffer==186){
  34. window.event.keyCode=59;
  35. }
  36. else if(tempKeyBuffer==188){
  37. window.event.keyCode=44;
  38. }
  39. else if(tempKeyBuffer==190){
  40. window.event.keyCode=46;
  41. }
  42. else if(tempKeyBuffer==191){
  43. window.event.keyCode=47;
  44. }
  45. else if(tempKeyBuffer==192){
  46. window.event.keyCode=96;
  47. }
  48. else if(tempKeyBuffer>=219 && tempKeyBuffer<=221){
  49. window.event.keyCode=tempKeyBuffer-128;
  50. }
  51. else if(tempKeyBuffer==222){
  52. window.event.keyCode=39;
  53. }
  54. }
  55. //-->
  56. </SCRIPT>
  57. <font face="tahoma">
  58. <!-- <div dir='rtl'><B> </B>
  59. </div> -->
  60. <%
  61. if request("act")="submitsearch" then
  62. if request("CustomerNameSearchBox") <> "" then
  63. SA_TitleOrName=request("CustomerNameSearchBox")
  64. mySQL="SELECT * FROM Accounts WHERE (REPLACE(AccountTitle, ' ', '') LIKE REPLACE(N'%"& SA_TitleOrName & "%', ' ', '') ) ORDER BY AccountTitle"
  65. Set RS1 = conn.Execute(mySQL)
  66. if (RS1.eof) then
  67. response.redirect "?errmsg=" & Server.URLEncode(" .<br><a href='../CRM/AccountEdit.asp?act=getAccount'> Ͽ</a>")
  68. ' Not Found %>
  69. <div dir='rtl'><B> </B> &nbsp; <A HREF="AccountEdit.asp" style='font-size:7pt;'> </A>
  70. </div><br>
  71. <% else
  72. SA_TitleOrName=request("CustomerNameSearchBox")
  73. SA_Action="return true;"
  74. SA_SearchAgainURL="AccountEdit.asp"
  75. SA_StepText=" : "
  76. %>
  77. <FORM METHOD=POST ACTION="AccountEdit.asp?act=editaccount">
  78. <!--#include File="../AR/include_SelectAccount.asp"-->
  79. </FORM>
  80. <%
  81. end if
  82. end if
  83. elseif request("act")="editaccount" AND (request("selectedCustomer") <> "" or request("NextOf") <> "" or request("PrevOf") <> "") then
  84. '--------------------------------- START
  85. NextOf=request("NextOf")
  86. PrevOf=request("PrevOf")
  87. CusID=request("selectedCustomer")
  88. if NextOf <> "" AND isNumeric(NextOf) then
  89. NextOf=clng(NextOf)
  90. mySQL="SELECT TOP 1 AccountTitle FROM Accounts WHERE (ID = '"& NextOf & "')"
  91. set RS1=Conn.execute(mySQL)
  92. theTitle = RS1("AccountTitle")
  93. 'mySQL="SELECT TOP 1 ID FROM Accounts WHERE (AccountTitle > N'"& theTitle & "') OR ((ID > '"& NextOf & "') AND (AccountTitle = N'"& theTitle & "')) Order BY AccountTitle, ID"
  94. '-------- changed by Alix (83-4-9) : be khaste mohaghegh tartibe hesaab haa az Alefbaa be Shomare Hesab tagheer kard
  95. mySQL="SELECT TOP 1 ID FROM Accounts WHERE (ID > '"& NextOf & "') Order BY ID"
  96. set RS1=Conn.execute(mySQL)
  97. if not Rs1.eof then
  98. CusID = RS1("ID")
  99. LinkToNext="<a href=""?act=show&NextOf="& CusID & """> &gt;</a>"
  100. else
  101. CusID = NextOf
  102. LinkToNext=" "
  103. end if
  104. LinkToPrev="<a href=""?act=show&PrevOf="& CusID & """>&lt; </a>"
  105. elseif PrevOf <> "" AND isNumeric(PrevOf) then
  106. PrevOf = clng(PrevOf)
  107. mySQL="SELECT TOP 1 AccountTitle FROM Accounts WHERE (ID = '"& PrevOf & "')"
  108. set RS1=Conn.execute(mySQL)
  109. theTitle = RS1("AccountTitle")
  110. 'mySQL="SELECT TOP 1 ID FROM Accounts WHERE (AccountTitle < N'"& theTitle & "') OR ((ID < '"& PrevOf & "') AND (AccountTitle = N'"& theTitle & "')) Order BY AccountTitle DESC, ID DESC"
  111. mySQL="SELECT TOP 1 ID FROM Accounts WHERE (ID < '"& PrevOf & "') Order BY ID DESC"
  112. set RS1=Conn.execute(mySQL)
  113. if not Rs1.eof then
  114. CusID = RS1("ID")
  115. LinkToPrev="<a href=""?act=show&PrevOf="& CusID & """>&lt; </a>"
  116. else
  117. CusID = PrevOf
  118. LinkToPrev=" "
  119. end if
  120. LinkToNext="<a href=""?act=show&NextOf="& CusID & """> &gt;</a>"
  121. elseif CusID <> "" AND isNumeric(CusID) then
  122. CusID=clng(CusID)
  123. LinkToNext="<a href=""?act=show&NextOf="& CusID & """> &gt;</a>"
  124. LinkToPrev="<a href=""?act=show&PrevOf="& CusID & """>&lt; </a>"
  125. else
  126. Conn.close
  127. response.redirect "?errmsg=" & Server.URLEncode(" ")
  128. end if
  129. '--------------------------------- END
  130. mySQL="SELECT * FROM Accounts WHERE (ID='"& CusID & "')"
  131. CustomerID=CusID
  132. Set RS1 = conn.Execute(mySQL)
  133. editFlag = 1
  134. ID = RS1("id")
  135. AccountTitle = RS1("AccountTitle")
  136. CreditLimit = RS1("CreditLimit")
  137. IsPersonal = RS1("IsPersonal")
  138. IsADefault = RS1("IsADefault")
  139. EconomicalCode = RS1("EconomicalCode")
  140. CSR = RS1("CSR")
  141. CompanyName = RS1("CompanyName")
  142. AccType = RS1("Type")
  143. Status = RS1("Status")
  144. Postable1 = RS1("Postable1")
  145. Dear1 = RS1("Dear1")
  146. FirstName1 = RS1("FirstName1")
  147. LastName1 = RS1("LastName1")
  148. City1 = RS1("City1")
  149. Address1 = RS1("Address1")
  150. Tel1 = RS1("Tel1")
  151. Fax1 = RS1("Fax1")
  152. Email1 = RS1("Email1")
  153. Mobile1 = RS1("Mobile1")
  154. PostCode1 = RS1("PostCode1")
  155. Postable2 = RS1("Postable2")
  156. Dear2 = RS1("Dear2")
  157. FirstName2 = RS1("FirstName2")
  158. LastName2 = RS1("LastName2")
  159. City2 = RS1("City2")
  160. Address2 = RS1("Address2")
  161. Tel2 = RS1("Tel2")
  162. Fax2 = RS1("Fax2")
  163. Email2 = RS1("Email2")
  164. Mobile2 = RS1("Mobile2")
  165. PostCode2 = RS1("PostCode2")
  166. NorRCode = RS1("NorRCode")
  167. employee = RS1("employee")
  168. JobTitle1 = RS1("JobTitle1")
  169. JobTitle2 = RS1("JobTitle2")
  170. website = RS1("website")
  171. maxCreditDay = RS1("maxCreditDay")
  172. maxChequeDay = RS1("maxChequeDay")
  173. maxChequeAmount = RS1("maxChequeAmount")
  174. end if
  175. if request("act")="getAccount" or editFlag = 1 then
  176. if CSR = "" then CSR = session("ID")
  177. %>
  178. <!-- -->
  179. <FORM METHOD=POST ACTION="AccountEdit.asp?act=<% if editFlag = 0 then%>submitcustomer<%else%>submitEdit<%end if%>" onsubmit="if (document.all.AccountTitle.value=='') return false;">
  180. <br><br><INPUT TYPE="hidden" name=ID value=<%=ID%>>
  181. <table class="CustGenTable" Border="0" align='center' Width="600" Cellspacing="1" Cellpadding="5" Dir="RTL">
  182. <tr bgcolor='#C3C300'>
  183. <td align='center' colspan="6"><b>
  184. <% if editFlag = 0 then
  185. response.write " "& CusID
  186. else
  187. response.write " "& CusID
  188. end if %>
  189. </b></td>
  190. </tr>
  191. <tr>
  192. <td align='left' <% if not Auth(1,7) and editFlag=1 then response.write "title=' !'"%>><span <% if Auth(1,7) or editFlag=0 then response.write "onclick='setAccountTitle();'" %>> :</span></td>
  193. <td <% if not Auth(1,7) and editFlag=1 then response.write "title=' !'"%>>
  194. <INPUT class="CustGenInput" TYPE="text" NAME="AccountTitle" VALUE="<%=AccountTitle%>" size="20" MaxLength="200" <%if Not Auth(1,7) and editFlag=1 then response.write "readonly"%>>
  195. </td>
  196. <td align="left"> </td>
  197. <td align="right">
  198. <INPUT class="CustGenInput" TYPE="checkbox" NAME="IsPersonal" <% if IsPersonal then %> checked <% end if %> onclick='showCompanyName();'>
  199. </td>
  200. <td align="left">:</td>
  201. <td align="right">
  202. <%if Auth(1 , 4) then %>
  203. <select name="CSR" class="CustGenInput" style="width:90">
  204. <option value=""> </option>
  205. <% set RSV=Conn.Execute ("SELECT * FROM Users ORDER BY RealName") ' WHERE Display=1
  206. Do while not RSV.eof
  207. %>
  208. <option value="<%=RSV("ID")%>" <%
  209. if RSV("ID")=CSR then
  210. response.write " selected "
  211. end if
  212. %>><%=RSV("RealName")%></option>
  213. <%
  214. RSV.moveNext
  215. Loop
  216. RSV.close
  217. %>
  218. </select>
  219. <% else %>
  220. <%
  221. set RSV=Conn.Execute ("SELECT * FROM Users WHERE Display=1 ORDER BY RealName")
  222. Do while not RSV.eof
  223. if RSV("ID")=CSR then
  224. a = RSV("RealName")
  225. end if
  226. RSV.moveNext
  227. Loop
  228. RSV.close
  229. %>
  230. <INPUT TYPE="text" NAME="" value="<%=a%>" size=9 readonly>
  231. <INPUT TYPE="hidden" NAME="CSR" value="<%=CSR%>" size=9 readonly>
  232. <% end if %>
  233. </td >
  234. </tr>
  235. <tr>
  236. <td align='left'> : </td>
  237. <td align="right">
  238. <INPUT class="CustGenInput" TYPE="text" <% if IsPersonal then %> style="visibility:hidden;" <% end if %>NAME="CompanyName" value="<%=CompanyName%>" size="20">
  239. </td>
  240. <td align="left">:</td>
  241. <td align='right'>
  242. <select name="type" class="CustGenInput">
  243. <%
  244. set rs=Conn.Execute("select * from accountTypes")
  245. while not rs.eof
  246. response.write "<option "
  247. if CInt(AccType) = cint(rs("id")) then response.write " selected "
  248. response.write " value='" & rs("id") & "'>" & rs("name") & "</option>"
  249. rs.moveNext
  250. wend
  251. rs.close
  252. %>
  253. </select>
  254. </td>
  255. <td align='left'>:</td>
  256. <td align="right">
  257. <% if editFlag=0 then Status=1
  258. if Auth(1,5) then%>
  259. <select name="Status" class="CustGenInput">
  260. <option <% if Status = 1 then response.write "selected" %> value=1>
  261. <option <% if Status = 2 then response.write "selected" %> value=2>
  262. <option <% if Status = 3 then response.write "selected" %> value=3>
  263. </select>
  264. <%else
  265. select case Status
  266. Case 1: StatusText = ""
  267. Case 2: StatusText = ""
  268. Case 3: StatusText = ""
  269. end select
  270. %> <INPUT class="CustGenInput" TYPE="text" name="StatusText" value="<%=StatusText%>" size=12 readonly>
  271. <INPUT TYPE="Hidden" name="Status" value="<%=Status%>">
  272. <%end if%>
  273. </td>
  274. </tr>
  275. <tr>
  276. <td align="left">
  277. <input name="lblNorRCode" type="text" readonly value="<%If IsPersonal Then %> : <%Else%> : <%End if%>" size=10 style='background-color:transparent;border:0 transparent hidden;text-align:left;'>
  278. </td>
  279. <td align="right">
  280. <input class="CustGenInput" name="NorRCode" dir="ltr" value="<%=NorRCode%>" type="text" size="15" maxlength="20">
  281. </td>
  282. <td align="left"> : </td>
  283. <td align='right'>
  284. <INPUT class="CustGenInput" NAME="EconomicalCode" dir="ltr" value="<%=EconomicalCode%>" TYPE="text" size="10" maxlength="20" style="direction:LTR;">
  285. </td>
  286. <td align="left"> </td>
  287. <td align='right'>
  288. <INPUT class="CustGenInput" TYPE="checkbox" NAME="IsADefault" <% if IsADefault or editFlag<>1 then response.write "checked" %>>
  289. </td>
  290. </tr>
  291. <tr>
  292. <td align='left'> : </td>
  293. <td>
  294. <INPUT dir=LTR class="CustGenInput num" TYPE="text" name="CreditLimit" value="<%=separate(CreditLimit)%>" size="12" maxlength="15" <%if not Auth(1 , 4) then response.write "readonly" %>>
  295. </td>
  296. <td align='right'> : </td>
  297. <td>
  298. <input dir="ltr" lass="CustGenInput" TYPE="text" name="maxCreditDay" value="<%=separate(maxCreditDay)%>" size=3 <%if not Auth(1 , 4) then response.write "readonly" %>/>
  299. </td>
  300. <td align="left"> :</td>
  301. <td align="right">
  302. <select name="employee" id="employee" <% if IsPersonal then response.write " style='visibility:hidden;' " %> >
  303. <option value="0" <%if IsNull(employee) or employee=0 or IsPersonal then response.write " selected='selected' "%>> </option>
  304. <option value="1" <%if employee=1 then response.write " selected='selected' "%>>0 5 </option>
  305. <option value="2" <%if employee=2 then response.write " selected='selected' "%>>6 20 </option>
  306. <option value="3" <%if employee=3 then response.write " selected='selected' "%>>21 100 </option>
  307. <option value="4" <%if employee=4 then response.write " selected='selected' "%>>101 </option>
  308. </select>
  309. </td>
  310. </tr>
  311. <tr>
  312. <td align="left"> :</td>
  313. <td>
  314. <input name="maxChequeAmount" class="num" type="text" value="<%=separate(maxChequeAmount)%>" size="10" <%if not Auth(1 , 4) then response.write "readonly" %>/>
  315. </td>
  316. <td align="left"> :</td>
  317. <td align=right>
  318. <input name="maxChequeDay" class="num" type="text" value="<%=separate(maxChequeDay)%>" size="10" <%if not Auth(1 , 4) then response.write "readonly" %>/>
  319. </td>
  320. <td align="left"> :</td>
  321. <td align=right>
  322. <input class="CustGenInput" name="website" dir="ltr" value="<%=website%>" type="text" size="20" maxlength="100">
  323. </td>
  324. </tr>
  325. <tr bgcolor='#C3C300'>
  326. <td align='center' colspan='5'><b> </b></td>
  327. <td align='center'>
  328. <INPUT TYPE="checkbox" NAME="postable1" <% if postable1 then response.write "checked" %> >
  329. </td>
  330. </tr>
  331. <tr>
  332. <td align='center'>
  333. <BR>
  334. <SELECT class="CustGenInput" NAME="Dear1" style="width:70">
  335. <option value=""> </option>
  336. <option <% if Dear1="" then%> selected <% end if %>value=""></option>
  337. <option <% if Dear1="" then%> selected <% end if %> value=""></option>
  338. </SELECT>
  339. </td>
  340. <td colspan="3" align='center'>
  341. <BR>
  342. <span></span>
  343. <INPUT class="CustGenInput" NAME="FirstName1" value="<%=FirstName1%>" TYPE="text" size="13">
  344. <span></span>
  345. <INPUT class="CustGenInput" NAME="LastName1" value="<%=LastName1%>" TYPE="text" size="13">
  346. </td>
  347. <td align='center'>
  348. <span> </span>
  349. <BR>
  350. <INPUT class="CustGenInput" TYPE="text" NAME="City1" size="15" value="<%=City1%>">
  351. </td>
  352. <td align='center'>
  353. <span>ρ </span>
  354. <BR>
  355. <INPUT class="CustGenInput" TYPE="text" NAME="PostCode1" size="15" value="<%=PostCode1%>">
  356. </td>
  357. </tr>
  358. <tr>
  359. <td align='center' rowspan='3' colspan='4'>
  360. <span> </span>
  361. <BR><br>
  362. <TEXTAREA class="CustGenInput" NAME="Address1" ROWS="6" COLS="60"><%=Address1%></TEXTAREA>
  363. </td>
  364. <td valign='top' align='center'>
  365. <span></span>
  366. <BR>
  367. <INPUT class="CustGenInput" Dir="LTR" NAME="Tel1" value="<%=Tel1%>" TYPE="text" size="15">
  368. </td>
  369. <td valign='top' align='center'>
  370. <span></span>
  371. <BR>
  372. <INPUT class="CustGenInput" Dir="LTR" NAME="Fax1" value="<%=Fax1%>" TYPE="text" size="15">
  373. </td>
  374. </tr>
  375. <tr>
  376. <td align='center'>
  377. <span> </span>
  378. <BR>
  379. <INPUT class="CustGenInput" TYPE="text" Dir="LTR" NAME="Mobile1" size="15" value="<%=Mobile1%>">
  380. </td>
  381. <td valign='top' align='center'>
  382. <span></span>
  383. <BR>
  384. <INPUT class="CustGenInput" Dir="LTR" NAME="Email1" value="<%=Email1%>" TYPE="text" size="15" onkeyDown="return myKeyDownHandler();" onKeyPress="return myKeyPressHandler();">
  385. </td>
  386. </tr>
  387. <tr>
  388. <td colspan="2" align="center">
  389. <span> </span>
  390. <br>
  391. <input class="CustGenInput" type="text" dir="rtl" name="JobTitle1" value="<%=JobTitle1%>" size="40">
  392. </td>
  393. </tr>
  394. <tr bgcolor='#C3C300'>
  395. <td align='center' colspan='5'><b> </b></td>
  396. <td align='center'>
  397. <INPUT TYPE="checkbox" NAME="postable2" <% if postable2 then response.write "checked" %> >
  398. </td>
  399. </tr>
  400. <tr>
  401. <td align='center'>
  402. <BR>
  403. <SELECT class="CustGenInput" NAME="Dear2" style="width:70">
  404. <option value=""> </option>
  405. <option <% if Dear2="" then%> selected <% end if %>value=""></option>
  406. <option <% if Dear2="" then%> selected <% end if %> value=""></option>
  407. </SELECT>
  408. </td>
  409. <td colspan=3 align='center'>
  410. <BR>
  411. <span> </span>
  412. <INPUT class="CustGenInput" NAME="FirstName2" value="<%=FirstName2%>" TYPE="text" size="13">
  413. <span></span>
  414. <INPUT class="CustGenInput" NAME="LastName2" value="<%=LastName2%>" TYPE="text" size="13">
  415. </td>
  416. <td align='center'>
  417. <span> </span>
  418. <BR>
  419. <INPUT class="CustGenInput" TYPE="text" NAME="City2" size="15" value="<%=City2%>">
  420. </td>
  421. <td align='center'>
  422. <span>ρ </span>
  423. <BR>
  424. <INPUT class="CustGenInput" TYPE="text" NAME="PostCode2" size="15" value="<%=PostCode2%>">
  425. </td>
  426. </tr>
  427. <tr>
  428. <td align='center' rowspan='3' colspan='4'>
  429. <span> </span>
  430. <BR>
  431. <TEXTAREA class="CustGenInput" NAME="Address2" ROWS="6" COLS="60"><%=Address2%></TEXTAREA>
  432. </td>
  433. <td valign='top' align='center'>
  434. <span></span>
  435. <BR>
  436. <INPUT class="CustGenInput" Dir="LTR" NAME="Tel2" value="<%=Tel2%>" TYPE="text" size="15">
  437. </td>
  438. <td valign='top' align='center'>
  439. <span></span>
  440. <BR>
  441. <INPUT class="CustGenInput" Dir="LTR" NAME="Fax2" value="<%=Fax2%>" TYPE="text" size="15">
  442. </td>
  443. </tr>
  444. <tr>
  445. <td align='center'>
  446. <span> </span>
  447. <BR>
  448. <INPUT class="CustGenInput" TYPE="text" Dir="LTR" NAME="Mobile2" size="15" value="<%=Mobile2%>">
  449. </td>
  450. <td valign='top' align='center'>
  451. <span></span>
  452. <BR>
  453. <INPUT class="CustGenInput" Dir="LTR" NAME="Email2" value="<%=Email2%>" TYPE="text" size="15" onkeyDown="return myKeyDownHandler();" onKeyPress="return myKeyPressHandler();">
  454. </td>
  455. </tr>
  456. <tr>
  457. <td colspan="2" align="center">
  458. <span> </span>
  459. <br>
  460. <input class="CustGenInput" type="text" dir="rtl" name="JobTitle2" value="<%=JobTitle2%>" size="40">
  461. </td>
  462. </tr>
  463. <%' ----------------------------S A M E D I T ----------------------------------------
  464. %>
  465. <tr bgcolor='#C3C300'>
  466. <td align='center' colspan='6'><b> </b></td>
  467. </tr>
  468. <tr>
  469. <td colspan=6>
  470. <table>
  471. <%
  472. accountGroup=0
  473. IF CusID <>"" then
  474. mySQL="select * from accountGroupRelations where account="&CusID
  475. set RSV=conn.Execute(mySQL)
  476. if not RSV.eof then accountGroup=RSV("AccountGroup")
  477. RSV.close
  478. set RSV=nothing
  479. end if
  480. col=0
  481. oldState="True"
  482. set RSV=Conn.Execute ("SELECT * FROM accountGroups ORDER BY isPartner DESC, Name")
  483. Do while not RSV.eof
  484. if (RSV("isPartner")<>oldState) then
  485. if col <> 0 then
  486. col = 0
  487. response.write "</tr>"
  488. end if
  489. end if
  490. if (col = 0) then response.write "<tr>"
  491. col=col+1
  492. %>
  493. <td <%
  494. if RSV("isPartner")="True" then response.write "bgcolor='#C33300'"%> >
  495. <INPUT type='radio' name='accountGroup'
  496. <% if RSV("ID")=accountGroup then response.write(" CHECKED ")%>
  497. value='<%=RSV("ID")%>'>
  498. <%=RSV("name")%>
  499. </td>
  500. <%
  501. if col=4 then
  502. response.write "</tr>"
  503. col=0
  504. end if
  505. oldState = RSV("isPartner")
  506. RSV.moveNext
  507. Loop
  508. RSV.close
  509. set RSV=nothing
  510. %>
  511. </table>
  512. </td>
  513. </tr>
  514. <tr bgcolor='#C3C300'>
  515. <td align='center' colspan='6'><b></b></td>
  516. </tr>
  517. <tr>
  518. <td colspan="6">
  519. <table>
  520. <%
  521. if CLng(CusID)>0 then
  522. set rs=Conn.Execute("select * from accountGroupRelations where account=" & CusID)
  523. if rs.eof then
  524. %>
  525. <tr>
  526. <td><b>! </b></td>
  527. </tr>
  528. <%
  529. else
  530. group=rs("accountGroup")
  531. rs.close
  532. set rs=Conn.Execute("select * from account_questions where [group]=" & group)
  533. if rs.eof then
  534. %>
  535. <tr>
  536. <td><b> </b></td>
  537. </tr>
  538. <%
  539. else
  540. while not rs.eof
  541. %>
  542. <tr>
  543. <td><%=rs("name")%><input name="questionID" type="hidden" value="<%=rs("id")%>"></td>
  544. <td>
  545. <%
  546. 'response.write ("select * from account_answers where account_id=" & CusID & " and question=" & rs("id"))
  547. set rss=Conn.Execute("select * from account_answers where account_id=" & CusID & " and question=" & rs("id"))
  548. if CInt(rs("type"))=0 then
  549. %>
  550. <input name="answer" type="text" <%if not rss.eof then response.write (" value='" & rss("answer") & "'")%>>
  551. <%
  552. elseif CInt(rs("type"))=1 then
  553. %>
  554. <select name="answer">
  555. <%
  556. choice=Split(rs("choice"),",")
  557. for i=0 to UBound(choice)
  558. %>
  559. <option value="<%=trim(choice(i))%>" <%if not rss.eof then if rss("answer")=choice(i) then response.write(" selected ")%>><%=choice(i)%></option>
  560. <%
  561. next
  562. %>
  563. </select>
  564. <%
  565. end if
  566. rss.close
  567. %>
  568. </td>
  569. </tr>
  570. <%
  571. rs.moveNext
  572. wend
  573. rs.close
  574. end if
  575. end if
  576. end if
  577. %>
  578. </table>
  579. </td>
  580. </tr>
  581. <%' ----------------------------S A M E D I T ----------------------------------------
  582. %>
  583. <tr bgcolor='#C3C300'>
  584. <td align='center' colspan="6">
  585. <INPUT class="CustGenInput" TYPE="submit" NAME="submit" value="">
  586. <% if request("act")="editaccount" then %>
  587. <INPUT class="CustGenInput" TYPE="submit" NAME="submit" value=" ">
  588. <% end if %>
  589. </td>
  590. </tr>
  591. <tr>
  592. <td colspan="6">&nbsp;</td>
  593. </tr>
  594. <tr bgcolor='#C3C300'>
  595. <td align='center' colspan="6"><b> </b></td>
  596. </tr>
  597. <tr dir="LTR">
  598. <td align='center' colspan="6">
  599. <% OLD_ACID = ID%>
  600. <!--#include File="include_OldCusData.asp"-->
  601. </td>
  602. </tr>
  603. </table>
  604. </FORM>
  605. <SCRIPT LANGUAGE="JavaScript">
  606. <!--
  607. //document.all.Name.focus();
  608. //-->
  609. </SCRIPT>
  610. <%
  611. elseif request("act")="submitEdit" then
  612. EditDate = shamsiToday()
  613. EditBy = session("ID")
  614. ID = sqlSafe(Request.form("id"))
  615. AccountTitle = left(sqlSafe(Request.form("AccountTitle")) , 200) ' Field width is 200
  616. IsPersonal = sqlSafe(Request.form("IsPersonal"))
  617. IsADefault = sqlSafe(Request.form("IsADefault"))
  618. EconomicalCode = left(sqlSafe(Request.form("EconomicalCode")) , 20)
  619. CompanyName = left(sqlSafe(Request.form("CompanyName")) , 50)
  620. NorRCode = Left(sqlSafe(Request.Form("NorRCode")) , 20)
  621. Postable1 = sqlSafe(Request.form("Postable1"))
  622. Dear1 = left(sqlSafe(Request.form("Dear1")) , 20)
  623. FirstName1 = left(sqlSafe(Request.form("FirstName1")) , 50)
  624. LastName1 = left(sqlSafe(Request.form("LastName1")) , 50)
  625. JobTitle1 = left(sqlSafe(Request.form("JobTitle1")) , 50)
  626. Tel1 = left(sqlSafe(Request.form("Tel1")) , 50)
  627. Mobile1 = left(sqlSafe(Request.form("Mobile1")) , 50)
  628. Fax1 = left(sqlSafe(Request.form("Fax1")) , 50)
  629. Email1 = left(sqlSafe(Request.form("Email1")) , 50)
  630. City1 = left(sqlSafe(Request.form("City1")) , 50)
  631. Address1 = left(sqlSafe(Request.form("Address1")) , 255)
  632. PostCode1 = left(sqlSafe(Request.form("PostCode1")) , 50)
  633. Postable2 = sqlSafe(Request.form("Postable2"))
  634. Dear2 = left(sqlSafe(Request.form("Dear2")) , 20)
  635. FirstName2 = left(sqlSafe(Request.form("FirstName2")) , 50)
  636. LastName2 = left(sqlSafe(Request.form("LastName2")) , 50)
  637. JobTitle2 = left(sqlSafe(Request.form("JobTitle2")) , 50)
  638. Tel2 = left(sqlSafe(Request.form("Tel2")) , 50)
  639. Mobile2 = left(sqlSafe(Request.form("Mobile2")) , 50)
  640. Fax2 = left(sqlSafe(Request.form("Fax2")) , 50)
  641. Email2 = left(sqlSafe(Request.form("Email2")) , 50)
  642. City2 = left(sqlSafe(Request.form("City2")) , 50)
  643. Address2 = left(sqlSafe(Request.form("Address2")) , 255)
  644. PostCode2 = left(sqlSafe(Request.form("PostCode2")) , 50)
  645. CreditLimit = cdbl(text2value(Request.form("CreditLimit")))
  646. accountGroup = cdbl(text2value(request.form("accountGroup")))
  647. employee = cint(text2value(request.form("employee")))
  648. website = left(sqlSafe(Request.form("website")) , 100)
  649. maxCreditDay = cdbl(text2value(Request.form("maxCreditDay")))
  650. maxChequeDay = cdbl(text2value(Request.form("maxChequeDay")))
  651. maxChequeAmount = cdbl(text2value(Request.form("maxChequeAmount")))
  652. if not Auth(1 , 4) then ' Doesn't have the permission to set CSR / credit limit
  653. CSR = ""
  654. else
  655. CSR = cint(sqlSafe(Request.form("CSR")))
  656. mySQL="SELECT RealName FROM Users WHERE (ID = "& CSR & ")"
  657. Set RS1=Conn.Execute(mySQL)
  658. if RS1.eof then
  659. Conn.close
  660. response.redirect "?msg=" & Server.URLEncode(" .")
  661. else
  662. NewCSRName= RS1("RealName")
  663. end if
  664. RS1.close
  665. mySQL="SELECT Accounts.CSR, Users.RealName, Accounts.CreditLimit, Accounts.maxCreditDay, Accounts.maxChequeDay, Accounts.maxChequeAmount FROM Accounts INNER JOIN Users ON Accounts.CSR = Users.ID WHERE (Accounts.ID = "& ID & ")"
  666. Set RS1=Conn.Execute(mySQL)
  667. if RS1.eof then
  668. Conn.close
  669. response.redirect "?msg=" & Server.URLEncode(" .")
  670. else
  671. OldCreditLimit= cdbl(RS1("CreditLimit"))
  672. oldMaxCreditDay = CDbl(rs1("maxCreditDay"))
  673. oldMaxChequeDay = CDbl(rs1("maxChequeDay"))
  674. oldMaxChequeAmount = CDbl(rs1("maxChequeAmount"))
  675. OldCSRID= cint(RS1("CSR"))
  676. OldCSRName= RS1("RealName")
  677. end if
  678. RS1.close
  679. Set RS1=Nothing
  680. if OldCSRID <> CSR OR OldCreditLimit <> CreditLimit or maxChequeDay<>oldMaxChequeDay or oldMaxCreditDay<>maxCreditDay or oldMaxChequeAmount<>maxChequeAmount then
  681. mySQL = "SELECT [User] as ID, OnAccountCSRChangeSendMessageTo FROM UserDefaults WHERE (([User] = "& session("ID") & ") OR (UserDefaults.[User] = 0)) AND (OnAccountCSRChangeSendMessageTo IS NOT NULL) ORDER BY ABS(UserDefaults.[User]) DESC"
  682. Set RS2 = Conn.Execute (mySQL)
  683. MessageTo=RS2("OnAccountCSRChangeSendMessageTo")
  684. RS2.close
  685. Set RS2 = Nothing
  686. msg = "" '" " & session("CSRName") & " "
  687. tmpAnd = ""
  688. if OldCSRID <> CSR then
  689. msg= " '" & OldCSRName & "' '" & NewCSRName & "' "
  690. tmpAnd = " "
  691. end if
  692. if OldCreditLimit <> CreditLimit then
  693. msg = msg & tmpAnd & " '" & Separate(OldCreditLimit) & "' '" & Separate(CreditLimit) & "' "
  694. tmpAnd = " "
  695. end if
  696. if maxCreditDay<>oldMaxCreditDay then
  697. msg = msg & tmpAnd & " " & Separate(oldMaxCreditDay) & " " & Separate(maxCreditDay) & " "
  698. tmpAnd = " "
  699. end if
  700. if maxChequeAmount<>oldMaxChequeAmount then
  701. msg = msg & tmpAnd & " " & Separate(oldMaxChequeAmount) & " " & Separate(maxChequeAmount) & " "
  702. tmpAnd = " "
  703. end if
  704. if maxChequeDay<>oldMaxChequeDay then
  705. msg = msg & tmpAnd & " " & Separate(oldMaxChequeDay) & " " & Separate(maxChequeDay) & " "
  706. tmpAnd = " "
  707. end if
  708. msg = msg & " ."
  709. MsgTo = MessageTo
  710. msgTitle = "Account changed"
  711. msgBody = sqlSafe(msg)
  712. RelatedTable = "accounts"
  713. relatedID = ID
  714. replyTo = 0
  715. IsReply = 0
  716. urgent = 1
  717. MsgFrom = session("ID")
  718. MsgDate = shamsiToday()
  719. MsgTime = currentTime10()
  720. mySQL="INSERT INTO Messages (MsgFrom, MsgTo, MsgTime, MsgDate, IsRead, MsgTitle, MsgBody, replyTo, IsReply, relatedID, RelatedTable, urgent) VALUES ( "& MsgFrom & ", "& MsgTo & ", N'"& MsgTime & "', N'"& MsgDate & "', 0, N'"& MsgTitle & "', N'"& MsgBody & "', "& replyTo & ", "& IsReply & ", "& relatedID & ", '"& RelatedTable & "', "& urgent & ")"
  721. Conn.Execute (mySQL)
  722. end if
  723. end if
  724. AccType = sqlSafe(Request.form("Type"))
  725. Status = sqlSafe(Request.form("Status"))
  726. 'ACCID = sqlSafe(Request.form("ACCID"))
  727. ' ----------------------------S A M E D I T ----------------------------------------
  728. mySQL="select * from AccountGroupRelations where account="&id
  729. set rs1= Conn.Execute(mySQL)
  730. if rs1.eof then
  731. oldAccountGroup=0
  732. else
  733. oldAccountGroup=rs1("AccountGroup")
  734. end if
  735. rs1.close
  736. set rs1=nothing
  737. ' ----------------------------S A M E D I T ----------------------------------------
  738. if IsPersonal="on" then
  739. IsPersonal=1
  740. CompanyName=""
  741. else
  742. IsPersonal=0
  743. end if
  744. if IsADefault="on" then
  745. IsADefault=1
  746. else
  747. IsADefault=0
  748. end if
  749. if Postable1="on" then
  750. Postable1=1
  751. else
  752. Postable1=0
  753. end if
  754. if Postable2="on" then
  755. Postable2=1
  756. else
  757. Postable2=0
  758. end if
  759. ' Added By kid 820727
  760. ' -------------------------------
  761. ' Log The Edition Before Updating
  762. conn.Execute("INSERT INTO AccountsEditLog SELECT '"& EditDate & "' AS EditedOn, '"& EditBy & "' AS EditedBy, * FROM Accounts WHERE (ID = "& ID & ")")
  763. ' End of Log
  764. ' -------------------------------
  765. if CSR="" then
  766. mySQL="UPDATE Accounts SET LastEditOn='"& EditDate & "', LastEditBy='"& EditBy& "', Type ="&AccType & ", Status ="&Status & ", AccountTitle =N'"& AccountTitle& "', Postable1 = "& Postable1 & ", Postable2 = "& Postable2 & ", IsADefault = "& IsADefault & ", EconomicalCode =N'"& EconomicalCode& "', IsPersonal ="& IsPersonal& ", CompanyName =N'"& CompanyName& "', Dear1 =N'"& Dear1& "', FirstName1 =N'"& FirstName1& "', LastName1 =N'"& LastName1& "', JobTitle1 =N'"& JobTitle1& "', Tel1 =N'"& Tel1& "', Fax1 =N'"& Fax1& "', EMail1 =N'"& EMail1& "', Mobile1 =N'"& Mobile1& "', PostCode1 =N'"& PostCode1& "', City1 =N'"& City1& "', Address1 =N'"& Address1& "', Dear2 =N'"& Dear2& "', FirstName2 =N'"& FirstName2& "', LastName2 =N'"& LastName2& "', JobTitle2 =N'"& JobTitle2 & "', Tel2 =N'"& Tel2& "', Fax2 =N'"& Fax2& "', EMail2 =N'"& EMail2& "', Mobile2 =N'"& Mobile2& "', PostCode2 =N'"& PostCode2& "', City2 =N'"& City2& "', Address2 =N'"& Address2& "', NorRCode = N'" & NorRCode & "' , employee=" & employee & ",website=N'" & website & "' WHERE (ID = "& ID & ")"
  767. else
  768. mySQL="UPDATE Accounts SET CSR ="& CSR & ", LastEditOn='"& EditDate & "', LastEditBy='"& EditBy& "', Type ="&AccType & ", Status ="&Status & ", AccountTitle =N'"& AccountTitle& "', Postable1 = "& Postable1 & ", Postable2 = "& Postable2 & ", IsADefault = "& IsADefault & ", EconomicalCode =N'"& EconomicalCode& "', CreditLimit="& CreditLimit & ", IsPersonal ="& IsPersonal& ", CompanyName =N'"& CompanyName& "', Dear1 =N'"& Dear1& "', FirstName1 =N'"& FirstName1& "', LastName1 =N'"& LastName1& "', JobTitle1 =N'"& JobTitle1& "', Tel1 =N'"& Tel1& "', Fax1 =N'"& Fax1& "', EMail1 =N'"& EMail1& "', Mobile1 =N'"& Mobile1& "', PostCode1 =N'"& PostCode1& "', City1 =N'"& City1& "', Address1 =N'"& Address1& "', Dear2 =N'"& Dear2& "', FirstName2 =N'"& FirstName2& "', LastName2 =N'"& LastName2& "', JobTitle2 =N'"& JobTitle2 & "', Tel2 =N'"& Tel2& "', Fax2 =N'"& Fax2& "', EMail2 =N'"& EMail2& "', Mobile2 =N'"& Mobile2& "', PostCode2 =N'"& PostCode2& "', City2 =N'"& City2& "', Address2 =N'"& Address2& "', NorRCode = N'" & NorRCode & "',employee=" & employee & ",website=N'" & website & "',maxCreditDay = " & maxCreditDay & ",maxChequeDay=" & maxChequeDay & ", maxChequeAmount=" & maxChequeAmount & " WHERE (ID = "& ID & ")"
  769. end If
  770. 'response.write mySQL
  771. 'response.end
  772. conn.Execute(mySQL)
  773. ' ----------------------------S A M E D I T ----------------------------------------
  774. ' response.write oldAccountGroup&"<br>"&accountGroup&"<br>"&id&"<br>"
  775. if oldAccountGroup<>accountGroup then
  776. conn.Execute("DELETE FROM AccountGroupRelations where account="&id&" AND AccountGroup="&oldAccountGroup)
  777. conn.Execute("INSERT INTO AccountGroupRelations (Account,AccountGroup) VALUES ("&id&","&accountGroup&")")
  778. end if
  779. questionID=split(request.form("questionID"),",")
  780. 'response.write (request.form("questionID"))
  781. answers=split(request("answer"), ",")
  782. set rs=Conn.Execute("select account_answers.* from account_answers inner join account_questions on account_questions.id=account_answers.question where account_questions.[group]=" & accountGroup & " and account_answers.account_id=" & id)
  783. while not rs.eof
  784. answer=""
  785. for i=0 to UBound(questionID)
  786. if cint(rs("id"))=cint(questionID(i)) then answer=trim(answers(i))
  787. 'response.write rs("id") &","&questionID(i)&","& answers(i)&"<br>"
  788. 'response.write answer
  789. next
  790. 'response.end
  791. Conn.Execute("update account_answers set answer=N'" & answer & "' where id=" & rs("id"))
  792. 'response.write("update account_answers set answer=N'" & answer & "' where id=" & rs("id") &"<br>")
  793. rs.moveNext
  794. wend
  795. 'response.end
  796. rs.close
  797. set rs=Conn.Execute("select * from account_questions where [group]=" & accountGroup & " and id not in (select question from account_answers where account_id=" & id & ")")
  798. while not rs.eof
  799. answer=""
  800. 'response.w
  801. for i=0 to UBound(questionID)
  802. if cint(rs("id"))=cint(questionID(i)) then answer=trim(answers(i))
  803. next
  804. Conn.Execute("insert into account_answers (question,answer,account_id) values (" & rs("id") & ",N'" & answer & "'," & id & ")")
  805. rs.moveNext
  806. wend
  807. rs.close
  808. ' ----------------------------S A M E D I T ----------------------------------------
  809. if request("submit")=" " then
  810. response.redirect "AccountEdit.asp?act=editaccount&NextOf=" & ID & "&msg=" & Server.URLEncode(" .")
  811. else
  812. response.redirect "AccountInfo.asp?act=show&selectedCustomer=" & ID & "&msg=" & Server.URLEncode(" .")
  813. end if
  814. elseif request("act")="submitcustomer" then
  815. CreatedDate = shamsiToday()
  816. CreatedBy = session("ID")
  817. AccountTitle = left(sqlSafe(Request.form("AccountTitle")) , 200) ' Field width is 200
  818. CreditLimit = text2value(Request.form("CreditLimit"))
  819. IsPersonal = sqlSafe(Request.form("IsPersonal"))
  820. IsADefault = sqlSafe(Request.form("IsADefault"))
  821. EconomicalCode = left(sqlSafe(Request.form("EconomicalCode")) , 20)
  822. CompanyName = left(sqlSafe(Request.form("CompanyName")) , 50)
  823. NorRCode = Left(sqlSafe(Request.Form("NorRCode")) , 20)
  824. Postable1 = sqlSafe(Request.form("Postable1"))
  825. Dear1 = left(sqlSafe(Request.form("Dear1")) , 20)
  826. FirstName1 = left(sqlSafe(Request.form("FirstName1")) , 50)
  827. LastName1 = left(sqlSafe(Request.form("LastName1")) , 50)
  828. JobTitle1 = left(sqlSafe(Request.form("JobTitle1")) , 50)
  829. Tel1 = left(sqlSafe(Request.form("Tel1")) , 50)
  830. Mobile1 = left(sqlSafe(Request.form("Mobile1")) , 50)
  831. Fax1 = left(sqlSafe(Request.form("Fax1")) , 50)
  832. Email1 = left(sqlSafe(Request.form("Email1")) , 50)
  833. City1 = left(sqlSafe(Request.form("City1")) , 50)
  834. Address1 = left(sqlSafe(Request.form("Address1")) , 255)
  835. PostCode1 = left(sqlSafe(Request.form("PostCode1")) , 50)
  836. Postable2 = sqlSafe(Request.form("Postable2"))
  837. Dear2 = left(sqlSafe(Request.form("Dear2")) , 20)
  838. FirstName2 = left(sqlSafe(Request.form("FirstName2")) , 50)
  839. LastName2 = left(sqlSafe(Request.form("LastName2")) , 50)
  840. JobTitle2 = left(sqlSafe(Request.form("JobTitle2")) , 50)
  841. Tel2 = left(sqlSafe(Request.form("Tel2")) , 50)
  842. Mobile2 = left(sqlSafe(Request.form("Mobile2")) , 50)
  843. Fax2 = left(sqlSafe(Request.form("Fax2")) , 50)
  844. Email2 = left(sqlSafe(Request.form("Email2")) , 50)
  845. City2 = left(sqlSafe(Request.form("City2")) , 50)
  846. Address2 = left(sqlSafe(Request.form("Address2")) , 255)
  847. PostCode2 = left(sqlSafe(Request.form("PostCode2")) , 50)
  848. CreditLimit = cdbl(text2value(Request.form("CreditLimit")))
  849. accountGroup = cdbl(text2value(request.form("accountGroup")))
  850. employee = cint(text2value(request.form("employee")))
  851. website = left(sqlSafe(Request.form("website")) , 100)
  852. if not Auth(1 , 4) then ' Doesn't have the permission to set CSR / credit limit
  853. CreditLimit = 0
  854. CSR = 0
  855. maxCreditDay= 0
  856. maxChequeDay= 0
  857. maxChequeAmount=50000000
  858. else
  859. CSR = cint(sqlSafe(Request.form("CSR")))
  860. maxCreditDay = cdbl(text2value(Request.form("maxCreditDay")))
  861. maxChequeDay = cdbl(text2value(Request.form("maxChequeDay")))
  862. maxChequeAmount = cdbl(text2value(Request.form("maxChequeAmount")))
  863. end if
  864. AccType = sqlSafe(Request.form("Type"))
  865. Status = sqlSafe(Request.form("Status"))
  866. 'ACCID = Request.form("ACCID")
  867. if IsPersonal="on" then
  868. IsPersonal=1
  869. else
  870. IsPersonal=0
  871. end if
  872. if IsADefault="on" then
  873. IsADefault=1
  874. else
  875. IsADefault=0
  876. end if
  877. if Postable1="on" then
  878. Postable1=1
  879. else
  880. Postable1=0
  881. end if
  882. if Postable2="on" then
  883. Postable2=1
  884. else
  885. Postable2=0
  886. end if
  887. mySQL="SELECT MAX(ID) AS MaxID FROM Accounts WHERE ([ID] <900000)"
  888. Set RS1=Conn.Execute(mySQL)
  889. NewAccID=RS1("MAXID")+1
  890. RS1.close
  891. Set RS1=Nothing
  892. mySQL="INSERT INTO Accounts (ID, CreatedDate, CreatedBy, LastEditOn, LastEditBy, CSR, IsADefault, EconomicalCode, Type, AccountTitle, IsPersonal, CompanyName, Postable1, Dear1, FirstName1, LastName1, JobTitle1, Tel1, Fax1, EMail1, Mobile1, PostCode1, City1, Address1, Postable2, Dear2, FirstName2, LastName2, JobTitle2, Tel2, Fax2, EMail2, Mobile2, PostCode2, City2, Address2, NorRCode, employee, website,maxCreditDay, maxChequeDay, maxChequeAmount) VALUES ("&_
  893. NewAccID & ", N'"& CreatedDate & "', "& CreatedBy & ", N'"& CreatedDate & "', "& CreatedBy & ", "& CSR & ", "& IsADefault & ", N'"& EconomicalCode & "', "& AccType & ", N'"& AccountTitle & "',"& IsPersonal & ", N'"& CompanyName & "', " & Postable1 & ", N'"& Dear1 & "', N'"& FirstName1 & "', N'"& LastName1 & "', N'"& JobTitle1 & "', N'"& Tel1 & "', N'"& Fax1 & "', N'"& Email1 & "', N'"& Mobile1 & "', N'"& PostCode1 & "', N'"& City1 & "', N'"& Address1 & "', " & Postable2 & ",N'"& Dear2 & "', N'"& FirstName2 & "', N'"& LastName2 & "', N'"& JobTitle2 & "', N'"& Tel2 & "', N'"& Fax2 & "', N'"& Email2 & "', N'"& Mobile2 & "', N'"& PostCode2 & "', N'"& City2 & "', N'"& Address2 & "', N'" & NorRCode & "', " & employee & ",N'" & website & "'," & maxCreditDay & "," & maxChequeDay & "," & maxChequeAmount & ")"
  894. conn.Execute(mySQL)
  895. ' Added By kid 820727
  896. ' -------------------------------
  897. ' Log The Insertion
  898. conn.Execute("INSERT INTO AccountsEditLog SELECT '"& CreatedDate & "' AS EditedOn, '"& CreatedBy & "' AS EditedBy,* FROM Accounts WHERE (ID = "& NewAccID & ")")
  899. ' End of Log
  900. ' -------------------------------
  901. response.redirect "AccountInfo.asp?act=show&selectedCustomer=" & NewAccID & "&msg=" & Server.URLEncode(" .")
  902. %>
  903. <!-- -->
  904. <div dir='rtl' align=center><B> ...</B><br><br>
  905. </div>
  906. <%
  907. response.end
  908. RS1.close
  909. else if request("act")="" then %>
  910. <!-- -->
  911. <BR><BR>
  912. <FORM METHOD=POST ACTION="AccountEdit.asp?act=submitsearch" onsubmit="if (document.all.CustomerNameSearchBox.value=='') return false;">
  913. <div dir='rtl'>&nbsp;&nbsp;<B> : </B>
  914. <INPUT TYPE="text" NAME="CustomerNameSearchBox">&nbsp;
  915. <INPUT TYPE="submit" value=""><br>
  916. </div>
  917. </FORM>
  918. <BR>
  919. <SCRIPT LANGUAGE="JavaScript">
  920. <!--
  921. document.all.CustomerNameSearchBox.focus();
  922. //-->
  923. </SCRIPT>
  924. <%
  925. end if
  926. end if
  927. conn.Close
  928. %>
  929. </font>
  930. <br>
  931. <script language="JavaScript">
  932. <!--
  933. function setAccountTitle(){
  934. with (document.all){
  935. if (IsPersonal.checked){
  936. AccountTitle.value= Dear1.value + " " +FirstName1.value + " " +LastName1.value + " "
  937. }
  938. else{
  939. if(Dear1.value+FirstName1.value+LastName1.value != ''){
  940. AccountTitle.value=CompanyName.value + " (" + Dear1.value + " " +FirstName1.value + " " +LastName1.value + ")"
  941. }
  942. else{
  943. AccountTitle.value=CompanyName.value
  944. }
  945. }
  946. }
  947. }
  948. function showCompanyName(){
  949. if (document.all.IsPersonal.checked){
  950. document.all.CompanyName.style.visibility="hidden";
  951. document.all.lblNorRCode.value=" :";
  952. document.all.employee.style.visibility="hidden";
  953. }
  954. else{
  955. document.all.CompanyName.style.visibility="visible"
  956. document.all.CompanyName.focus();
  957. document.all.lblNorRCode.value=" :";
  958. document.all.employee.style.visibility="visible";
  959. }
  960. }
  961. //-->
  962. </script>
  963. <!--#include file="tah.asp" -->