Current File : //home/obabain/public_html/abc/Mouldinglistveiw.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="java.sql.*" %>
    <%@ include file="Connection.jsp" %>
    <%@include file="master.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<!--   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> -->
   <script src='https://code.jquery.com/jquery-3.3.1.js'></script>   
 <script src='https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js'></script> 
 <script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap4.min.js" charset="utf-8"></script> 

 

<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap4.min.css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<style>
.scrollmenu {
 
  overflow: auto;
  white-space: nowrap;
}
</style>
  
</head>
<body>
<script type="text/javascript">
$(document).ready(function() {
    $('#example').DataTable();
} );
</script> 
    <div class="row">
        <div class="col-md-9">
            <div class="panel panel-default">
             <!--  <div class="panel-heading main-color-bg" style="background-color:green;color:#00FF00;height:40px;"> -->
              <div class="panel-heading" style="background-color:green;">
                <h3 class="panel-title" style="text-align:center;">Moulding and Pouring View</h3> 
                <a class="btn btn-danger pull-right" onclick="goBack()" style="margin-top:-24px;">Back</a> 
                <a   href="Pouring_product_Selection.jsp" class="btn btn-success pull-right"  style="margin-top:-24px;color:;">CreateNew</a> 
              
              </div>
             
   <div class="panel-body">
   <div class="scrollmenu " style="margin-top:20px">
   <table class="table table-bordered" id="example">
   <thead>
   <tr>
   <th>Create&nbsp;Date</th>
   <th>Casting</th>
   <th>Heat&nbsp;Number</th>

   <th>Item&nbsp;Description</th>
   <th>Temp&nbsp;In&nbsp;<sup>o</sup>C</th>
   <th><div style="width:120px">Pouring&nbsp; in &nbsp;Nos</div></th>
   <th><div style="width:120px">Pouring&nbsp; in &nbsp;Wt</div></th>
   <th><div style="width:120px">Rej&nbsp; in &nbsp;Nos</div></th>
   <th><div style="width:120px">Rej&nbsp; in &nbsp;Wt</div></th>
   <th><div style="width:120px">Total&nbsp; in &nbsp;Nos</div></th>
    <th><div style="width:120px">Total&nbsp; in &nbsp;Wt</div></th>
    <th>remarks</th>
    <th>Edit</th>
    <th>Delete</th>
    
    </tr>
   </thead>
   <tbody>
   <%
   String heat="";
   String item="";
   String casting="";
   Statement st= con.createStatement();
   ResultSet rs=st.executeQuery("SELECT * FROM pouring1 p INNER JOIN  moulding1 m on p.m_id=m.m_id");
   while(rs.next())
   {
	  heat=rs.getString("heat");
	 item=rs.getString("item_desc");
	 casting=rs.getString("casting");

	   Statement st1= con.createStatement();
	   ResultSet rs1=st1.executeQuery("SELECT * FROM ip_furnace where m_id='"+heat+"'");
	   while(rs1.next())
			   {
		   					heat=rs1.getString("heat_no");
			   }
	   Statement st2= con.createStatement();
		 //System.out.println(item);
	   ResultSet rs2=st2.executeQuery("SELECT * FROM ip_products where product_id='"+item+"'");
	   while(rs2.next())
			   {
		   
		   					item=rs2.getString("product_name");
			   }
	   Statement st3= con.createStatement();
			// System.out.println(item);
		   ResultSet rs3=st3.executeQuery("SELECT * FROM casting where id='"+casting+"'");
		   while(rs3.next())
				   {
			   
			   casting=rs3.getString("name");
				   }
	   %>
	   <tr>
	   <td><%=rs.getString("date") %></td>
	      <td><%=casting %></td>
	      <td><%=heat %></td>
	       <td><%=item %></td>
	         <td><%=rs.getString("temp") %></td>
	          <td><%=rs.getString("p_qtyno") %></td>
	               <td><%=rs.getString("p.p_qtywt") %></td>
	       <td><%=rs.getString("r_qtyno") %></td>
	         <td><%=rs.getString("r_qtywt") %></td>
	               <td><%=rs.getString("t_qtyno") %></td>
	                <td><%=rs.getString("t_qtywt") %></td>
	                <td><%=rs.getString("remarks") %></td>
	                <td>
                    <a href="Pouring_Edit.jsp?Id=<%=rs.getString("p_id") %>"><span class="glyphicon glyphicon-pencil"></span></a>
                </td>
                
                <td>
                    <a href="Pouring_Delete.jsp?Id=<%=rs.getString("p_id") %>" onclick = "if (! confirm('Are you Sure To Delete?')) { return false; }"><span class="glyphicon glyphicon-remove"></span></a>
                </td> 
	   </tr>
	   <% 
   }
   %>
   </tbody>
   </table>
   </div>
   </div>
   </div>
   </div>
   </div>
   <script>
function goBack() {
  window.history.back();
}
</script>
</body>
</html>