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

  1. <% Response.Buffer =true%>
  2. <!-- #include file="../AdsOpenConn.asp" -->
  3. <%
  4.     if session("AdminLogin")="" then Response.Redirect "default.asp"
  5. %>
  6.  
  7. <%
  8.     dim name
  9.     name=Request.Form("name")
  10.     'if request.form.count=0 then
  11.     if name="" then
  12. %>
  13. <html>
  14.     <head>
  15.         <title> Janahitha Ads - New Registration </title>
  16.         <meta name="author" content="Jagadish,Gopi">
  17.         <script language="javascript" src="../func.js"></script>
  18.         <script language="javascript">
  19.         function check()
  20.         {
  21.             validateform = document.registrationform;
  22.             if(isempty(validateform.name))
  23.                 validateform.name.focus();
  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(!(ispin(validateform.pincode)))
  38.                 validateform.pincode.focus();
  39.             else
  40.             if(isempty(validateform.phone))
  41.                 validateform.phone.focus();
  42.             else
  43.             if(!(isemail(validateform.email)))
  44.                 validateform.email.focus();
  45.             else
  46.                 validateform.submit();
  47.         }
  48.         </script>
  49.     </head>
  50.     <body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
  51.     <p> </p>
  52.         <p align=right><font face=verdana size=2> <a href="AdsAdminHome.asp"><font color="<%=TopLinksColor%>">Home</font></a>     <a href="AdsAdminHome.asp?lo"><font color="<%=TopLinksColor%>">Logout</font></a>   </font></p>
  53.  
  54.         <center>
  55.                 <form name="registrationform" method=post action="<%=request.servervariables("script_name")%>">
  56.                 <font face="verdana" color="#99603E"> <b> New Account </b> </font> <br> <br>
  57.                 <table cellpadding=0 cellspacing=0 border=0>
  58.                 <tr> <td bgcolor="#f2D197">
  59.                 <table cellspacing=1 cellpadding=3 border=0 width=300>
  60.                 <tr bgcolor="#ffffff">
  61.                     <td> <font face="verdana" size=2> Name </font> </td>
  62.                     <td> <input type=text name="name" size="15" maxlength=50> </td>
  63.                 </tr>
  64.                 <tr bgcolor="#ffffff">
  65.                     <td> <font face="verdana" size=2> Address </font> </td>
  66.                     <td> <input type=text name="address" size="15" maxlength=200> </td>
  67.                 </tr>
  68.                 <tr bgcolor="#ffffff">
  69.                     <td> <font face="verdana" size=2> City </font> </td>
  70.                     <td> <input type=text name="city" size="15" maxlength=50> </td>
  71.                 </tr>
  72.                 <tr bgcolor="#ffffff">
  73.                     <td> <font face="verdana" size=2> State </font> </td>
  74.                     <td> <input type=text name="state" size="15" maxlength=50> </td>
  75.                 </tr>
  76.                 <tr bgcolor="#ffffff">
  77.                     <td> <font face="verdana" size=2> Pin </font> </td>
  78.                     <td> <input type=text name="pincode" size="15" maxlength=6> </td>
  79.                 </tr>
  80.                 <tr bgcolor="#ffffff">
  81.                     <td> <font face="verdana" size=2> Phone </font> </td>
  82.                     <td> <input type=text name="phone" size="15" maxlength=30> </td>
  83.                 </tr>
  84.                 <tr bgcolor="#ffffff">
  85.                     <td> <font face="verdana" size=2> Fax </font> </td>
  86.                     <td> <input type=text name="fax" size="15" maxlength=30> </td>
  87.                 </tr>
  88.                 <tr bgcolor="#ffffff">
  89.                     <td> <font face="verdana" size=2> Email </font> </td>
  90.                     <td> <input type=text name="email" size="15" maxlength=50> </td>
  91.                 </tr>
  92.                 <tr bgcolor="#ffffff">
  93.                     <td> <font face="verdana" size=2> Contact Person Name </font> </td>
  94.                     <td> <input type=text name="contactperson" size="15" maxlength=50> </td>
  95.                 </tr>
  96.                 <tr bgcolor="#ffffff"><td><input type=button onclick="javascript:check()" value=" Create " id=button1 name=button1></td><td></td></tr>
  97.                 </table>
  98.             </table>
  99.                         </form>
  100.         </center>
  101.         </body>
  102. </html>
  103. <%
  104.     else
  105.         
  106.         name = replace(trim(request.form("name")), "'", "''")
  107.         address = replace(trim(request.form("address")), "'", "''")
  108.         city = replace(trim(request.form("city")), "'", "''")
  109.         state = replace(trim(request.form("state")), "'", "''")
  110.         pincode = replace(trim(request.form("pincode")), "'", "''")
  111.         phone = replace(trim(request.form("phone")), "'", "''")
  112.         fax = replace(trim(request.form("fax")), "'", "''")
  113.         email = replace(trim(request.form("email")), "'", "''")
  114.         contactperson = replace(trim(request.form("contactperson")), "'", "''")
  115.         sql1 = "insert into AccClientDetails(ClientName, ClientAddress, ClientCity, ClientState, ClientPincode, ClientPhone, ClientEmail"
  116.         sql2 = ") values('" + name + "', '" + address + "', '" + city + "', '" + state + "', '" + pincode + "', '" + phone + "', '" + email + "'"
  117.         if fax<>"" then
  118.             sql1 = sql1 + ", ClientFax"
  119.             sql2 = sql2 + ", '" + fax + "'"
  120.         end if
  121.         if contactperson<>"" then
  122.             sql1 = sql1 + ", ClientContactPerson"
  123.             sql2 = sql2 + ", '" + contactperson + "'"
  124.         end if
  125.         sql = sql1 + sql2 + ")"
  126.         Response.Write sql
  127.         con.execute sql
  128.         response.redirect "AdsAdminNewAccount.asp"
  129.     end if
  130. %>
  131. <!-- #include file="../AdsCloseConn.asp" -->