Current File : /home/obabain/autoclutchess_obaba_in/Componentsadd.jsp |
<%@include file="master.jsp" %>
<%@ include file="Connection.jsp" %>
<% String id=request.getParameter("Id");
session.setAttribute("sd_id",id);
//System.out.println(id);
%>
<%!
String clname=null; %>
<%Statement st=con.createStatement();
ResultSet rs= null;
id=request.getParameter("Id");
rs=st.executeQuery("select * from customer_component where id="+id+"");
while(rs.next())
{
clname=rs.getString("customer_name");
}
%>
<style type="text/css">
.highlight-error {
border-color: red;
}
.template { display: none; }
</style>
<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>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<body >
<form action="componentsaddprodDA.jsp" method="post">
<div class="row">
<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" style="height:40px;">
<!-- <a href="Dashboard.jsp" style="color:white;"><b>Home /</b></a>
<a href="" style="color:white;"><b>Master /</b></a> -->
<a href="#" style="color:white;"><b> Customer Product</b></a>
<a class="btn btn-danger" style="margin-left:995px;margin-top:-25px;" href="componentview1.jsp">View</a>
<div style="margin-top:-25px;margin-left:970px;">
<!-- <a style="background:" class="btn btn-danger" href="material_type.jsp">New</a> -->
</div></div></div>
<!-- <div align="right" >
<a style="background:#204b58;" class="btn btn-info" href="ViewCustomer.jsp">View</a>
</div> -->
<center> <h3> Customer Name:<%=clname%></h3></center>
<input type="hidden" name="customer" value="<%=clname%>">
<input type="hidden" name="custid" value="<%=id%>">
<div class="panel-body" >
<hr>
<h3>Add Products:</h3>
<br>
<div style="overflow-x:auto;">
<table class="table table-bordered table-hover additionalMargin alignment" id="table1">
<thead><tr class="info">
<th style="text-align:center ">Product Name:</th>
<th>Part No.</th>
<th>Grade</th>
<th>No.of Cavity</th>
<th>Pattern Material</th>
<th>Pattern Type</th>
<th>Core Box Metal</th>
<th>No.of Core Box</th>
<th>No.core Box In Set</th>
<th>Casting Wt/pc</th>
<th>PRNG wt/pc</th>
<th>Returns wt/pc</th>
<th>Casting wt/box</th>
<th>PRNG wt/box</th>
<th>Return wt/box</th>
<th>Yeild %</th>
<th>No.of Cores/pc</th>
<th>Core Process</th>
<th>Single Casting Core Wt in Kg</th>
<th>Mould Process</th>
<th>Mould Wt Top in Kg</th>
<th>Mould Wt Bottom in Kg</th>
<th>Sleeve Size</th>
<th>Sleeve Qty</th>
<th>Filter Qty</th>
<th>Mould Box Size Top</th>
<th>Mould Box Size Bottom</th>
<th>Delete</th></tr></thead>
<tr class='template'>
<td><input type="text" class=" form-control" name="1[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="2[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="3[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="4[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="5[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="6[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="7[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="8[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="9[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="10[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="11[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="12[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="13[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="14[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="15[]" value="" style="width:90px;" ></td>
<td><input type="text" class=" form-control" name="16[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="17[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="18[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="19[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="20[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="21[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="22[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="23[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="24[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="25[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="26[]" style="width:90px;" value="" ></td>
<td><input type="text" class=" form-control" name="27[]" style="width:90px;" value="" ></td>
<td><a href='#' onclick='deleteRow(this)'><i class='glyphicon glyphicon-trash'></a></td>
</tr>
</table>
<a id='add' style="margin-left:100px;" class="pull-left btn btn-default">ADD</a><br>
</div>
<br>
<div class="modal-footer" id="contact_submit">
<input type="button" value="Back" style="background:#204b58;" class="pull-left btn btn-info" onclick="goBack()"/>
<a class="btn btn-default" href="#">Reset</a>
<button type="submit" style="background:#204b58" class="btn btn-info" >Save Changes</button>
</div>
</div>
</div>
</div>
</div>
</form>
<%@include file="footer.jsp" %>
</body>
<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 src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/js/select2.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script>
$(function() {
initThings();
$('#add').on('click', function() { add_row($('#table1')); });
});
function add_row($table) {
var tr_id = $table.find('tr').length - 1;
var $template = $table.find('tr.template');
var $tr = $template.clone().removeClass('template').prop('id', tr_id);
$tr.find(':input').each(function() {
if($(this).hasClass('hasDatepicker')) {
$(this).removeClass('hasDatepicker').removeData('datepicker');
}
var input_id = $(this).prop('id');
input_id = input_id + tr_id;
$(this).prop('id', input_id);
var new_name = $(this).prop('name');
new_name = new_name.replace('[0]', '['+ tr_id +']');
$(this).prop('name', new_name);
$(this).prop('value', '');
});
$table.find('tbody').append($tr);
$('.byto:last').val(1);
$(".dateControl", $tr).datepicker({
dateFormat: "dd-mm-yy"
});
$(".selectType", $tr).select2();
$(".qty", $tr).select2();
$(".selectType:last").val(0).trigger("change");
$(".qty:last").val(0).trigger("change");
}
function initThings() {
add_row($('#table1'));
}
</script>
<script langauge="JavaScript">
function deleteRow(btn) {
var row = btn.parentNode.parentNode;
row.parentNode.removeChild(row);
var sum = 0;
var sum2=0;
$(".amt").each(function(){
sum += +$(this).val();
});
$(".total").val(sum);
$(".amt2").each(function(){
sum2 += +$(this).val();
})
$(".total2").val(sum2);
};
</script>
<script type="text/javascript">
function goBack() {
window.history.back();
};
</script>
<script>
$(document).on("change",".selectMat",function(){
var p=[];
var str=$(".selectMat:last").find("option:selected").text();
//alert(str);
p=str.split('--');
var a=p[1];
$(".descr:last").val(a);
$(".revno:last").val(p[2]);
$(".drgno:last").val(p[3]);
$(".div:last").val(p[4]);
$(".buyer:last").val(p[5]);
$(".price:last").val(p[6]);
});
</script>
</html>