Current File : //home/obabain/autoclutchess_obaba_in/ViewProduct.jsp |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@page import="java.sql.*,java.util.*"%>
<%@page import="java.sql.ResultSet"%>
<%@ 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>
<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>
<script>
function myFunction1(m_id)
{
var result = confirm("Are You Sure To Delete?");
if(result)
{
window.location.href = 'fettling&griding_Delete.jsp?id=' +id;
}
else
{
window.location.href = 'Fettling&grinding_view.jsp';
}
}
</script>
<style>
.button{ background-color: #4CAF50;}
.button:hover {background-color: blue}
.button:active {
background-color: #3e8e41;
box-shadow: 0 5px #666;
transform: translateY(4px);
border-radius: 15px;
}
</style>
</head>
<script type="text/javascript">
$(document).ready(function() {
$('#example').DataTable();
} );
</script>
<body>
<div class="row">
<div class="col-sm-9">
<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> Products / Inventory View</h3>
<div class="headerbar-item pull-right" style="margin-top:-23px;">
<!-- <a class="btn btn-primary" style="background:#204b58" href="AddProduct2.jsp">Create Casting</a>-->
<a class="btn btn-primary" style="background:#204b58" href="castingView.jsp">Casting Items View</a>
<a style="background:#204b58" class="btn btn-info" onclick="goBack()">Back</a>
<a class="btn btn-primary" style="background:#204b58" href="AddProduct.jsp">New</a>
</div>
</div>
<div class="panel-body">
<table class="table table-bordered" id="example" >
<thead>
<tr class="success">
<th>Sl.No</th>
<th></th>
<th>Product Group</th>
<th>Product Name</th>
<th>Product Price</th>
<th>Product Qty</th>
<th>Product Unit</th>
<th >Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<%
Statement st=con.createStatement();
ResultSet rs=null;
int i=0;
rs=st.executeQuery("select tb.*,(select case when ((select sum(qty_pur)from ip_stock_register1 where product_id=tb.product_id ))<(select product_qua from ip_products1 where product_id=tb.product_id) then '#F9E79F' else 'white' end)bg,(select case when ((select sum(qty_pur)from ip_stock_register1 where product_id=tb.product_id ))<(select product_qua from ip_products1 where product_id=tb.product_id) then 'red' else 'black' end)col,(select case when ((select sum(qty_pur)from ip_stock_register1 where product_id=tb.product_id ))<((select product_qua from ip_products1 where product_id=tb.product_id)) then 'img/red-warning-sign.png' else 'img/images.jpg' end)al,(select sum(qty_pur) from ip_stock_register1 where product_id=tb.product_id)avl,(select family_name from ip_families where family_id=tb.family_id)family,(select unit_name_plrl from ip_units where unit_id=tb.unit_id)unit,(select tax_rate_percent from ip_tax_rates where tax_rate_id=tb.tax_rate_id)tax_rate from ip_products1 tb where branch_id="+loginid+" order by product_name asc ");
while(rs.next()){
i+=1;
%>
<tr>
<td><%=i %></td>
<td><img src="<%=rs.getString("al")%>"></td>
<td><%=rs.getString("family") %></td>
<!--td><%=rs.getString("product_sku")%></td-->
<td><a href="ViewProduct2.jsp?id=<%= rs.getString("product_id")%>"><%=rs.getString("product_name")%></a></td>
<td><%=rs.getString("product_price")%></td>
<td><%=rs.getString("product_qua")%></td>
<td><%=rs.getString("unit")%></td>
<td> <a href="editProduct.jsp?Id=<%=rs.getString("product_id")%>"> <span class="glyphicon glyphicon-edit"></span></a> </td>
<td> <a href="deleteProduct.jsp?Id=<%=rs.getString("product_id")%>" onclick = "if (! confirm('Continue?')) { return false; }"> <span class="glyphicon glyphicon-remove"></span></a> </td>
</tr>
<%}%>
</tbody>
</table>
<button class="btn btn-primary" onclick="goBack()">Back</button>
<!-- </div> -->
<script type="text/javascript">
function goBack()
{
window.history.back();
};
</script>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$("#myInput").on("keyup", function() {
var value = $(this).val().toLowerCase();
$("#myTable tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
</script>
</div>
</body>
</html>