earn

Wednesday, May 23, 2012

PViewMode.jsp


PViewMode.jsp

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" import="java.sql.*"%>
<html>  <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">    <title>Product View Mode</title>
        <SCRIPT LANGUAGE="JAVASCRIPT">
<!--
                function valid(form)
                {
                                var field1=form.EditProduct;
                                EditProduct=field1.value;
                                if(EditProduct.length==0)
                                {
                                                alert("The Product Descrition Field Cannot Be Left Blank");
                                                field1.focus();
                                                return false;
                                }
                }
//-->
</SCRIPT> </head>
    <body>
        <%
          Connection con=null;
        Statement s=null;
        ResultSet rs=null;
         String ViewModeSelected=request.getParameter("ViewMode");
         ViewModeSelected=ViewModeSelected.trim();
        %>
<div style="position: absolute; width: 997; height: 178; z-index: 1; left:0px; top: 36px; right: 2; bottom:1024" id="layer4">
                <div style="position: absolute; width: 181; height: 31; z-index: 1; left: 10px; top: -33px" id="layer1">
                                <img border="0" src="images/logo5.GIF" width="181" height="31"></div>
                <img border="0" src="images/contacttop-img.jpg" width="997" height="178"></div>
     <div style="position: absolute; width: 831px; height: 325px; z-index: 2; left: 166px; top: 225px" id="layer6">
                                <img border="0" src="images/bkg.gif" width="831" height="325"></div>
<div style="position: absolute; width: 831px; height: 19px; z-index: 3; left: 166px; top: 558px" id="layer7">
<div style="position: absolute; width: 148px; height: 219px; z-index: 1; left: -163px; top: -301px;right: 2" id="layer5">
<!-- Begin Free-Web-Buttons.com -->
<style>#web-buttons-idhyzy6 a{display:block;color:transparent;} #web-buttons-idhyzy6 a:hover{background-position:left bottom;}a#web-buttons-idhyzy6a {display:none}</style>
<table id="web-buttons-idhyzy6" width=0 cellpadding=0 cellspacing=0 border=0>
<tr><td style="padding-bottom:15px" title ="Home">
<a href="AdminHome.jsp" title="Home" style="background-image:url(images/bthyzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="Products">
<a href="ProductList.jsp" title="Products" style="background-image:url(images/btjyzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="Contact Us">
<a href="ContactUs.jsp" title="Contact Us" style="background-image:url(images/btkyzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="About Us">
<a href="AboutUs.jsp" title="About Us" style="background-image:url(images/btgyzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="Add">
<a href="PAdd.jsp" title="Add" style="background-image:url(images/bt5xzy6.png);width:153px;height:25px;display:block;"></a></td></tr>
</table></div>
                <div style="position: absolute; width: 361px; height: 18px; z-index: 1; left: 194px; top: 20px" id="layer8" align="center"><font size="3">Copyright © SureVac Call Management,&nbsp;2009. All Rights Reserved.</font></div><p><img border="0" src="images/bg_footer.gif" width="832" height="32"></div>
<div style="position: absolute; left: 889px; top: 13px; width: 97px; height: 18px; z-index: 4" id="layer2">
<a href="AdminHome.jsp">Home</a>&nbsp;&nbsp;&nbsp;
<a href="PView.jsp">Back</a><div style="position: absolute; width: 1; height: 18; z-index: 1; left: 35px; top: 0px" id="layer3"><img border="0" src="images/htc.gif" width="1" height="18"></div></div>
<%
         if(ViewModeSelected.equals("ListAll"))
             {
             %>
             <div style="position: absolute; left: 476px; top: 261px; width: 500; height: 255; z-index: 6; border: 3px groove #0000FF" id="layer10">
                <img border="0" src="images/445.jpg" width="500" height="255"></div>
         <div style="position: absolute; left: 205px; top: 344px; width: 272px; height: 19px; z-index: 5" id="layer9">
                <b><font color="#0000FF" size="4" face="Calibri">To view all the products
                use the following link.</font></b><p><b>
                <font color="#0000FF" size="4" face="Calibri"><a href="ProductList.jsp">
                ListAll</a></font></b></div>
            <%
             }
             else if(ViewModeSelected.equals("Delete"))
                 {
                 try
                         {
                         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              //  con=DriverManager.getConnection("jdbc:odbc:ds","sa","niit");
                con=DriverManager.getConnection("jdbc:odbc:SureVacCallDS","sa","P@ssw0rd");
                s=con.createStatement();
                         rs=s.executeQuery("Select code from Product");
               %>
               <form method="post" action="PDelete.jsp">
            <div style="position: absolute; left: 723px; top: 296px; width: 150; height: 150; z-index: 7; border: 3px groove #0000FF" id="layer10">
                <img border="0" src="images/error.jpg" width="150" height="150"></div>
  <div style="position: absolute; left: 261px; top: 300px; width: 387px; height: 25px; z-index: 5" id="layer9">
                <table border="0" width="100%">
                                <tr>
                                                <td width="232" align="center"><b><font size="4" face="Calibri" color="#0000FF">
                                                To delete a product select any one from the drop down list.</font></b></td>
                                                <td width="145" align="center">
                                                <p>&nbsp;</p>
                                                                <p><select option name="ProdId">
<%
                   while(rs.next())
                   {
                             %>
                             <option><%=rs.getString(1)%></option>
                   <%
                   }
                         %>
                         </select></p>
                                                <p>&nbsp;</td>
                                </tr>
                                <tr>
                                                <td width="232" height="48" align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                <input type="submit" value="Submit" name="submit">&nbsp;&nbsp;&nbsp;&nbsp;
                                                <input type="reset" value="Reset" name="reset"></td>
                                                <td width="145" height="48" align="center">&nbsp;</td>
                                </tr></table></div>
<%
                   }
                   catch(Exception e)
                   {
                   out.println("There are some invalid data::: "+"\n"+e);
                   }
                   finally
                     {
                     con.close();
                     }
                   %>
              </form>
                 <%
                     }
                 else if(ViewModeSelected.equals("Edit"))
                    {
                 try
                         {
                         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              //  con=DriverManager.getConnection("jdbc:odbc:ds","sa","niit");
                con=DriverManager.getConnection("jdbc:odbc:SureVacCallDS","sa","P@ssw0rd");
                s=con.createStatement();
                         rs=s.executeQuery("Select code from Product");
               %>
               <form onsubmit="return valid(this)" method="post" action="PEdit.jsp">
            <div style="position: absolute; left: 827px; top: 308px; width: 115; height: 116; z-index: 7; border: 3px groove #0000FF" id="layer10">
                <img border="0" src="images/CAV9SKQC.jpg" width="115" height="116"></div>
       
        <div style="position: absolute; left: 241px; top: 315px; width: 498px; height: 25px; z-index: 5" id="layer9">
                <table border="0" width="500" height="116">
                                <tr>
                                                <td width="494" align="center" height="55"><b><font size="4" face="Calibri" color="#0000FF">
                                                To edit a product select any one from the drop down list.</font></b></td>
                                </tr>
                                <tr>
                                                <td width="494" height="55" align="center">
                                                <p><select option name="ProdId">
                                                                <%
                             while(rs.next())
                   {
                             %>
                             <option><%=rs.getString(1)%></option>
                   <%
                   }
                         %>
                           
                            </select>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                                                                <input type="text" name="EditProduct">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                <input type="Submit" value="SAVE" name="Submit">&nbsp; &nbsp;&nbsp;&nbsp;
                                                                <input type="reset" name="Cancel" value="CANCEL"></p>
                                                </td>
                                </tr>
                </table>
</div>
<%
                   }
                   catch(Exception e)
                   {
                   out.println("There are some invalid data::: "+"\n"+e);
                   }
                   finally
                     {
                     con.close();
                     }
                   %>
              </form>
                 <%
                     }
                     else
                         {
                        %>
         <div style="position: absolute; left: 476px; top: 261px; width: 500; height: 255; z-index: 6; border: 3px groove #0000FF" id="layer10">
                <img border="0" src="images/445.jpg" width="500" height="255"></div>
         <div style="position: absolute; left: 205px; top: 344px; width: 272px; height: 19px; z-index: 5" id="layer9">
                <b><font color="#0000FF" size="4" face="Calibri">To view all the products
                use the following link.</font></b><p><b>
                <font color="#0000FF" size="4" face="Calibri"><a href="ProductList.jsp">
                ListAll</a></font></b></div>
             <%
                         }
         %>
   </body>
</html>

PAdd.jsp


PAdd.jsp

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" import="java.sql.*"%><html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Product Add</title>
        <SCRIPT LANGUAGE="JAVASCRIPT">
<!--
                function valid(form)
                {
                                var field1=form.ProdId;
                                var field2=form.Descp;
                                ProdId=field1.value;
                                Descp=field2.value;
                                if(ProdId.length==0)
                                {
                                                alert("The ProductId Field Cannot Be Left Blank");
                                                field1.focus();
                                                return false;
                                }
                                else if(Descp.length==0)
                                {
                                                alert("The Description Field Cannot Be Left Blank");
                                                field2.focus();
                                                return false;
                                }
                }
//-->
</SCRIPT>
    </head>
    <body>
        <form onsubmit="return valid(this)" method="post" action="PAdded.jsp">
                        <div style="position: absolute; width: 997; height: 178; z-index: 1; left:0px; top: 36px; right: 2; bottom:1024" id="layer1">
                <div style="position: absolute; width: 181; height: 31; z-index: 1; left: 10px; top: -33px" id="layer5">
                                <img border="0" src="images/logo5.GIF" width="181" height="31"></div>
                <img border="0" src="images/contacttop-img.jpg" width="997" height="178"></div>
     <div style="position: absolute; width: 831px; height: 325px; z-index: 2; left: 166px; top: 225px" id="layer6">
                                <img border="0" src="images/bkg.gif" width="831" height="325"></div>
<div style="position: absolute; width: 831px; height: 19px; z-index: 3; left: 166px; top: 558px" id="layer7">
                <div style="position: absolute; width: 361px; height: 18px; z-index: 1; left: 194px; top: 20px" id="layer8" align="center">
                                <font size="3">Copyright © SureVac Call Management,&nbsp;2009. All Rights
                                Reserved.</font></div>
                <p>
                <img border="0" src="images/bg_footer.gif" width="832" height="32"></div>
     <br>
     <div style="position: absolute; width: 357px; height: 153px; z-index: 4; left: 383px; top: 286px" id="layer9" align="center">
            <%
            Connection con=null;
            Statement s;
             ResultSet rs=null;
             int ctr;
             String code,codeval;
             String finalcode;
             String fcode;
             try
                     {
                     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                     //  con=DriverManager.getConnection("jdbc:odbc:ds","sa","niit");
                     con=DriverManager.getConnection("jdbc:odbc:SureVacCallDS","sa","P@ssw0rd");
                     s=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
                     rs=s.executeQuery("Select code from Product");
                     if(rs.last()==true)
                         {
                     code=rs.getString(1).toString();
                     codeval=code.substring(1,4);
                     ctr=Integer.parseInt(codeval);
                         if((ctr>=1)&&(ctr<9))
                         {
                         ctr=ctr+1;
                         finalcode="P00"+ctr;
                         fcode=finalcode;
                         %>
<div style="position: absolute; width: 102px; height: 24px; z-index: 4; left: 500px; top: -277px" id="layer13">
<p style="line-height: 200%; margin-top: 0; margin-bottom: 2px">&nbsp;&nbsp;
<a href="Home.jsp">Home</a>&nbsp;&nbsp;&nbsp;
<a href="Product.jsp">Back</a></div>
                <div style="position: absolute; width: 148px; height: 217px; z-index: 1; left: -380px; top: -19px;right: 2" id="layer2">
<style>#web-buttons-idhyzy6 a{display:block;color:transparent;} #web-buttons-idhyzy6 a:hover{background-position:left bottom;}a#web-buttons-idhyzy6a {display:none}</style>
<table id="web-buttons-idhyzy6" width=0 cellpadding=0 cellspacing=0 border=0>
<tr><td style="padding-bottom:15px" title ="Home">
<a href="AdminHome.jsp" title="Home" style="background-image:url(images/bthyzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="Products">
<a href="ProductList.jsp" title="Products" style="background-image:url(images/btjyzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="Contact Us">
<a href="ContactUs.jsp" title="Contact Us" style="background-image:url(images/btkyzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="About Us">
<a href="AboutUs.jsp" title="About Us" style="background-image:url(images/btgyzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="View">
<a href="PView.jsp" title="View" style="background-image:url(images/btmxzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
</table>
</div>
<div style="position: absolute; width: 1px; height: 18; z-index: 3; left: 559px; top: -271px" id="layer12">
                <img border="0" src="images/htc.gif" width="1" height="18"></div>
                <b><font face="Calibri" size="4" color="#0000CC">
            <table width="346" height="151">
 <tr>
 <td height="54">
<p align="center">&nbsp;&nbsp;
<b><font color="#0000CC"><font size="4">Product Code</font>: </font></b>
</td>
&nbsp;&nbsp;&nbsp;
<td height="54" width="156" align="left">
<INPUT TYPE="TEXT" NAME="ProdId" size="4" maxlength="4" VALUE="<%=fcode%>" READONLY="readonly"></td>
                     </tr>
                     <tr>
                         <td height="48">
<p align="center">&nbsp;&nbsp;
<font color="#0000CC" size="4" face="Calibri">
<b>Product Description:</b></font></td>
<td width="156" height="48"><INPUT TYPE="text" NAME="Descp"></td>
                     </tr>
                     <tr>
<td><p align="center">&nbsp;
<input type="submit" value="Save" id="web-buttons-idhyzy6a"></td>
<td width="156" rowspan="5" colspan="5" nowrap>
<p align="center">
<b><font face="Calibri" size="4" color="#0000CC">
<input type="Reset" value="Cancel"></font></b> </td>      </tr>  </table>
                 </font></b> </div>
                         <%
                         }
                         else if((ctr>=9)&&(ctr<99))
                         {
                         ctr=ctr+1;
                         finalcode="P0"+ctr;
                         fcode=finalcode;
                         %>
           <div style="position: absolute; width: 102px; height: 24px; z-index: 4; left: 500px; top: -277px" id="layer13">
<p style="line-height: 200%; margin-top: 0; margin-bottom: 2px">&nbsp;&nbsp;
<a href="AdminHome.jsp">Home</a>&nbsp;&nbsp;&nbsp;
<a href="Product.jsp">Back</a></div>
                <div style="position: absolute; width: 148px; height: 217px; z-index: 1; left: -380px; top: -19px;right: 2" id="layer2"><style>#web-buttons-idhyzy6 a{display:block;color:transparent;} #web-buttons-idhyzy6 a:hover{background-position:left bottom;}a#web-buttons-idhyzy6a {display:none}</style><table id="web-buttons-idhyzy6" width=0 cellpadding=0 cellspacing=0 border=0><tr><td style="padding-bottom:15px" title ="Home">
<a href="AdminHome.jsp" title="Home" style="background-image:url(images/bthyzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="Products"><a href="ProductList.jsp" title="Products" style="background-image:url(images/btjyzy6.png);width:153px;height:30px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="Contact Us"><a href="ContactUs.jsp" title="Contact Us" style="background-image:url(images/btkyzy6.png);width:153px;height:30px;display:block;"><br/></a></td></tr><tr><td style="padding-bottom:15px" title ="About Us"><a href="AboutUs.jsp" title="About Us" style="background-image:url(images/btgyzy6.png);width:153px;height:28px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="View">
<a href="PView.jsp" title="View" style="background-image:url(images/btmxzy6.png);width:153px;height:30px;display:block;"><br/></a></td></tr></table></div>
<div style="position: absolute; width: 1px; height: 18; z-index: 3; left: 559px; top: -271px" id="layer12"><img border="0" src="images/htc.gif" width="1" height="18"></div>
                <b><font face="Calibri" size="4" color="#0000CC"><table width="346" height="151"><tr><td height="54"><p align="center">&nbsp;&nbsp;
<b><font color="#0000CC"><font size="4">Product Code</font>: </font></b></td>
&nbsp;&nbsp;&nbsp;
<td height="54" width="156" align="left"><INPUT TYPE="TEXT" NAME="ProdId" size="4" maxlength="4" VALUE="<%=fcode%>" READONLY="readonly"></td>
                     </tr>
                     <tr>
                         <td height="48">
<p align="center">&nbsp;&nbsp;
<font color="#0000CC" size="4" face="Calibri"><b>Product Description:</b></font></td><td width="156" height="48"><INPUT TYPE="text" NAME="Descp"></td>
                     </tr><tr>
<td>
<p align="center">&nbsp;
<input type="submit" value="Save" id="web-buttons-idhyzy6a"></td><td width="156" rowspan="5" colspan="5" nowrap><p align="center"><b><font face="Calibri" size="4" color="#0000CC"><input type="Reset" value="Cancel"></font></b> </td>
                     </tr></table></font></b> </div>
                         <%
                         }
                     }
                      else
                             {
                             out.println("Try again");
                             }
                             }
                     catch(Exception e)
                   {
                   out.println("There are some invalid data::: "+"\n"+e);
                   }
                   finally
                     {
                     con.close();
                     }
            %></form></body></html>

FAdd.jsp


FAdd.jsp

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd"><%@ page language="java" import="java.sql.*"%>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>Franchisee Add</title>   <SCRIPT LANGUAGE="JAVASCRIPT">
        <!--
                function valid(form)
                {
                                var field1=form.FCode;
                                var field2=form.FName;
                var field3=form.FAdd;
                var field4=form.FPhone;
                                FCode=field1.value;
                                FName=field2.value;
                FAdd=field3.value;
                FPhone=field4.value;
                                if(FCode.length==0)
                                {
                                                alert("The Franchisee Code Field Cannot Be Left Blank");
                                                field1.focus();
                                                return false;
                                }
                                else if(FName.length==0)
                                {
                                                alert("The Franchisee Name Field Cannot Be Left Blank");
                                                field2.focus();
                                                return false;
                                }
                else if(FAdd.length==0)
                                {
                                                alert("The Franchisee Address Field Cannot Be Left Blank");
                                                field3.focus();
                                                return false;
                                }
                else if(FPhone.length==0)
                                {
                                                alert("The Franchisee Phone Field Cannot Be Left Blank");
                                                field4.focus();
                                                return false;
                                }
                }
//-->
</SCRIPT></head>
    <body>   <form onsubmit="return valid(this)" method="post" action="FAdded.jsp">
      <div style="position: absolute; width: 997; height: 178; z-index: 1; left:0px; top: 36px; right: 2; bottom:1024" id="layer4"><div style="position: absolute; width: 181; height: 31; z-index: 1; left: 10px; top: -33px" id="layer1"><img border="0" src="images/logo5.GIF" width="181" height="31"></div><img border="0" src="images/contacttop-img.jpg" width="997" height="178"></div>
   <div style="position: absolute; width: 831px; height: 325px; z-index: 2; left: 166px; top: 225px" id="layer6"><img border="0" src="images/bkg.gif" width="831" height="325"></div>
<div style="position: absolute; width: 831px; height: 19px; z-index: 3; left: 166px; top: 558px" id="layer7">
<div style="position: absolute; width: 148px; height: 219px; z-index: 1; left: -163px; top: -301px;right: 2" id="layer5">
<!-- Begin Free-Web-Buttons.com -->
<style>#web-buttons-idhyzy6 a{display:block;color:transparent;} #web-buttons-idhyzy6 a:hover{background-position:left bottom;}a#web-buttons-idhyzy6a {display:none}</style>
<table id="web-buttons-idhyzy6" width=0 cellpadding=0 cellspacing=0 border=0>
<tr><td style="padding-bottom:15px" title ="Home">
<a href="Home.jsp" title="Home" style="background-image:url(images/bthyzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="Contact Us">
<a href="ContactUs.jsp" title="Contact Us" style="background-image:url(images/btkyzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="About Us">
<a href="AboutUs.jsp" title="About Us" style="background-image:url(images/btgyzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="Franchisee">
<a href="FranchiseeList.jsp" title="Franchisee" style="background-image:url(images/bt1xzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="View">
<a href="FView.jsp" title="View" style="background-image:url(images/btmxzy6.png);width:153px;height:25px;display:block;"><br/></a></td></tr>
<tr><td style="padding-bottom:15px" title ="Add">
<a href="FAdd.jsp" title="Add" style="background-image:url(images/bt5xzy6.png);width:153px;height:25px;display:block;"></a></td></tr>
</table> </div><div style="position: absolute; width: 361px; height: 18px; z-index: 1; left: 194px; top: 20px" id="layer8" align="center"><font size="3">Copyright © SureVac Call Management,&nbsp;2009. All Rights Reserved.</font></div>
<p><img border="0" src="images/bg_footer.gif" width="832" height="32"></div>
<div style="position: absolute; left: 889px; top: 13px; width: 97px; height: 18px; z-index: 4" id="layer2">
<a href="Home.jsp">Home</a>&nbsp;&nbsp;&nbsp;
<a href="Franchisee.jsp">Back</a><div style="position: absolute; width: 1; height: 18; z-index: 1; left: 37px; top: 0px" id="layer3">
                <img border="0" src="images/htc.gif" width="1" height="18"></div>
</div>
<%
            Connection con=null;
            Statement s;
             ResultSet rs=null;
             int ctr;
             String code,codeval;
             String finalcode;
             String fcode;
             try
                     {
                     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                     //  con=DriverManager.getConnection("jdbc:odbc:ds","sa","niit");
                     con=DriverManager.getConnection("jdbc:odbc:SureVacCallDS","sa","P@ssw0rd");
                     s=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
                     rs=s.executeQuery("Select code from Company");
                     if(rs.last()==true)
                         {
                     code=rs.getString(1).toString();
                     codeval=code.substring(1,4);
                     ctr=Integer.parseInt(codeval);
                         if((ctr>=1)&&(ctr<9))
                         {
                         ctr=ctr+1;
                         finalcode="F00"+ctr;
                         fcode=finalcode;
                         %>
<div style="position: absolute; left: 827px; top: 308px; width: 115; height: 116; z-index: 7; border: 3px groove #0000FF" id="layer10">
                <img border="0" src="images/CAV9SKQC.jpg" width="115" height="116"></div>
        <div style="position: absolute; left: 281px; top: 243px; width: 484px; height: 262px; z-index: 5" id="layer9">
<table border="0" width="100%" style="border-collapse: collapse"><tr><td width="150" align="left" height="40" valign="top"><font face="Calibri" size="4" color="#0000FF">Franchisee Code :</font></td>
                            <td align="left" height="40" valign="top">
                            <input type="text" name="FCode" value="<%=fcode%>" READONLY="readonly">
                          </td>
                        </tr>
                        <tr>
                                                <td width="150" align="left" height="40" valign="top">
                                                <font face="Calibri" size="4" color="#0000FF">Franchisee
                                                Name :</font></td>
                                                <td align="left" height="40" valign="top">
                        <input type="text" name="FName" size="20">
                        </td>
                                </tr>
                                <tr>
                                                <td width="150" height="92" align="left" valign="top">
                                                <font face="Calibri" size="4" color="#0000FF">Franchisee
                                                Address :</font></td>
                                                <td height="92" align="left" valign="top">
                        <textarea rows="4" name="FAdd" cols="20"></textarea>
</td></tr><tr>
                                                <td width="150" align="left" height="43" valign="top">
                                                <font face="Calibri" size="4" color="#0000FF">Franchisee
                                                Phone :</font></td><td align="left" height="43" valign="top"><input type="text" name="FPhone" size="20" maxlength="11"></td></tr><tr><td width="150" align="left" valign="top">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="submit" value="Submit" name="Submit"></td>
                                                <td align="left" valign="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                <input type="reset" value="Reset" name="Cancel"></td>
                                </tr>
                </table>
</div>
<%
                         }
                         else if((ctr>=9)&&(ctr<99))
                         {
                         ctr=ctr+1;
                         finalcode="F0"+ctr;
                         fcode=finalcode;
                         %>
<div style="position: absolute; left: 827px; top: 308px; width: 115; height: 116; z-index: 7; border: 3px groove #0000FF" id="layer10">
                <img border="0" src="images/CAV9SKQC.jpg" width="115" height="116"></div>
        <div style="position: absolute; left: 281px; top: 243px; width: 484px; height: 262px; z-index: 5" id="layer9">
<table border="0" width="100%" style="border-collapse: collapse"><tr>
                            <td width="150" align="left" height="40" valign="top">
                            <font face="Calibri" size="4" color="#0000FF">Franchisee Code :</font></td>
                            <td align="left" height="40" valign="top">
                            <input type="text" name="FCode" value="<%=fcode%>" READONLY="readonly">
                            </td></tr><tr>
                                                <td width="150" align="left" height="40" valign="top">
                                                <font face="Calibri" size="4" color="#0000FF">Franchisee
                                                Name :</font></td>
                                                <td align="left" height="40" valign="top">
                        <input type="text" name="FName" size="20">
                        </td></tr><tr>
                                                <td width="150" height="92" align="left" valign="top">
                                                <font face="Calibri" size="4" color="#0000FF">Franchisee
                                                Address :</font></td>
                                                <td height="92" align="left" valign="top">
                        <textarea rows="4" name="FAdd" cols="20"></textarea></tr></tr><tr>
                                                <td width="150" align="left" height="43" valign="top">
                                                <font face="Calibri" size="4" color="#0000FF">Franchisee
                                                Phone :</font></td>
                                                <td align="left" height="43" valign="top">
                                                                <input type="text" name="FPhone" size="20"></td>
                                </tr>
                                <tr>
                                                <td width="150" align="left" valign="top">
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="submit" value="Submit" name="Submit"></td><td align="left" valign="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                <input type="reset" value="Reset" name="Cancel"></td></tr></table>
</div>
<%
 }
                     }
else
                             {
                             out.println("Try again");
                             }
                             }
                     catch(Exception e)
                   {
                   out.println("There are some invalid data::: "+"\n"+e);
                   }
                   finally
                     {
                     con.close();
                     }
            %>
                
        <</body></html>