home *** CD-ROM | disk | FTP | other *** search
/ 202.53.64.216 / 202.53.64.216.tar / 202.53.64.216 / janahitha / Admin / AdsAdminUpdateAccount.asp < prev    next >
Text File  |  2004-11-26  |  6KB  |  146 lines

  1. <!-- #include file="../AdsOpenConn.asp" -->
  2. <%
  3.     if session("AdminLogin")="" then Response.Redirect "default.asp"
  4. %>
  5.  
  6. <%
  7.     dim accid
  8.     accid=Request.Form("accid")
  9.     name=Request.Form("name")
  10.     'if request.form.count=0 then
  11.     if accid <> "" and name <> "" then
  12.  
  13.     set objrs = server.CreateObject("adodb.recordset")
  14.         objrs.Open "select ClientName, ClientAddress, ClientCity, ClientState, ClientPincode, ClientPhone, ClientEmail, ClientFax, ClientContactPerson from AccClientDetails where accid="+ accid +" and clientname='"+name+"'", con, 3, 3
  15. %>
  16. <html>
  17.     <head>
  18.         <title> Janahitha Ads - Update Account </title>
  19.         <meta name="author" content="Jagadish">
  20.         <script language="javascript" src="../func.js"></script>
  21.         <script language="javascript">
  22.         function check()
  23.         {
  24.             validateform = document.updateprofileform;
  25.             if(isempty(validateform.name))
  26.                 validateform.name.focus();
  27.             else
  28.             if(isempty(validateform.address))
  29.                 validateform.address.focus();
  30.             else
  31.             if(isempty(validateform.city))
  32.                 validateform.city.focus();
  33.             else
  34.             if(isempty(validateform.state))
  35.                 validateform.state.focus();
  36.             else
  37.             if(isempty(validateform.pincode))
  38.                 validateform.pincode.focus();
  39.             else
  40.             if(!(ispin(validateform.pincode)))
  41.                 validateform.pincode.focus();
  42.             else
  43.             if(isempty(validateform.phone))
  44.                 validateform.phone.focus();
  45.             else
  46.             if(!(isemail(validateform.email)))
  47.                 validateform.email.focus();
  48.             else
  49.                 validateform.submit();
  50.         }
  51.         </script>
  52.     </head>
  53.     <body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
  54.         <!-- #include file="AdsTop.asp" --> 
  55.         <center>
  56.         <table width=780 cellpadding=0 cellspacing=0 border=0 height=340>
  57.         <tr>
  58.             <td width=150 align=center valign=top bgcolor="#f2D197">
  59.                 <!-- #include file="AdsLeft.asp" -->
  60.             </td>
  61.             <td width=630 align=center valign=top bgcolor="#ffffff">
  62.                 <br>
  63.                 <form name="updateprofileform" method=post action="<%=request.servervariables("script_name")%>">
  64.                 <font face="verdana" color="#99603E"> <b> Update Profile </b> </font> <br> <br>
  65.                 <table cellpadding=0 cellspacing=0 border=0>
  66.                 <tr> <td bgcolor="#47AF59">
  67.                 <table cellspacing=1 cellpadding=3 border=0 width=300>
  68.                 <tr bgcolor="#ffffff">
  69.                     <td> <font face="verdana" size=2> Login Id </font> </td>
  70.                     <td> <font face="verdana" size=2> <b> <%=session("ClientLoginId")%> </b> </font> </td>
  71.                 </tr>
  72.                 <tr bgcolor="#ffffff">
  73.                     <td> <font face="verdana" size=2> Name </font> </td>
  74.                     <td> <input type=text name="name" size="15" maxlength=50 value="<%=objrs("ClientName")%>"> </td>
  75.                 </tr>
  76.                 <tr bgcolor="#ffffff">
  77.                     <td> <font face="verdana" size=2> Address </font> </td>
  78.                     <td> <input type=text name="address" size="15" maxlength=200 value="<%=objrs("ClientAddress")%>"> </td>
  79.                 </tr>
  80.                 <tr bgcolor="#ffffff">
  81.                     <td> <font face="verdana" size=2> City </font> </td>
  82.                     <td> <input type=text name="city" size="15" maxlength=50 value="<%=objrs("ClientCity")%>"> </td>
  83.                 </tr>
  84.                 <tr bgcolor="#ffffff">
  85.                     <td> <font face="verdana" size=2> State </font> </td>
  86.                     <td> <input type=text name="state" size="15" maxlength=50 value="<%=objrs("ClientState")%>"> </td>
  87.                 </tr>
  88.                 <tr bgcolor="#ffffff">
  89.                     <td> <font face="verdana" size=2> Pin </font> </td>
  90.                     <td> <input type=text name="pincode" size="15" maxlength=6 value="<%=objrs("ClientPincode")%>"> </td>
  91.                 </tr>
  92.                 <tr bgcolor="#ffffff">
  93.                     <td> <font face="verdana" size=2> Phone </font> </td>
  94.                     <td> <input type=text name="phone" size="15" maxlength=30 value="<%=objrs("ClientPhone")%>"> </td>
  95.                 </tr>
  96.                 <tr bgcolor="#ffffff">
  97.                     <td> <font face="verdana" size=2> Fax </font> </td>
  98.                     <td> <input type=text name="fax" size="15" maxlength=30 value="<%=objrs("ClientFax")%>"> </td>
  99.                 </tr>
  100.                 <tr bgcolor="#ffffff">
  101.                     <td> <font face="verdana" size=2> Email </font> </td>
  102.                     <td> <input type=text name="email" size="15" maxlength=50 value="<%=objrs("ClientEmail")%>"> </td>
  103.                 </tr>
  104.                 <tr bgcolor="#ffffff">
  105.                     <td> <font face="verdana" size=2> Contact Person Name </font> </td>
  106.                     <td> <input type=text name="contactperson" size="15" maxlength=50 value="<%=objrs("ClientContactPerson")%>"> </td>
  107.                 </tr>
  108.                 </table>
  109.                 </td> </tr>
  110.                 </table>
  111.                 <br>
  112.                 <input type=button onclick="javascript:check()" value=" Update " id=button1 name=button1>
  113.                 </form>
  114.             </td>
  115.         </tr>
  116.         </table>
  117.         </center>
  118.         <!-- #include file="AdsBottom.asp" -->
  119.     </body>
  120. </html>
  121. <%
  122.         objrs.Close 
  123.         set objrs = nothing
  124.     else
  125.         name = replace(trim(request.form("name")), "'", "''")
  126.         address = replace(trim(request.form("address")), "'", "''")
  127.         city = replace(trim(request.form("city")), "'", "''")
  128.         state = replace(trim(request.form("state")), "'", "''")
  129.         pincode = replace(trim(request.form("pincode")), "'", "''")
  130.         phone = replace(trim(request.form("phone")), "'", "''")
  131.         fax = replace(trim(request.form("fax")), "'", "''")
  132.         email = replace(trim(request.form("email")), "'", "''")
  133.         contactperson = replace(trim(request.form("contactperson")), "'", "''")
  134.         sql = "update ClientMaster set ClientName='" + name + "', ClientAddress='" + address + "', ClientCity='" + city + "', ClientState='" + state + "', ClientPincode='" + pincode + "', ClientPhone='" + phone + "', ClientEmail='" + email + "'"
  135.         if fax<>"" then
  136.             sql = sql + ", ClientFax='" + fax + "'"
  137.         end if
  138.         if contactperson<>"" then
  139.             sql = sql + ", ClientContactPerson='" + contactperson + "'"
  140.         end if
  141.         sql = sql + " where ClientLoginId='" + replace(session("ClientLoginId"), "'", "''") + "'"
  142.         con.execute sql
  143.         response.redirect "AdsMyPage.asp?msg=up"
  144.     end if
  145. %>
  146. <!-- #include file="../AdsCloseConn.asp" -->