Current File : /home/obabain/public_html/abc/viewissue_2.jsp
 <%@page import="java.sql.ResultSet"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ include file="Connection.jsp" %>		
  <%@include file="master.jsp" %>
<%Statement st=con.createStatement();%>
   <% ResultSet rs1 = null;
   ResultSet rs=null;%>   
   
    <% String from=request.getParameter("from");
     String to=request.getParameter("to");
     
     String pid=request.getParameter("pid");

     %>
<!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">
<title>   </title>
 
<link href="css/select2.min.css" rel="stylesheet">
    <link href="css/jquery.datetimepicker.css" rel="stylesheet">
 
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="js/jquery.datetimepicker.full.js"></script>

 <link href="css/jquery.datetimepicker.css" rel="stylesheet">
<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>
 
</head>
<style>


</style>
<body>
<script type="text/javascript">
$(document).ready(function() {
    $('#someTable').DataTable();
} );
</script>
 <form  action="issuedatefilter.jsp"method="post" id="contact" name="form1">
<div class="row" style="width:108%;">
<div class="col-md-9"  style="background-color:white;">
<div class="panel panel-default" >
        <div class="panel-heading main-color-bg" >
          <h3 class="panel-title">Issue View</h3>
     
        
       <a class="btn btn-danger pull-right" style="margin-top:-24px;" href="IssueCreation2.jsp">+New</a>
      
     
        <a style="background:;margin-top:-24px; " class="btn btn-success pull-right" href="ViewIsuue.jsp">View All</a>

 
</div>
<div class="row">
<div class="col-md-3"  style="margin-left :20px";>
                            <label> Issued Items </label>
      <select name="pid"  style="width:180px;" class="select form-control" >
       <option value="0">Select</option>
      <%
      ResultSet rsmat=st.executeQuery("select * from ip_products  where product_id in(select item_name from issue_table )order by product_name");
      while(rsmat.next())
      {
      %>
      <option value=" <%=rsmat.getString("product_id") %>">  <%=rsmat.getString("product_name") %></option>
      <%} %> 
      </select>                       
                         </div>
<div class="col-md-3"  style="margin-left :0px";>
                            <label> From&nbsp;Date </label><input type="date" name="from" required  class="form-control" style="width:160px;  float-right:30px;  margin-left: 3px;	margin-top:-4px;height:28px;border-radius:5px;border:1px solid #ccc; ">
                         </div>
 <div class="col-md-3"  style="margin-left: px;  margin-top: -2px;">
                        <label>To &nbsp;Date</label><input type="date"  name="to" required class="form-control" style="width:160px;height:28px;margin-top: -2px; border-radius:5px;border:1px solid #ccc;">
                        </div>
  <div class="col-md-1"  style="margin-left:px; margin-top: -8px;">
   <label> &nbsp;&nbsp;</label>
                      <input type="submit" class="form-control btn btn-danger"  style="margin-top:px;"value="Apply">
                           
                       </div> 
                        <div class="col-md-1"  style="margin-left: px; margin-top: 17px;">
                       <a href="viewissue_2.jsp" class="form-control btn btn-success" style="margin-top:px;" >Reset</a> 
                           
                       </div> 
                       </div>
                       <br><br>
<div style="overflow-x:auto;width:100%;">
<table id="someTable"  class="table table-striped table-bordered">       
       
           <thead>
            <tr class="success">
              <!--   <th>Edit</th> -->
               <!--  <th>Delete</th>  -->
                <!-- <th>Sl.No</th> -->
               <!-- <th>Issue No</th>-->
                <th>Issue Date</th> 
                  <th>Item Name </th>    
                    <th>	Issue Qty</th>   
                    <th>Closing Stock</th>  
                     <!--  <th>	UOM</th>  -->                     
            </tr>
       </thead>
              <tbody>
             
            
               
               
                 <%
                 ResultSet rsunit=null;Statement st1=con.createStatement();
                  
                 if(from==null){
                     rsunit=st1.executeQuery("select * from issue_table   ");

                 }else{
                	 
                     rsunit=st1.executeQuery("select  * from issue_table  where issue_date between '"+from+"' and '"+to+"' and item_name='"+pid+"'");


                 
                 } 
           while(rsunit.next())
           {
           %> 
               <tr id="a3">
              <%--  <td>
             <div id="a2" align="center"style="width:50px;">  <%=rsunit.getString("issue_no")%> </div>
                </td>--%>
                <td>
             <div id="a2" align="center"style="width:120px;">  <%=rsunit.getString("issue_date")%> </div>
                </td>
                <td>
             <div id="a2" align="center"style="width:320px;">  <%=rsunit.getString("pname")%> </div>
                </td>
                 <td>
             <div id="a2" align="center" style="width:150px;">  <%=rsunit.getString("issue_qty")%> </div>
                </td>
                 <td>
             <div id="a2" align="center" style="width:150px;">  <%=rsunit.getString("closing_stock")%> </div>
                </td>
                
                
                </tr>
           
              
               
                                                 
          <%  
          
 	
 	}
             
 	%> 
           
          
            </tbody>
          
               
                    
     <tr>           
       
           <td></td>
              <td style="text-align: center;">  <label> Total Qty</label></td>
             
              <% 
              ResultSet re=null;
              if(from==null){
            	  re=st.executeQuery("select IFNULL(sum(issue_qty),0)sqty from issue_table order by pname ");
              }else{
            	    
            	     re=st.executeQuery("select IFNULL(sum(issue_qty),0)sqty from issue_table tb where issue_date between '"+from+"' and '"+to+"' and item_name='"+pid+"' ");
            	    }	  
          	while(re.next())
           	{
          	%> 
           <td style="text-align: center;">  <b> <input style="text-align: center;width:150px;margin-left:0px; " class="form-control" type="text" value="<%=re.getString("sqty")%>" readonly ></b>
               </td>
              <%} %>
              
                   
                  </tr>
               </table>
            </div>
            </div>
            </div>
        
</div>
</form>
</body>
 <script src="js/select2.min.js"></script>
  <script src="js/jquery.datetimepicker.full.js"></script>
  
    <script>
    $('select').select2();
    </script>
 <script>
     jQuery('#datetimepicker').datetimepicker({
    	 timepicker:false,
    	 todayBtn: "linked"
    	 //mask:true, // '9999/19/39 29:59' - digit is the maximum possible for a cell
    	});
     
     jQuery('#datetimepicker2').datetimepicker({
    	 timepicker:false,
    	 todayBtn: "linked"
    	 //mask:true, // '9999/19/39 29:59' - digit is the maximum possible for a cell
    	});
    </script>
<%-- <%@include file="footer.jsp" %>  --%>
<script type="text/javascript">
function goBack() {
    window.history.back();
   
};
</script>

</html>