Current File : /home/obabain/ms_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;
}

.dropbtn {
  background-color: #009191;
  color: white;
  padding: 5px;
  font-size: 13px;
  border: none;
}

.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f1f1f1;
  min-width: 120px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {background-color: #ddd;}

.dropdown:hover .dropdown-content {display: block;}

.dropdown:hover .dropbtn {background-color: #009191;}
</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>&nbsp;&nbsp;Products&nbsp;/&nbsp;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 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 >Options</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_register where product_id=tb.product_id ))<(select product_qua from ip_products where product_id=tb.product_id) then '#F9E79F' else 'white' end)bg,(select case when ((select sum(qty_pur)from ip_stock_register where product_id=tb.product_id ))<(select product_qua from ip_products where product_id=tb.product_id) then 'red' else 'black' end)col,(select case when ((select sum(qty_pur)from ip_stock_register where product_id=tb.product_id ))<((select product_qua from ip_products 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_register 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_products tb  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_name") %></td>
<!--td><%=rs.getString("product_sku")%></td-->

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


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

<td>
<div class="dropdown">
  <button class="dropbtn">Options</button>
  <div class="dropdown-content">
  <a href="editProduct.jsp?Id=<%=rs.getString("product_id")%>">
<span class="fontstyle">Edit</span>
  <a href="deleteProduct.jsp?Id=<%=rs.getString("product_id") %>" onclick = "if (! confirm('Continue?')) { return false; }">Delete</a>

 
  </div>
</div>

</td>

 
   
   </tr>    
   <%}%> 
  </tbody> 
  </table>
  
  
  
  
  


<!-- </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>