Current File : /home/obabain/public_html/abc/heat_cycle_DA.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ include file="Connection.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
      <%
        String[] a=null;String[] b=null;String[] c=null;String[] d=null;String[] e=null;String[] f=null;
		a=request.getParameterValues("grade[]");
		b=request.getParameterValues("cycle_name[]");
		c=request.getParameterValues("heat_upto[]");
		d=request.getParameterValues("hr[]"); 
		e=request.getParameterValues("min[]");
		f=request.getParameterValues("quench_media[]");	
	  %>		

         <%
			try
               {
			    Statement st=con.createStatement();   
			    		      
            for(int i=1;i<=a.length-1;i++)       
              {
    	         if(b[i].equals("1"))   
    	         {	 
    	           st.executeUpdate("insert into heat_treatment(grade,solution_heat,solution_hour,solution_min,solution_media,normalling_heat,normalling_hours,normalling_min,normalling_media,annealing_heat,annealing_hour,annealing_min,annealing_media,harden_heat,harden_hour,harden_min,harden_media,temp_heat,temp_hour,temp_min,temp_media)values('"+a[i]+"','"+c[i]+"','"+d[i]+"','"+e[i]+"','"+f[i]+"',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')");
    	         }
    	         else if(b[i].equals("2"))
    	         {
    	        	 st.executeUpdate("insert into heat_treatment(grade,solution_heat,solution_hour,solution_min,solution_media,normalling_heat,normalling_hours,normalling_min,normalling_media,annealing_heat,annealing_hour,annealing_min,annealing_media,harden_heat,harden_hour,harden_min,harden_media,temp_heat,temp_hour,temp_min,temp_media)values('"+a[i]+"',' ',' ',' ',' ','"+c[i]+"','"+d[i]+"','"+e[i]+"','"+f[i]+"',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')");
    	         } 
    	         else if(b[i].equals("3"))
    	         {
    	        	 st.executeUpdate("insert into heat_treatment(grade,solution_heat,solution_hour,solution_min,solution_media,normalling_heat,normalling_hours,normalling_min,normalling_media,annealing_heat,annealing_hour,annealing_min,annealing_media,harden_heat,harden_hour,harden_min,harden_media,temp_heat,temp_hour,temp_min,temp_media)values('"+a[i]+"',' ',' ',' ',' ',' ',' ',' ',' ','"+c[i]+"','"+d[i]+"','"+e[i]+"','"+f[i]+"',' ',' ',' ',' ',' ',' ',' ',' ')");
    	         }   
    	         else if(b[i].equals("4"))
    	         {
    	        	 st.executeUpdate("insert into heat_treatment(grade,solution_heat,solution_hour,solution_min,solution_media,normalling_heat,normalling_hours,normalling_min,normalling_media,annealing_heat,annealing_hour,annealing_min,annealing_media,harden_heat,harden_hour,harden_min,harden_media,temp_heat,temp_hour,temp_min,temp_media)values('"+a[i]+"',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','"+c[i]+"','"+d[i]+"','"+e[i]+"','"+f[i]+"',' ',' ',' ',' ')");
    	         }
    	         else if(b[i].equals("5"))
    	         {
    	        	 st.executeUpdate("insert into heat_treatment(grade,solution_heat,solution_hour,solution_min,solution_media,normalling_heat,normalling_hours,normalling_min,normalling_media,annealing_heat,annealing_hour,annealing_min,annealing_media,harden_heat,harden_hour,harden_min,harden_media,temp_heat,temp_hour,temp_min,temp_media)values('"+a[i]+"',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','"+c[i]+"','"+d[i]+"','"+e[i]+"','"+f[i]+"')");
    	         }
    	        
              }    
                response.sendRedirect("Heat_View4.jsp");        
                }
                 catch(Exception z)
               {
                 System.out.print(z);
                 z.printStackTrace();
               }   
		   %>
 
        

</body>
</html>