Current File : //home/obabain/khb_obaba_in/ViewProduce.jsp |
<%@include file="master.jsp"%>
<style type="text/css">
.highlight-error {
border-color: red;
}
table, th, td {
border: 1px solid black;
width:30px;
}
.inlineTable {
display: inline-block;
}
.panel-default>.panel-heading-custom {
background: #ff0000;
color: #fff;
}
</style>
<!-- <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>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<body>
<%Statement st=con1.createStatement(); %>
<%! int i2; int i1;int id1;int sub; int id;String mocus_id, Scheduledate, Product, BillofMaterial, ProductQty, ResponsiblePerson, RawMaterialLocation, Locations; %>
<%
ResultSet rs123=st.executeQuery("select max(mo_id) as mo_id from manufacture_order");
while(rs123.next()){
id=rs123.getInt("mo_id");
}
%>
<%
ResultSet rs=st.executeQuery("select * from manufacture_order where mo_id='"+id+"'");
while(rs.next()){
Product=rs.getString("Product");
ProductQty=rs.getString("ProductQty");
i1=Integer.parseInt(ProductQty);
}
%>
<!-- Start -->
<%! int q1,q2;int str; String ty=null; String mid=null;String p_id,type,qun ,p2, p1;%>
<%
ResultSet rs1=st.executeQuery("select * from manufacture_order where mo_id=(select max(mo_id) as mo_id from manufacture_order)");
while(rs1.next()){
mocus_id=rs1.getString("mocus_id");
Scheduledate=rs1.getString("Scheduledate");
Product=rs1.getString("Product");
BillofMaterial=rs1.getString("BillofMaterial");
ProductQty=rs1.getString("ProductQty");
i1=Integer.parseInt(ProductQty);
ResponsiblePerson=rs1.getString("ResponsiblePerson");
RawMaterialLocation=rs1.getString("RawMaterialLocation");
Locations=rs1.getString("Location");
p_id=rs1.getString("p_id");
type=rs1.getString("type");
mid=rs1.getString("mo_id");
}
%>
<!-- End-->
<div class="row">
<form action="addcustomer.jsp" method="post" id="contact" name="form1">
<section id="main">
<div class="container">
<div class="row" style="width: 110%">
<div class="col-md-10">
<div class="panel panel-default">
<div class="panel-heading main-color-bg">
<h3 class="panel-title">Produce</h3>
</div>
<br> <br>
<div class="panel-body">
<div class="row">
<!-- <label for="lastname" style="margin:5px;">manufacturingOrder:</label>
<input id="lastname" class=" input-group-lg reg_name" style="width:170px;margin:5px;" type="text"
title="Enter last name"
name="address" placeholder=""/> -->
<label for="lastname" style="margin-left: 5px;">Produce Product:</label>
<input id="lastname" class="" style="width:170px;margin:5px; type="text" value="<%=Product %>"
title="Enter last name" name="contactperson" placeholder=""/>
<%-- <select id="lastname" style="width:170px;margin:5px;height:25px;" type="text"
title="Enter last name"
value="<%=Product %>" name="cl">
<option></option><option></option>
</select> --%>
<div class="form-group col-xs-2">
<p>
<label for="lastname" style="margin: 5px;"> </label>
</p> </div> </div>
<div class="row">
<label for="lastname" style="margin-left: 11px;">Select Quantity:</label>
<input id="lastname" class="" style="width:170px;margin:5px; type="text" value="<%=i1 %>"
title="Enter last name" name="contactperson" placeholder=""/>
<div class="form-group col-xs-2">
<p>
<label for="firstname" style="margin: 5px;"></label>
</p>
</div> </div>
<!-- <div class="modal-footer" id="contact_submit">
<!-- <input type="button" value="Back" style="background:#204b58;margin-right:720px" class="btn btn-info" />
<a class="btn btn-default" href="createCompany.jsp">Reset</a>
<button type="submit" style="background:#204b58" class="btn btn-info" >Save Changes</button>
</div> -->
<hr>
<div class="row">
<!-- <div class="panel-body">
<div class="inlineTable">
<div class="col-md-6">
<table class="table table-bordered" id="myTable" style="margin-left:180px;">
<b style="margin-left:180px;">To Consume</b>
<tr>
<th>Product</th>
<th>Quantity</th>
</tr>
<tr>
<td><input type="text" name="item[]" style="width:170px;" ></td>
<td><input type="text" name="item[]" style="width:170px;" ></td>
</tr>
</table>
</div>
</div>
<div class="inlineTable">
<a href="ViewConfirm.jsp"> <button type="button" class="btn btn-primary"style="margin-left:755px;">Confirm</button></a>
<button type="button" class="btn btn-primary"style="margin-left:px;">cancel</button>
</div>
</div> -->
<div>
<table class="table table-bordered" id="loader" style="width:50% "> <!-- style="display:none;" -->
<thead>
<tr>
<!-- <th>HSN</th> -->
<th>Product</th>
<th>Required Qty</th>
<!-- <th>Available Qty</th> -->
<!-- <th>Stock Status</th> -->
</tr>
</thead>
<tbody>
<%
ResultSet rq=st.executeQuery("select tb.hsn,tb.product,tb.fg_id, (quantity*"+ProductQty+")qty,(case when ((select product_qua from ip_products where product_id=tb.fg_id)+(select sum(qty_pur) from ip_stock_register where product_id=tb.fg_id))>((quantity*"+ProductQty+")) then 'black' else 'red' end) stat,(case when ((select product_qua from ip_products where product_id=tb.fg_id)+(select sum(qty_pur) from ip_stock_register where product_id=tb.fg_id))>((quantity*"+ProductQty+")) then 'Stock is available' else 'Insufficient Stock' end)stock,((select product_qua from ip_products where product_id=tb.fg_id)+(select sum(qty_pur) from ip_stock_register where product_id=tb.fg_id))avl from bom_rawmaterial tb where d1_id="+p_id+"");
while(rq.next())
{
%>
<tr>
<%-- <td><%=rq.getString("hsn") %></td> --%>
<td><%=rq.getString("product") %></td>
<td><%=rq.getString("qty") %></td>
<%-- <td><span style="color:<%=rq.getString("stat")%>;"><%=rq.getString("avl") %></span></td>
<td><span style="color:<%=rq.getString("stat")%>;"><%=rq.getString("stock") %></span></td> --%>
</tr>
<%} %>
</tbody>
</table>
<div>
<%
String s=null;
ResultSet rb1=st.executeQuery("select tb.hsn,tb.product,tb.fg_id from bom_rawmaterial tb where d1_id="+p_id+" and ((select product_qua from ip_products where product_id=tb.fg_id)+(select sum(qty_pur) from ip_stock_register where product_id=tb.fg_id))<(quantity*"+ProductQty+")");
if(rb1.next()){
s="Insufficient Stock";
}
else
{
s="Stock is Available";
}
%>
<input type="hidden" id="stock" name="stock" value="<%=s%>">
</div>
</div>
<div class="inlineTable">
<a href="ViewConfirm.jsp"> <button type="button" class="btn btn-primary"style="margin-left:755px;">Confirm</button></a>
<button type="button" class="btn btn-primary"style="margin-left:px;">cancel</button>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<%-- <% }else{
response.sendRedirect("login.jsp");
} %> --%>
<script src="http://cdn.ckeditor.com/4.6.1/standard/ckeditor.js"></script>
<script src="http://cdn.ckeditor.com/4.6.1/standard/ckeditor.js"></script>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script
src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
<script
src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$('[data-type="adhaar-number"]').keyup(
function() {
var value = $(this).val();
value = value.replace(/\D/g, "").split(/(?:([\d]{4}))/g)
.filter(s = s.length > 0).join("-");
$(this).val(value);
});
$('[data-type="adhaar-number"]').on("change, blur", function() {
var value = $(this).val();
var maxLength = $(this).attr("maxLength");
if (value.length != maxLength) {
$(this).addClass("highlight-error");
alert("Aadhar card number not valid");
} else {
$(this).removeClass("highlight-error");
}
});
</script>
</form>
</div>
</body>
</html>