Current File : /home/obabain/khb_obaba_in/ViewIsuue.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");
     %>
<!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 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" style="margin-top:-22px;margin-left:800px;" href="viewissue_2.jsp">Items Filter</a>
     

 <a class="btn btn-danger" style="margin-top:-26px;margin-left:970px;" href="IssueCreation2.jsp">+New</a>
 
</div></div>


<div style="overflow-x:auto;width:100%;">
<table id="someTable"  class="table table-striped table-bordered">       
       
           <thead>
            <tr class="success">
              
                 <th>Issue No</th>
                 <th>Issue Date</th> 
                  <th>Item Name &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;Issue Qty&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;Closing Stock  </th>    
                   
                                      
            </tr>
       </thead>
              <tbody>
              <%
              	 try{
		
    String query="";	
    
    if(from==null){
    	 rs=st.executeQuery("select * from issue1 "); 
    	
    }else{
 query="select * from issue1  where issue_date between '"+from+"' and '"+to+"' "; 
   
     rs=st.executeQuery(query);
    }
 	while(rs.next())
 	{
 		%> 
            <tr>
                 
                
            <td style="text-align:center"><a href="Issue_no_View1.jsp?id=<%=rs.getString("id")%>"><%=rs.getString("issueno")%></a></td> 
             
                <td>
                <%
ResultSet md=null;
Statement sw=con.createStatement();
md=sw.executeQuery("select DATE_FORMAT('"+rs.getString("issue_date")+"','%e-%c-%Y') as dat");
while(md.next())
{%>

<%=md.getString("dat") %>
            <%   }  %>
                  </td>
               <td>
                <table>
                
                 <%
                 ResultSet rsunit=null;Statement st1=con.createStatement();
                /*  if(from==null){
               	  rsunit=st1.executeQuery("select  * from issue_table it right join issue1 is1 on it.issue_no=is1.id where issue_no='"+ rs.getString("issue_no")+"'");
 
                 }else{ */
                     rsunit=st1.executeQuery("select  * from issue_table  where issue_no='"+ rs.getString("id")+"'  ");
               /*   } */
           while(rsunit.next())
           {
           %> 
               <tr id="a3">
                <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>
                
                <%-- <td style="text-align:center;">
 <a  href="Issue_Edit.jsp?Id=<%=rs.getString("id") %>"><span class="glyphicon glyphicon-pencil"></span></a>
                </td> 
    <td style="text-align:center;">
 <a   href="ChemicaltestDelete.jsp?Id=<%=rs.getString("id") %>" onclick = "if (! confirm('Are you Sure To Delete?')) { return false; }"><span class="glyphicon glyphicon-remove"></span></a>
                </td>  --%>
                </tr>
            <%  
          	}%>
              
                
                </table> 
                
                
           
                  
                  
                  
              </tr>     
                                                 
          <%  
          	}
 	
 	}
              catch(Exception el){
            	  
              }
 	%> 
           
          
            </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+"' ");
            	    }	  
          	while(re.next())
           	{
          	%> 
           <td style="text-align: center;">  <b> <input style="text-align: center;width:150px;margin-left:350px; " class="form-control" type="text" value="<%=re.getString("sqty")%>" readonly ></b>
               </td>
              <%} %>
              
              
              
              
             
                   
                  </tr>
                  
               </table>
            </div>
            </div>
        
</div>
</form>
</body>


<%-- <%@include file="footer.jsp" %>  --%>
<script type="text/javascript">
function goBack() {
    window.history.back();
   
};
</script>

</html>