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

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