<%-- 
    Document   : eedit2
    Created on : Mar 21, 2010, 8:24:28 PM
    Author     : Sreekanth
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<jsp:include page="menu.jsp"></jsp:include>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script>
            function fun()
            {
                document.forms["f1"].submit();
            }
            function fun2()
        {
          //  window.alert("si");
            
            var a1=document.f1.opt[0].checked;
            var a2=document.f1.opt[1].checked;
            var a3=document.f1.opt[2].checked;
            var a4=document.f1.opt[3].checked;
           if(a1)
            {
             document.f1.ans.value  =f1.opt1.value;
             
            }
           else if(a2)
            {    
               document.f1.ans.value  =f1.opt2.value;
               
            }  
             else if(a3)
            {     
             document.f1.ans.value  =f1.opt3.value;
             
            } 
           else if(a4)
            {    
               document.f1.ans.value  =f1.opt4.value;
               
            }               
            /*/else if(document.f1.opt[1].checked)
                a=f1.opt2.value;
             document.f1.ans.value=a;
            else if(document.f1.opt[2].checked)
             a=f1.opt3.value;
             f1.ans.value=a;
             else if(document.f1.opt[3].checked)
               a=f1.opt2.value;
             f1.ans.value=a;*/
            
        }
        </script>
        <style>
            div
{
color:white;
width:180;
font-family:Comic Sans MS;
text-align:center;
}
        </style>   
    </head>
    
       <%@page language="java" import="java.util.*,java.sql.* " contentType="text/html"%>
       <%             // String a= request.getParameter("QosType");
               // String b= request.getParameter("op");

           int a1 =Integer.parseInt( request.getParameter("mqno"));
                
              
               
           int k=0; 
           String l="";   
           String m="";  
           String n="";   
           String o=""; 
           String p="";   
           String q="";                                     
	   String r="";  	
           try {  
            
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           
               Connection con=DriverManager.getConnection("jdbc:odbc:sree","sree","sree");

           
            
                PreparedStatement pstmt = con.prepareStatement("select * from mqb where qid="+a1+"");
                    
                ResultSet rs= pstmt.executeQuery();
                
            while(rs.next())
            { 
              int a=rs.getInt(1);
              k=Integer.valueOf(a);
              //out.print(k);                 
              String b=rs.getString(2);
              l=String.valueOf(b); 
              //out.print(l);
              String c=rs.getString(3); 
              m=String.valueOf(c);
              //out.print(m);
              String d=rs.getString(4);
              n=String.valueOf(d);
              //out.print(n);              
              String e=rs.getString(5); 
              o=String.valueOf(e);
              //out.print(o);              
              String f=rs.getString(6);
              p=String.valueOf(f); 
              //out.print(p);
              String g=rs.getString(7); 
              q=String.valueOf(g);
              //out.print(q);
              String h=rs.getString(8); 
              r=String.valueOf(h);
              //out.print(r);                                                                                                                
            }
                 
            }
	catch(ClassNotFoundException s)
        { 
	out.println("loaderror");
   	}
		catch(SQLException e)
        { 
	out.println(e);
   }
                       
          %> 
          <body bgcolor="bisque">
          
          <div><form name="f1" action="medit3.jsp" method="POST">
        

     <center><table border="0">
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr><td>Enter the Section Name</td><td><select name="sec" >
<option value= "<%= r%>" ><% out.print(r); %></option>
<option value="English">English&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;&nbsp;&nbsp;&nbsp;&nbsp;</option>
<option value="Aptitude">Aptitude</option>
<option value="G.K.">G.K.</option>
<option value="Railway">Railways</option>
</select></td></tr>
<tr><td>Enter the Question No</td><td><input type=text name=mqno value="<%= k%>"  length=300 size=25></td></tr>
<tr><td>Enter the Question </td><td><input type=text name=mqname value="<%= l%>"  length=300 size=25></td></tr>
      
      <tr><td></td></tr>
      <tr><td> Enter the Option1</td><td><input type="radio" name="opt" value="0" onclick="fun2()" /><input type=text name=opt1 length=300 size=22 value="<%= n%>"></td></tr>
      <tr><td> Enter the Option2</td><td><input type="radio" name="opt" value="1" onclick="fun2()" /><input type=text name=opt2 length=300 size=22 value="<%= o%>"></td></tr>
      <tr><td> Enter the Option3</td><td><input type="radio" name="opt" value="2" onclick="fun2()" /><input type=text name=opt3 length=300 size=22 value="<%= p%>"></td></tr>
      <tr><td> Enter the Option4</td><td><input type="radio" name="opt" value="3" onclick="fun2()"   /><input type=text name=opt4 length=300 size=22 value="<%= q%>"></td></tr>
      <tr><td> Enter the Answer</td><td><input type=text name=ans readonly  length=300 value="<%= m%>"  size=25 ></td></tr>
      
      <tr><td></td><td><input type="button" value="UPDATE" 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>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table></center>

         
         
         
 </form></div>
    </body>
</html>