Current File : //home/obabain/public_html/abc/wip_form_1.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
    <%@include file="Connection.jsp" %>
<%
    
    	Statement st=con.createStatement();
    
String cd=request.getParameter("cid"); 
String cast=null;
    %>
 
 <%
ResultSet rg1=null;

         	Statement sg6=con.createStatement();

         	rg1=sg6.executeQuery("select * from  ip_wcasting where cid="+cd+" ");

    	while(rg1.next())
    		
    	{
    		
            cast=rg1.getString("c_no");
             
              }
    		 %>       
<!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">
 
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>


<title>Insert title here</title>
</head>
<body>
<%@include file="master.jsp" %>
<form action="wip_daily_insert.jsp"  method="post" >

<section id="main">
<div class="container">
 <div class="row" >
    <div class="col-md-10"  style="width:1140px;margin-left:120px;margin-top:-280px;" >
       <div class="panel panel-default" >
       <div class="panel-heading main-color-bg">
        <h3 class="panel-title">WIP --<span  style="color:white;"><b> Daily Wise Entry</b></span></h3>
        <a style="background:;margin-top:-23px; " class="btn btn-success pull-right" href="wip_casting_View.jsp">View</a>
    </div>
     <div style="overflow-x:auto;width:95%;">
    <table>
    <tr>
    
     <%
ResultSet rp41=null;

         	Statement sp41=con.createStatement();

	rp41=sp41.executeQuery("select * from  ip_wstockitems where casting_no="+cd+" group by cdate ");

    	while(rp41.next())
    		
    	{
    		 %>
            <td>
      <a href="wip_datewiseDA.jsp?cid=<%=cd%>&did=<%=rp41.getString("cdate")%>" class="btn btn-success" ><%=rp41.getString("cdate")%></a>
            </td>
            
            <%  }
    		 %> 
    		 
    		 
    </tr>
    
    </table>
    
    </div>
          <div class="panel-body">
         
           <br>
   <div class="row"> 
   <div class="col-xs-2">
        <label for="lastname" style="margin-left:10px;">Casting No</label>
         <input type="text" name="cast" class="form-control" value="<%=cast%>" readonly="readonly">  
                <input type="hidden" name="cno" class="form-control" value="<%=cd%>">  
         
         
      </div>
    <div class="col-xs-3">
        <label for="lastname" style="margin-left:10px;color:blue;">Date</label>
         <input type="date" name="cdate" class="form-control" style="border:1px solid blue; " required>  
      </div>
   
    
       </div>
    
   <br>
    <div style="overflow-x:auto;">  
  <table class="table table-bordered " >
        <thead>
          <tr>
            <th class="text-center">P.O NO/P.O Date </th>
            <th class="text-center">  Product </th>
            <th class="text-center"> Material </th>
            <th class="text-center"> P.O Qty </th>
            <th class="text-center">WO&nbsp;Qty </th>
            <th class="text-center"> Fdy </th>
            <th class="text-center"> Fet </th>
            <th class="text-center"> HT </th>
            <th class="text-center">F.Insp </th>  
            <th class="text-center"> Total Qty </th>
            <th class="text-center"> Rejection Qty </th>
            <th class="text-center"> Des Qty </th>
            <th class="text-center"> Bal Qty </th>
          </tr>
        </thead>
        <tbody>
        
        		 <%
ResultSet rs=null;


	rs=st.executeQuery("select * from  ip_wpo where cid='"+cd+"' order by pid desc ");

    	while(rs.next())
    		
    	{
    		 %>
          <tr>
            <td>
                <br><br>  <input type="text" readonly="readonly" class="form-control " style="width:120px;" value="<%=rs.getString("po_no")%> / <%=rs.getString("po_date")%>"/>
            
            </td>
              <td>
       <table>
                <tr>
             <td style="color:blue;">
               <%
ResultSet rs1=null;

           	Statement st1=con.createStatement();
            int iz=1;
	rs1=st1.executeQuery("select * from  ip_witems where pid="+rs.getString("pid")+" ");

    	while(rs1.next())
    		
    	{
    		 %>
             <%-- <%=rs1.getString("item_description")%><br>  --%>
             <input type="hidden" name='product[]' class="form-control qty"  value="<%=rs1.getString("part_name")%>"/>
             
             <input type="text" readonly="readonly" class="form-control qty" style="width:210px;" value="<%=rs1.getString("item_description")%>"/><br>
            <% 
            iz++;
    	
    	}
    		 %>
             </td>
                
                </tr>
                
                </table> 
                    
              
              
              </td>
            
            <td>
            <table>
                <tr>
             <td style="color:blue;">  
             
             <%
ResultSet rs2=null;

         	Statement st2=con.createStatement();

	rs2=st2.executeQuery("select * from  ip_witems where pid="+rs.getString("pid")+" ");

    	while(rs2.next())
    		
    	{
    		 %>
            
                <input type="text" name='material[]' readonly="readonly" class="form-control qty" style="width:80px;" value="<%=rs2.getString("material")%>" /><br>
            <%  }
    		 %> 
              </td>
                
                </tr>
                
                </table> 
            
            
         </td>
            <td>
            <table>
                <tr>
             <td style="color:blue;">  
          <%
ResultSet rs3=null;

         	Statement st3=con.createStatement();

	rs3=st3.executeQuery("select * from  ip_witems where pid="+rs.getString("pid")+" ");

    	while(rs3.next())
    		
    	{
    		 %>
            
              <input type="text" name='po_qty[]' readonly="readonly" class="form-control " style="width:80px;"  value=" <%=rs3.getString("po_qty")%>" /><br>
            <%  }
    		 %> 
             
             </td>
                </tr>
                </table>   
            
           </td>
            <td>
              <table>
                <tr>
             <td style="color:blue;">  
              <%
ResultSet rs4=null;

         	Statement st4=con.createStatement();

	rs4=st4.executeQuery("select * from  ip_witems where pid="+rs.getString("pid")+" ");

    	while(rs4.next())
    		
    	{
    		 %>
            
             <input type="text" name='wqty[]'  readonly="readonly" class="form-control" style="width:80px;" value="<%=rs4.getString("wqty")%>" ><br>
            <%  }
    		 %> 
    		 
    		 </td>
                
                </tr>
                
                </table> 
            
            
            
            </td>
      <td>
      
       <table>
                <tr>
             <td style="color:blue;">  
              <%
ResultSet rs41=null;

         	Statement st41=con.createStatement();

	rs41=st41.executeQuery("select * from  ip_witems where pid="+rs.getString("pid")+" ");

    	while(rs41.next())
    		
    	{
    		 %>
            
      <input type="text" name='fdy[]'   class="form-control" style="width:80px;"  value="0" ><br>
            <%  }
    		 %> 
    		 
    		 </td>
                
                </tr>
                
                </table> 
      
      
     </td>
           
            <td>
            
          <table>
                <tr>
             <td style="color:blue;">    
             
        <%
ResultSet rs5=null;

         	Statement st5=con.createStatement();

	rs5=st5.executeQuery("select * from  ip_witems where pid="+rs.getString("pid")+" ");

    	while(rs5.next())
    		
    	{
    		 %>
            
          <input type="text" name="fet[]"   class="amt form-control" style="width:80px;" value="0" ><br>    
            <%  }
    		 %>      
             
             </td>
                
                </tr>
                
                </table>    
            
   
    </td>
    <td>
    
      <table>
                <tr>
             <td style="color:blue;">  
            <%
ResultSet rs6=null;

         	Statement st6=con.createStatement();

	rs6=st6.executeQuery("select * from  ip_witems where pid="+rs.getString("pid")+" ");

    	while(rs6.next())
    		
    	{
    		 %>
            
             <input type="text" name="ht[]"  class="amt form-control" style="width:80px;" value="0"> <br>
            <%  }
    		 %>      
              </td>
                
                </tr>
                
                </table> 
             
    
    
       
    </td>
    <td>
      <table>
                <tr>
             <td style="color:blue;">  
              <%
ResultSet rs7=null;

         	Statement st7=con.createStatement();

	rs7=st7.executeQuery("select * from  ip_witems where pid="+rs.getString("pid")+" ");

    	while(rs7.next())
    		
    	{
    		 %>
    		 
    		 <input type="text" name="f_insp[]"  class="form-control" style="width:80px;" value=" 0"> 
            <br>
             
            <%  }
    		 %>      
               
               </td>
                
                </tr>
                
                </table> 
    
   
    </td>   
     
     <td>
      <table>
                <tr>
             <td style="color:blue;">    
             <%
ResultSet rs9=null;

         	Statement st9=con.createStatement();

	rs9=st9.executeQuery("select * from  ip_witems where pid="+rs.getString("pid")+" ");

    	while(rs9.next())
    		
    	{
    		 %>
    		 
    	 <input type="text" name="total[]"  class="form-control" style="width:80px;" value="0"/>	 
             <br>
             
            <%  }
    		 %>   
             </td>
                
                </tr>
                
                </table> 
     
   
    </td>   
      <td>
     <table>
                <tr>
             <td style="color:blue;">  
              <%
ResultSet rs8=null;

         	Statement st8=con.createStatement();

	rs8=st8.executeQuery("select * from  ip_witems where pid="+rs.getString("pid")+" ");

    	while(rs8.next())
    		
    	{
    		 %>
    		 
    	<input type="text" name="rej_qty[]" class="form-control" style="width:80px;" value="0">	 
            <br>
             
            <%  }
    		 %>      
             </td>
                
                </tr>
                
                </table>   
      
      
    
    </td> 

         
         <td>
         
     <table>
                <tr>
             <td style="color:blue;">  
              <%
ResultSet rs81=null;

         	Statement st81=con.createStatement();

	rs81=st81.executeQuery("select * from  ip_witems where pid="+rs.getString("pid")+" ");

    	while(rs81.next())
    		
    	{
    		 %>
    		 
    	<input type="text" name="disp[]" class="form-control" style="width:80px;" value="0">	 
            <br>
             
            <%  }
    		 %>      
             </td>
                
                </tr>
                
                </table>       
         
         
         
    
    </td>
     <td>
      <table>
                <tr>
             <td style="color:blue;">  
              <%
ResultSet rs82=null;

         	Statement st82=con.createStatement();

	rs82=st82.executeQuery("select * from  ip_witems where pid="+rs.getString("pid")+" ");

    	while(rs82.next())
    		
    	{
    		 %>
    		 
    	<input type="text" name="bal[]" class="form-control" style="width:80px;" value="0">	 
            <br>
             
            <%  }
    		 %>      
             </td>
                
                </tr>
                
                </table>   
     
     
     
    
    </td>
         
          </tr>
         <%
	}
	%>
        </tbody>
      </table>
  
  </div>
  
  
           </div>      
         <div class="modal-footer" id="contact_submit">
         <input type="button" value="Back" style="background:#204b58;margin-right:720px" class="btn btn-info" onclick="goBack()" />
          <a class="btn btn-default"  href="">Reset</a>
        <input type="submit" style="background:#204b58;" class="btn btn-info" value="Save changes">
      </div>      
      
      <br>   
   
   
         
     </div>
     </div>  
    
  </div>
  </div>
</section>

</form>







</body>

 


 <script>
$(document).on("change",".itemselect",function(){
	
	var p=[];
	var a=$(".itemselect:last").find("option:selected").text();
	p=a.split('|');
	
	$(".item:last").val(p[0]);
	$(".descr:last").val(p[2]);
	$(".revno:last").val(p[1]);
	
	$(".drawno:last").val(p[3]);
	$(".materialgroup:last").val(p[4]);
	$(".price:last").val(p[5]);
	$(".discount:last").val(p[6]);
	$(".curr:last").val(p[7]);
	$(".ouom:last").val(p[8]);
	$(".sloc:last").val(p[9]);
	
});
</script>


<script>
function goBack() {
  window.history.back();
}
</script>



</html>