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

  1. <!-- #include file="AdsOpenConn.asp" -->
  2. <%
  3.     if request.form.count=0 then
  4. %>
  5. <html>
  6.     <head>
  7.         <title> Janahitha Ads - New Registration </title>
  8.         <meta name="author" content="Jagadish,Gopi">
  9.         <script language="javascript" src="func.js"></script>
  10.         <script language="javascript">
  11.         function check()
  12.         {
  13.             validateform = document.registrationform;
  14.             if(isempty(validateform.loginid))
  15.                 validateform.loginid.focus();
  16.             else
  17.             if(isempty(validateform.password))
  18.                 validateform.password.focus();
  19.             else
  20.             if(isempty(validateform.passward))
  21.                 validateform.passward.focus();
  22.             else
  23.             if(validateform.password.value!=validateform.passward.value)
  24.             {
  25.                 alert("Password Does Not Match ! Enter Again !!");
  26.                 validateform.passward.focus();
  27.             }
  28.             else
  29.             if(isempty(validateform.name))
  30.                 validateform.name.focus();
  31.                 else
  32.             if(isempty(validateform.contactperson))
  33.                 validateform.contactperson.focus();
  34.             else
  35.             if(isempty(validateform.address))
  36.                 validateform.address.focus();
  37.             else
  38.             if(isempty(validateform.city))
  39.                 validateform.city.focus();
  40.             else
  41.             if(isempty(validateform.state))
  42.                 validateform.state.focus();
  43.             else
  44.             if(isempty(validateform.pincode))
  45.                 validateform.pincode.focus();
  46.             else
  47.             if(!(ispin(validateform.pincode)))
  48.                 validateform.pincode.focus();
  49.             else
  50.             if(isempty(validateform.phone1))
  51.                 validateform.phone1.focus();
  52.             //    else
  53.             //if(isempty(validateform.phone2))
  54.             //    validateform.phone2.focus();
  55.             else
  56.             if(!(isemail(validateform.email)))
  57.                 validateform.email.focus();
  58.             else
  59.                 validateform.submit();
  60.         }
  61.         </script>
  62.     </head>
  63.     <body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
  64.         <!-- #include file="AdsTop.asp" -->
  65.         <center>
  66.         <table width=100% cellpadding=0 cellspacing=0 border=0 height=100%>
  67.         <tr>
  68.             <td width=150 align=center valign=top bgcolor="#FFFFFF">
  69.                 <!-- #include file="AdsLeft.asp" -->
  70.             </td>
  71.             <td width=630 align=center valign=top bgcolor="#ffffff">
  72.                 <br>
  73.                 <form name="registrationform" method=post action="<%=request.servervariables("script_name")%>">
  74.                 <font face="verdana" color="#99603E"> <b> New Registration </b> </font> <br> <br>
  75.                 
  76.           <table cellpadding=0 cellspacing=0 border=0 width="368">
  77.             <tr> <td bgcolor="#f2D197">
  78.                 <table cellspacing=1 cellpadding=3 border=0 width=362>
  79.                   <tr bgcolor="#ffffff">
  80.                     <td width="231"> <font face="verdana" size=2> Login Id <b><font color="#FF0000">*</font></b></font> 
  81.                     </td>
  82.                     <td width="116"> 
  83.                       <input type=text name="loginid" size="15" maxlength=20>
  84.                     </td>
  85.                 </tr>
  86.                 <tr bgcolor="#ffffff">
  87.                     <td width="231"> <font face="verdana" size=2> Password <b><font color="#FF0000">*</font></b></font> 
  88.                     </td>
  89.                     <td width="116"> 
  90.                       <input type=password name="password" size="15" maxlength=20>
  91.                     </td>
  92.                 </tr>
  93.                 <tr bgcolor="#ffffff">
  94.                     <td width="231"> <font face="verdana" size=2> Confirm Password 
  95.                       <b><font color="#FF0000">*</font></b></font> </td>
  96.                     <td width="116"> 
  97.                       <input type=password name="passward" size="15" maxlength=20> </td>
  98.                 </tr>
  99.                 <tr bgcolor="#ffffff">
  100.                     <td width="231"> <font face="verdana" size=2> Organization <b><font color="#FF0000">*</font></b></font> 
  101.                     </td>
  102.                     <td width="116"> 
  103.                       <input type=text name="name" size="15" maxlength=50> </td>
  104.                 </tr>
  105.                 <tr bgcolor="#ffffff">
  106.                     <td width="231"> <font face="verdana" size=2> Contact Person 
  107.                       Name <b><font color="#FF0000">*</font></b></font> </td>
  108.                     <td width="116"> 
  109.                       <input type=text name="contactperson" size="15" maxlength=50> </td>
  110.                 </tr>
  111.                 <tr bgcolor="#ffffff">
  112.                     <td width="231"> <font face="verdana" size=2> Address <b><font color="#FF0000">*</font></b></font> 
  113.                     </td>
  114.                     <td width="116"> 
  115.                       <input type=text name="address" size="15" maxlength=200> </td>
  116.                 </tr>
  117.                 <tr bgcolor="#ffffff">
  118.                     <td width="231"> <font face="verdana" size=2> City <b><font color="#FF0000">*</font></b></font> 
  119.                     </td>
  120.                     <td width="116"> 
  121.                       <input type=text name="city" size="15" maxlength=50> </td>
  122.                 </tr>
  123.                 <tr bgcolor="#ffffff">
  124.                     <td width="231"> <font face="verdana" size=2> State <b><font color="#FF0000">*</font></b></font> 
  125.                     </td>
  126.                     <td width="116"> 
  127.                       <input type=text name="state" size="15" maxlength=50> </td>
  128.                 </tr>
  129.                 <tr bgcolor="#ffffff">
  130.                     <td width="231"> <font face="verdana" size=2> Pin <b><font color="#FF0000">*</font></b></font> 
  131.                     </td>
  132.                     <td width="116"> 
  133.                       <input type=text name="pincode" size="15" maxlength=6> </td>
  134.                 </tr>
  135.                 <tr bgcolor="#ffffff">
  136.                     <td width="231"> <font face="verdana" size=2> Phone1 <b><font color="#FF0000">*</font></b></font> 
  137.                     </td>
  138.                     <td width="116"> 
  139.                       <input type=text name="phone1" size="15" maxlength=30> </td>
  140.                 </tr>
  141.                 <tr bgcolor="#ffffff">
  142.                     <td width="231"> <font face="verdana" size=2> Phone2 </font> 
  143.                     </td>
  144.                     <td width="116"> 
  145.                       <input type=text name="phone2" size="15" maxlength=30> </td>
  146.                 </tr>
  147.                 <tr bgcolor="#ffffff">
  148.                     <td width="231"> <font face="verdana" size=2> Fax </font> 
  149.                     </td>
  150.                     <td width="116"> 
  151.                       <input type=text name="fax" size="15" maxlength=30> </td>
  152.                 </tr>
  153.                 <tr bgcolor="#ffffff">
  154.                     <td width="231"> <font face="verdana" size=2> Email <b><font color="#FF0000">*</font></b> </font> 
  155.                     </td>
  156.                     <td width="116"> 
  157.                       <input type=text name="email" size="15" maxlength=50> </td>
  158.                 </tr>
  159.                 
  160.                 </table>
  161.                 </td> </tr>
  162.                 </table>
  163.                 <br>
  164.                 <input type=button onclick="javascript:check()" value=" Register " id=button1 name=button1>
  165.                 </form>
  166.             </td>
  167.         </tr>
  168.         </table>
  169.         </center>
  170.         <!-- #include file="AdsBottom.asp" -->
  171.     </body>
  172. </html>
  173. <%
  174.     else
  175.         loginid = replace(trim(request.form("loginid")), "'", "''")
  176.         password = replace(trim(request.form("password")), "'", "''")
  177.         name = replace(trim(request.form("name")), "'", "''")
  178.         address = replace(trim(request.form("address")), "'", "''")
  179.         city = replace(trim(request.form("city")), "'", "''")
  180.         state = replace(trim(request.form("state")), "'", "''")
  181.         pincode = replace(trim(request.form("pincode")), "'", "''")
  182.         phone1 = replace(trim(request.form("phone1")), "'", "''")
  183.         phone2 = replace(trim(request.form("phone2")), "'", "''")
  184.         fax = replace(trim(request.form("fax")), "'", "''")
  185.         email = replace(trim(request.form("email")), "'", "''")
  186.         contactperson = replace(trim(request.form("contactperson")), "'", "''")
  187.         set rs = server.createobject("adodb.recordset")
  188.         flag = true
  189.         rs.open "select count(*) from ClientMaster where ClientLoginId='" + loginid + "'", con
  190.         if rs(0)>0 then flag = false
  191.         rs.close
  192.         set rs = nothing
  193.         if flag=false then
  194. %>
  195. <html>
  196.     <head>
  197.         <title> Janahitha Ads - Welcome </title>
  198.         <meta name="author" content="Jagadish,Gopi">
  199.     </head>
  200.     <body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
  201.         <!-- #include file="AdsTop.asp" -->
  202.         <center>
  203.         <table width=100% cellpadding=0 cellspacing=0 border=0 height=100%>
  204.         <tr>
  205.             <td width=150 align=center valign=top bgcolor="#FFFFFF">
  206.                 <!-- #include file="AdsLeft.asp" -->
  207.             </td>
  208.             <td width=630 align=center valign=top bgcolor="#ffffff">
  209.                 <font face=verdana size=2 color=red>
  210.                 <b> Login Id, <%=Request.Form("loginid")%> Already Exists <br> <br> 
  211.                 Hit <a href="javascript:history.back();"><font color=red>Back</font></a> To Enter Another</b>
  212.                 </font>
  213.             </td>
  214.         </tr>
  215.         </table>
  216.         </center>
  217.         <!-- #include file="AdsBottom.asp" -->
  218.     </body>
  219. </html>
  220. <%
  221.             response.end
  222.         end if
  223.         sql1 = "insert into ClientMaster(ClientLoginId, ClientPassword, ClientName, ClientAddress, ClientCity, ClientState, ClientPincode, ClientPhone1, ClientContactPerson"
  224.         sql2 = ") values('" + loginid + "', '" + password + "', '" + name + "', '" + address + "', '" + city + "', '" + state + "', '" + pincode + "', '" + phone1 + "','" +contactperson + "'"
  225.         if fax<>"" then
  226.             sql1 = sql1 + ", ClientFax"
  227.             sql2 = sql2 + ", '" + fax + "'"
  228.         end if
  229.         if phone2<>"" then
  230.             sql1 = sql1 + ", ClientPhone2"
  231.             sql2 = sql2 + ", '" + phone2 + "'"
  232.         end if
  233.         if email<>"" then
  234.             sql1 = sql1 + ", ClientEmail"
  235.             sql2 = sql2 + ", '" + email + "'"
  236.         end if
  237.         sql = sql1 + sql2 + ")"
  238.         con.execute sql
  239.         set rs = server.CreateObject("adodb.recordset")
  240.         rs.Open "select ClientId from ClientMaster where ClientLoginId='" + loginid + "'", con, 3, 3
  241.         session("ClientId") = cstr(rs("ClientId"))
  242.         rs.close
  243.         session("ClientLoginId") = loginid
  244.         session("ClientName") = name
  245.         response.redirect "AdsMyPage.asp"
  246.     end if
  247. %>
  248. <!-- #include file="AdsCloseConn.asp" -->