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

        <script LANGUAGE="JavaScript">
        function fun()
        {
                var mqn=f1.sqno.value;

		var mq=f1.sqname.value;

                

		if(mqn==null || mq==null ||  mqn=="" || mq=="" )
                    window.alert("please enter the fields");
                else
                {

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

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

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

<%             // String a= request.getParameter("QosType");
               // String b= request.getParameter("op");





            String k="";
           try {

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

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



                PreparedStatement pstmt = con.prepareStatement("select max(qid) from sqb");

                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("sree")!=null)
                   out.println(request.getAttribute("sree"));%>
                   <center><div>Short Answer Questions</div></center><br><br><br>
                   <center><div><form action="ssinsert.jsp" name="f1" method=post">
                               
               <table align="center" width="600">
              <tr><td align="right">Section</td><td><select name="sec">
                   
<option value="English">English</option>
<option value="Aptitude">Aptitude</option>
<option value="G.K.">G.K.</option>
<option value="Railway">Railways&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
</select></td></tr>
               <tr><td align="right">Enter the Question No</td><td><input type=text name=sqno value="<%=k%>" size=24></td></tr>
               <tr><td align="right">Enter the Question </td><td><textarea name="sqname" rows="4" cols="20"></textarea></td></tr>
               
       
       <tr><td></td><td><input type="button" value="confirm" onclick="fun()" name="Confirm" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <input type="reset" value="cancel" name="Cancel" /></td></tr>
           </table>
</form></div></center>




</body>
</html>