<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>

        <script LANGUAGE="JavaScript">
            function fun()
            {
            document.forms["f1"].submit();
            }
        /*function fun()
        {
                var eid=f1.eid.value;

		var ename=f1.ename.value;

                var o0=f1.esal.value;


                var o1=f1.ediv.value;

		var o2=f1.etid.value;

       var o3=f1.emarks.value;

		var o4=f1.eper.value;
        var o5=f1.emarks.value;

		var o6=f1.eper.value;

		if(eid==null || ename==null || o0==null || o1==null || 02==null || 03==null || o4==null || eid=="" || ename=="" || o1=="" || 02=="" || 03=="" || o4=="" ||o0=="")
                    window.alert("please enter the fields");
                else
                {

                      document.forms["f1"].submit();
                }

        }*/
</script>
        <style>
div
{
color:lime;
width:180;
font-family:Comic Sans MS;
text-align:center;
}
be
{
text-decoration:none;
font-family:Comic Sans MS;
width:180;
color:lime;
cursor:hand;
}

</style>
</head>
<body bgcolor="gray">
    <%@page language="java" import="java.util.*,java.sql.* " contentType="text/html"%>
<jsp:include page="menu.jsp"></jsp:include><html>
<%
            String k="";
           try {

               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

            Connection con=DriverManager.getConnection("jdbc:odbc:sree","sree","sree");

                PreparedStatement pstmt = con.prepareStatement("select max(id) from emp");

                ResultSet rs= pstmt.executeQuery();
                while(rs.next())
                {
                    int  i=rs.getInt(1);
                    int l=i+1;
                    k=String.valueOf(l);
              }

            }

         catch(ClassNotFoundException s)
         {
	        out.println("loaderror");
   	 }
		catch(SQLException e)
               {
	            out.println(e);
               }
%>

    <% if(request.getAttribute("sri")!=null)
                   out.println(request.getAttribute("sri"));%>

                   <div><form action="empupdate.jsp" name="f1" method=post">
                           <center><a href="emp.jsp" >EMPLOYEE DETAILS</a></center>
                           <center><table align="center" width="600">
               <tr><td align="left">Enter the Emplyee ID</td><td><input type=text name=eid value="<%=k%>" length=300></td></tr>
      <tr><td>Enter the Employee Name</td><td><input type=text name=ename length=300></td></tr>
      <tr><td>Enter the Salary</td><td><input type=text name=esal length=300></td></tr>
       <tr><td></td></tr>
      <tr><td> Enter the Divison</td><td><input type=text name=ediv length=300></td></tr>
      <tr><td> Enter the Test ID</td><td><input type=text name=etid length=300></td></tr>
      <tr><td> Enter the Marks</td><td><input type=text name=emarks length=300></td></tr>
      <tr><td> Enter the Percentage</td><td><input type=text name=eper length=300></td></tr>
      <tr><td> Enter the Present Grade</td><td><input type=text name=ecgrade length=300></td></tr>
      <tr><td> Enter the Promoted Grade</td><td><input type=text name=epgrade length=300></td></tr>
      <tr><td> Enter the Experience</td><td><input type=text name=exp length=300></td></tr>
       <tr><td></td><td><input type="button" value="confirm" onclick="fun()" name="Confirm" />&nbsp&nbsp&nbsp&nbsp&nbsp</td><td>
       <input type="reset" value="cancel" name="Cancel" /></td></tr>
           </table></center>
    </form></div>
       





</body>
</html>