Current File : //home/obabain/autoclutchess_obaba_in/MetlingmonthLastyear.jsp |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ include file="Connection.jsp" %>
<%@include file="master.jsp" %>
<% String from=request.getParameter("from");
String to=request.getParameter("to");
String pid=request.getParameter("pid");
Statement st=con.createStatement();
%>
<%-- <%!
public int nullIntconv(String str)
{
int conv=0;
if(str==null)
{
str="0";
}
else if((str.trim()).equals("null"))
{
str="0";
}
else if(str.equals(""))
{
str="0";
}
try{
conv=Integer.parseInt(str);
}
catch(Exception e)
{
}
return conv;
}
%>
<%
Statement st=con.createStatement();
//ResultSet rsPagination = null;
ResultSet rsRowCnt = null;
int iShowRows=10; // Number of records show on per page
int iTotalSearchRecords=10; // Number of pages index shown
int iTotalRows=nullIntconv(request.getParameter("iTotalRows"));
int iTotalPages=nullIntconv(request.getParameter("iTotalPages"));
int iPageNo=nullIntconv(request.getParameter("iPageNo"));
int cPageNo=nullIntconv(request.getParameter("cPageNo"));
String filt=request.getParameter("filter");
if(iPageNo==0)
{
iPageNo=0;
}
else {
iPageNo=Math.abs((iPageNo-1)*iShowRows);
}
int iStartResultNo=0;
int iEndResultNo=0;
if(filt==null)
{
rsRowCnt=st.executeQuery("select count(*)as cnt from ip_products ");
if(rsRowCnt.next())
{
iTotalRows=rsRowCnt.getInt("cnt");
}
}
else
{
rsRowCnt=st.executeQuery("select count(*)as cnt from ip_products where product_name like '%"+filt+"%'");
if(rsRowCnt.next())
{
iTotalRows=rsRowCnt.getInt("cnt");
}
}
%>
--%>
<!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">
<!-- <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">
-->
<title>Insert title here</title>
<style>
.scrollmenu {
overflow: auto;
white-space: nowrap;
}
</style>
<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">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.5.6/css/buttons.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/select/1.3.0/css/select.dataTables.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/buttons/1.5.6/js/dataTables.buttons.min.js'></script>
<script src='https://cdn.datatables.net/buttons/1.5.6/js/buttons.flash.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js'></script>
<script src='https://cdn.datatables.net/buttons/1.5.6/js/buttons.html5.min.js'></script>
<script src='https://cdn.datatables.net/buttons/1.5.6/js/buttons.print.min.js'></script>
<script src='https://cdn.datatables.net/select/1.3.0/js/dataTables.select.min.js'></script>
<script >
$(document).ready(function() {
$('#someTable').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy',
'csv',
'excel',
'pdf',
{
extend: 'print',
text: 'Print all (not just selected)',
exportOptions: {
modifier: {
selected: null
}
}
}
],
select: true
} );
} );
</script>
<script>
$(function () {
var $chk = $("#grpChkBox input:checkbox");
var $tbl = $("#someTable");
var $tblhead = $("#someTable th");
$chk.prop('checked', true);
$chk.click(function () {
var colToHide = $tblhead.filter("." + $(this).attr("name"));
var index = $(colToHide).index();
$tbl.find('tr :nth-child(' + (index + 1) + ')').toggle();
});
});
</script>
</head>
<body>
<!-- <script type="text/javascript">
$(document).ready(function() {
$('#example').DataTable();
} );
</script> -->
<form>
<div class="content">
<div class="row">
<div class="col-md-9" style="background-color:white;">
<div class="panel panel-default" >
<div class="panel-heading main-color-bg" style="background: linear-gradient(55deg, #0fb8ad 0%, #1fc8db 40%, #2cb5e8 85%);">
<h3 class="panel-title"><a href="viewproduct_2.jsp">
<span class="glyphicon glyphicon-th"></span>
</a> Melting Report View</h3>
<div class="headerbar-item pull-right" style="margin-top:-23px;">
<a href="Meltinglastreporty.jsp" class="btn btn-danger" style="width:200px;">Date Selection</a>
<a style="background:#204b58" class="btn btn-info" onclick="goBack()">Back</a>
</div>
</div>
</div>
<!-- <div id="grpChkBox">
<div style="margin-top:-20px;margin-left:70px;" class="options btn-group pull-right">
<a class="btn btn-success dropdown-toggle fontstyle" data-toggle="dropdown">
Options</a>
<ul class="dropdown-menu">
<li style="margin-left:20px;"><input type="checkbox" name="code">Grn No</li>
<li style="margin-left:20px;"><input type="checkbox" name="Sname">Grn Date</li>
<li style="margin-left:20px;"><input type="checkbox" name="person">Invoice No.</li>
<li style="margin-left:20px;"><input type="checkbox" name="phone">Supplier Name</li>
<li style="margin-left:20px;"><input type="checkbox" name="email">P.O No.</li>
<li style="margin-left:20px;"><input type="checkbox" name="Stype">P.O Date</li>
<li style="margin-left:20px;"><input type="checkbox" name="address">Item Name</li>
<li style="margin-left:20px;"><input type="checkbox" name="Region">Unit</li>
<li style="margin-left:20px;"><input type="checkbox" name="reffered">Item Qty</li>
<li style="margin-left:20px;"><input type="checkbox" name="oneTime">Item Price</li>
<li style="margin-left:20px;"><input type="checkbox" name="code1">Total</li>
<li style="margin-left:20px;"><input type="checkbox" name="code2">Net Amount</li>
</ul></div>
</div> -->
<div style="overflow-x:auto;width:100%;">
<table id="someTable" class="table table-striped table-bordered">
<thead>
<tr>
<th class="code">Heat No</th>
<th class="code">Pig Iron Ci/SG</th>
<th class="Sname">CI Scrap</th>
<th class="person"> Borings</th>
<th class="phone">CRCA</th>
<th class="email">SG</th>
<th class="Stype"> Cast Iron</th>
<th class="address">SG</th>
<th class="Region">Cast Iron</th>
<th class="Region">Fe Silicon Lumps</th>
<th class="oneTime">Fe Manganese</th>
<th class="code1">Shell Coke</th>
<th class="code1">Fe Si Mg</th>
<th class="code2">Copper</th>
<th class="code">Sulphur</th>
<th class="Sname">Chrome </th>
<th class="person"> Phosphorus</th>
<th class="phone">Moly </th>
<th class="person"> Innocuiant Barium</th>
<th class="phone">Innocuiant Ci</th>
<th></th>
</tr>
</thead>
<tbody>
<%
try{
ResultSet rs=null;
int l=0;
rs=st.executeQuery("select * from melt21 where date between '"+from+"' and '"+to+"' ");
while(rs.next())
{
%>
<tr>
<td><%=rs.getString("heatno")%></td>
<td> <%=rs.getString("pig_iron")%> </td>
<td> <%=rs.getString("ciscrap")%> </td>
<td><%=rs.getString("Borings")%> </td>
<td> <%=rs.getString("CRCA")%> </td>
<td> <%=rs.getString("sg1")%></td>
<td> <%=rs.getString("cast1")%></td>
<td> <%=rs.getString("sg2")%> </td>
<td> <%=rs.getString("cast12")%> </td>
<td><%=rs.getString("Fe_Silicon_Lumps")%> </td>
<td><%=rs.getString("Fe_Manganese")%> </td>
<td> <%=rs.getString("Shell_Coke")%> </td>
<td> <%=rs.getString("Fe_Si_Mg")%> </td>
<td><%=rs.getString("copper")%> </td>
<td><%=rs.getString("Sulphur")%> </td>
<td> <%=rs.getString("Chrome")%> </td>
<td><%=rs.getString("pho")%> </td>
<td> <%=rs.getString("mly")%> </td>
<td><%=rs.getString("Innocuiant_Barium")%> </td>
<td> <%=rs.getString("Innocuiant_Ci")%> </td>
<td></td>
<% }
}
catch(Exception el){}
%>
</tr>
</tbody>
<tr>
<td style="text-align: center;"> <label>Total </label></td>
<%
ResultSet re=null;
re=st.executeQuery ("select IFNULL(sum(pig_iron),0)sqty,IFNULL(sum(ciscrap),0)ciscr,IFNULL(sum(Borings),0)br,IFNULL(sum(CRCA),0)cr,IFNULL(sum(Foundry+sg1),0)fs,IFNULL(sum(Rejection+sg2),0)rc,IFNULL(sum(cast1),0)cas,IFNULL(sum(cast12),0)cas1,IFNULL(sum(Fe_Silicon_Lumps),0)fel,IFNULL(sum(Fe_Manganese),0)fem,IFNULL(sum(Shell_Coke),0)shc, IFNULL(sum(Fe_Si_Mg),0)fesimg,IFNULL(sum(copper),0)cop,IFNULL(sum(Sulphur),0)shl,IFNULL(sum(Chrome),0)cho, IFNULL(sum(Innocuiant_Barium),0)innb,IFNULL(sum(Innocuiant_Ci),0)innci,IFNULL(sum(pho),0)pho1,IFNULL(sum(mly),0)mly1 from melt21 where date between '"+from+"' and '"+to+"'");
while(re.next())
{
String sqty = re.getString("sqty");
String ciscr = re.getString("ciscr");
String br = re.getString("br");
String cr = re.getString("cr");
String fs = re.getString("fs");
String rc = re.getString("rc");
String cas = re.getString("cas");
String cas1 = re.getString("cas1");
String fel = re.getString("fel");
String fem = re.getString("fem");
String shc = re.getString("shc");
String fesimg = re.getString("fesimg");
String cop= re.getString("cop");
String shl= re.getString("shl");
String cho = re.getString("cho");
String innb = re.getString("innb");
String innci = re.getString("innci");
String pho1 = re.getString("pho1");
String mly1 = re.getString("mly1");
Double subtot=0.0;
subtot=(Double.parseDouble(sqty)+Double.parseDouble(ciscr)+Double.parseDouble(br)+Double.parseDouble(cr)+Double.parseDouble(fs)+Double.parseDouble(rc)+Double.parseDouble(cas)+Double.parseDouble(cas1)+Double.parseDouble(fel)+Double.parseDouble(fem)+Double.parseDouble(shc)+Double.parseDouble(fesimg)+Double.parseDouble(cop)+Double.parseDouble(shl)+Double.parseDouble(cho)+Double.parseDouble(innb)+Double.parseDouble(innci)+Double.parseDouble(pho1)+Double.parseDouble(mly1));
%>
<td><b><%=re.getString("sqty")%></b></td>
<td><b><%=re.getString("ciscr")%></b></td>
<td> <b><%=re.getString("br")%></b> </td>
<td><b> <%=re.getString("cr")%></b> </td>
<td><b><%=re.getString("fs")%> </b> </td>
<td><b> <%=re.getString("rc")%> </b></td>
<td> <b> <%=re.getString("cas")%></b></td>
<td> <b> <%=re.getString("cas1")%></b></td>
<td><b> <%=re.getString("fel")%> </b></td>
<td><b> <%=re.getString("fem")%></b> </td>
<td><b><%=re.getString("shc")%> </b> </td>
<td><b><%=re.getString("fesimg")%> </b></td>
<td><b> <%=re.getString("cop")%> </b></td>
<td> <b><%=re.getString("shl")%></b> </td>
<td><b><%=re.getString("cho")%> </b></td>
<td> <b><%=re.getString("pho1")%></b> </td>
<td><b><%=re.getString("mly1")%> </b></td>
<td><b><%=re.getString("innb")%> </b> </td>
<td><b> <%=re.getString("innci")%></b> </td>
<td><b> <%=subtot%></b> </td>
<%} %>
</tr>
</table>
</div>
</div>
</div></div>
<%@include file="footer.jsp" %>
</form>
<script type="text/javascript">
function goBack() {window.history.back();};
</script>
</body>
</html>