Current File : //home/obabain/anms_obaba_in/ProductPrint.jsp
<%@ page language="java" import="java.util.Date" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
     <%@include file="Connection.jsp" %>
   <%--  <%
    String to=request.getParameter("porder_id");
    String from=request.getParameter("supplier_name");
    String supplvat=request.getParameter("total");
    String supplid=request.getParameter("porder_date_created");
	Statement st1=con.createStatement();
	ResultSet rs = null;
	
	
	%>--%>
	
	<%	
	
	Statement st1=con.createStatement();
	
		String comp=null;
	%> 
<!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">
<link href="css/Mystyle.css" rel="stylesheet">
<script src="js/jscolor.js"></script>
<title>Insert title here</title>
</head>
<body>
 <%
 Statement ss1=con.createStatement();
 ResultSet rs = null;    rs=ss1.executeQuery("select * from ip_users");
	   while(rs.next())
	   {
	   	comp=rs.getString("user_company");
	
	   }
	   %> 
<table style=" width:210mm;">
   <thead><tr><td><div style=" background-color:#DED9D1; font-size:x-large; width:210mm; text-align:center; font-family:Times New Roman; "><b> <%=comp %></b></div></td></tr>
   <tr>
    <td>
   <div style=" width:210mm;font-size: medium; text-align:center; font-family:Times New Roman; "><u>SY NO:54/3,DASANAPURA HOBLI,
BETHANAGERE VILLAGE,
BANGALORE NORTH-562123 </u></div>
   </td></tr>
  <tr> <td>
   <div style=" width:210mm;font-size: medium; text-align:center; font-family:Times New Roman; "><b><u>Product Order </u></b></div>
   </td>
   </tr>
   <tr><td>
<table style="width:210mm; border-bottom:1px solid black; font-size:15px;" >
<tr>
 <%
          Statement smaster=con.createStatement();
          ResultSet rdetails=smaster.executeQuery("select * from ip_users");
          while(rdetails.next())
          {
          %> 
<td style="padding-left:40px; width:30%;" valign="top"><img alt="" style="height:75px;width:75px;" src="<%=rdetails.getString("user_logo")%>"></td>
<%} %> 
<td style=" width:70%; ">
<table style="width:100%">
<tr>
<%
   Date date = new Date();
   out.print( "<h5 align=\"right\">" +date.toString()+"</h5>");
%>

</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</thead>
</table>
<%String id=request.getParameter("Id");



 %>

<table class="pdftable"style="width:600px;">
<thead>
<tr >
<th>MO.No</th> 
<th>Schedule Date</th>
<th>Product Name</th>
<th>Product Qty</th> 
<th>Amount</th>
<th></th> 
</tr>
</thead><!--  select supplier_name from ip_suppliers where supplier_id=tb.supplier_id)supplier from ip_porders tb-->
<tbody>
<%--  <%! int id=1; %> --%>
 <%
rs=st1.executeQuery("select * from manufacture_order where mo_id='"+id+"'");

while(rs.next()){
%> 
 <tr>
<%-- <td><%=j %></td> --%>
<td><%=rs.getString("mocus_id") %></td>

<td><%=rs.getString("Scheduledate") %></td> 

 <td>
         <%=rs.getString("Product") %>
     </td>
     
<td><%=rs.getString("ProductQty") %></td>

  <%
     Statement st= con.createStatement();
     ResultSet rr=st.executeQuery("select sum(quantity*p_price)*(select ProductQty from manufacture_order where mo_id="+rs.getString("mo_id")+")amt from bom_rawmaterial where d1_id=(select p_id from manufacture_order where mo_id="+rs.getString("mo_id")+")");
     while(rr.next()){
     %>
 <td>
        <%=rr.getString("amt") %>
     </td>
     
<td><%-- <%=rs.getString("") %> --%></td>
<%
     } 
}%>

</tr> 
</tbody>
</table>
<br><br><br>


 <div class="col-md-8" >
 <hr>
 <br>
   <b style="color:red">Raw Materials List :</b>
    <table class="pdftable" style="width:100px;border-top:1px solid black;">
    <thead>
      <tr class="p-3 mb-2 bg-info text-white">
        <th>RawMaterial</th>
        <th>Quantity</th>
       <!--  <th>Product Name</th> -->
        <!-- <th>Product Quantity</th> -->
        <th>Rate</th>
        <th>Amount</th>     
      </tr>
    </thead>
   <!--  select *  from manufacture_order order by mo_id desc limit 1 
   
   select tb.*,(quantity*p_price)cost,(select p_id from manufacture_order where p_id=tb.d1_id)as wc,quantity from  manufacture_order,bom_rawmaterial tb where tb.d1_id=(manufacture_order.p_id='15')
   
   -->
     <%
       try
       {
    	   Statement   st3=con.createStatement();
        ResultSet rs1 = st3.executeQuery("select tb.*,(tb.quantity*tb.p_price)cost  from bom_rawmaterial tb where d1_id=(select p_id from manufacture_order where mo_id="+id+") and type='R'");
        while(rs1.next())
        {
     %>
    
      <tbody>
         <tr class="p-3 mb-2 bg-info text-white" style="margin-left:40px;">
     <td>
         <%=rs1.getString("product") %>
     </td>

     <td >
         <%=rs1.getString("quantity") %>
     </td>


     <td >
        <%=rs1.getString("p_price") %>
     </td>
     
     <td>
        <%=rs1.getString("cost") %>
     </td>
     </tr>
 <!-- 
 <td>
 </td>
 <td></td> -->
    </tbody> 
      <%
        }

       } 
       catch (Exception e) 
       {
        e.printStackTrace();
       }
    %>
  </table>
   </div>

<hr><br><br>
<table class="pdftable">
<tr>
<td style="margin-left:50px;">Checked by</td>
<td style="margin-left:50px;;">Verified by</td>
<td style="float:right;">Authorised Signatory</td>
</tr>

</table>
</div>
</body>
</html>