Current File : /home/obabain/public_html/abc/machine_details.jsp
<%@include file="master.jsp"%>
  <%@include file="Connection.jsp" %>
   
 <%

 ResultSet resultSet = null;
     %>

<%@page import="java.sql.*,java.util.*"%>
<%@page import="java.sql.ResultSet"%>


<style type="text/css">
.highlight-error {
	border-color: red;
}
/* table, th, td {
    border: 1px solid black;
    width:0px;
} */



td.vcenter {

    vertical-align: middle;

}
.inlineTable {
            display: inline-block;
        }

.panel-default>.panel-heading-custom {
	background: #ff0000;
	color: #fff;
}
</style>
<!-- <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">-->
<script
	src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script
	src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<body>
	<div class="row">
		<form  method="post" id="contact" name="form1"action="machine_details.jsp">
			<section id="main">
				<div class="container">
					<div class="row" style="width: 110%">
						<div class="col-md-9">
							<div class="panel panel-default">
								<div class="panel-heading main-color-bg">
									<h3 class="panel-title">Machine Details:</h3>
								</div>
								<br>

 <div align="right" >
<a href="machine_View.jsp"><input type="button" value="View" style="background:#204b58;margin-right: 50px" class="btn btn-info"  /></a>
 </div>
 

								
								

								<div class="panel-body">

									
									<b></b> 

          <table>
        <tr>  
    <td class="tdLabel"><label for="" style="margin-left:40px">Machin&nbsp;No:</label></td>  
  <td><input  class="form-control" type="text" name="machin_id" value="" id="register_name" style="width:160px;"/></td>
   
    <td class="tdLabel"><label for="" style="margin-left:50px">Machin&nbsp;Name:</label></td>  
  <td><input  class="form-control" type="text" name="machine_name" value="" id="register_name" style="width:160px;"/></td>
            
        
         <td class="tdLabel"><label for="" style="margin-left:50px" >Manufacturer:</label></td>  
   <td><textarea class="form-control" name="machin_description" rows="2" cols="18"></textarea></td>    
        
        
        </tr>
        </table>   <br> 
    <table>
        <tr>  
    <td class="tdLabel"><label for="" style="margin-left:-8px;">Machin&nbsp;Capacity:</label></td>  
  <td><input  class="form-control" type="text" name="machin_capacity" value="" id="register_name" style="width:160px;margin-left:2px;"/></td>
   
   <td class="tdLabel"><label for="" style="margin-left:25px">Manufacture&nbsp;Date:</label></td>  
  <td><input  class="form-control" type="date" name="manufacture_date" value="" id="register_name" style="width:160px;"/></td>
      
    <td class="tdLabel"><label for="" style="margin-left:30px">Collabration&nbsp;Date:</label></td>  
  <td><input  class="form-control" type="date" name="collabration_date" value="" id="register_name" style="width:160px;"/></td>
      
    
   
       
        </tr>
       </table>  <br>  
      <table>   
        <tr>
        
         <td class="tdLabel"><label for="" style="margin-left:0px">Machin Active:</label></td>  
  <td><input type="checkbox" value="1" name="active" class="" style="margin-left:5px;margin-top:-5px;"></td>
          
        
        
        </tr>
        
        
        
       
        </table> 
   <%
   
String machin_id=request.getParameter("machin_id");
String machin_description=request.getParameter("machin_description");
String machin_capacity=request.getParameter("machin_capacity");

String active=request.getParameter("active");
String machine_name=request.getParameter("machine_name");
String manufacture_date=request.getParameter("manufacture_date");
String collabration_date=request.getParameter("collabration_date");




try
{
	Statement st=null;
	if(machin_id!=null||machin_id.length()!=0){
	 st=con.createStatement();
	 
int i=st.executeUpdate("insert into machin_details(machin_id,machin_description,machin_capacity,active,machine_name,manufacture_date,collabration_date)values('"+machin_id+"','"+machin_description+"','"+machin_capacity+"','"+active+"','"+machine_name+"','"+manufacture_date+"','"+collabration_date+"')");
out.println("");
}}
catch(Exception e)
{
System.out.print(e);
e.printStackTrace();

}

%>     
           
        
        
        
         <br>    
    			
                      
							</div>
							 <div class="modal-footer" id="contact_submit">						
	<a class="btn btn-danger" style="float:left;" onclick="goBack()">Back</a>
       							
<a class="btn btn-default" href="machine_details.jsp">Reset</a>
       <button type="submit" style="background:#204b58" class="btn btn-info" >Save Changes</button>
            <b></b> </div>      
						</div>
					</div>
				</div>
	</div>
	
	</section>
	
	<script src="http://cdn.ckeditor.com/4.6.1/standard/ckeditor.js"></script>
	<script src="http://cdn.ckeditor.com/4.6.1/standard/ckeditor.js"></script>
<script type="text/javascript">
function goBack() {
    window.history.back();
   
};
</script>
	<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
	<script
		src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
	<script
		src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script>
	<script
		src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

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