Current File : /home/obabain/public_html/abc/Materialrequisition_Edit.jsp |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ include file="Connection.jsp" %>
<%ResultSet rs=null;
String id=request.getParameter("Id");
String id2=request.getParameter("id1");
%>
<%!
/* String sortname=null; */
String pname1=null;
String price=null;
String returnqty=null;
String retvalue=null;
%>
<%
Statement st=con.createStatement();
ResultSet rsitem=null;
rsitem=st.executeQuery("select * from material_table where id='"+id+"'");
while(rsitem.next())
{
pname1=rsitem.getString("pname");
price=rsitem.getString("price");
returnqty=rsitem.getString("returnqty");
retvalue=rsitem.getString("retvalue");
}
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="css/select2.min.css" rel="stylesheet">
<link href="css/jquery.datetimepicker.css" rel="stylesheet">
<script type="text/javascript"> window.onload = alertName; </script>
<title>Insert title here</title>
<script type="text/javascript">
window.onload = function(){
document.getElementById('id').onclick = function(e){
alert(document.getElementById("id").value);
return false;
}
}
</script>
</head>
<body onload="getdetails('<%=pname1%>','<%=price%>','<%=returnqty%>','<%=returnqty%>')">
<%@include file="master.jsp" %>
<form action="MaterialrequisitionUpdate.jsp" method="post">
<div class="content">
<div class="row">
<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">Material Requisition Edit </h3>
</div>
</div>
<!-- <a style="background:;margin-top:-23px; " class="btn btn-success pull-right" href="">View</a> -->
<div class="panel-body">
<div class="row" style="margin-left:170px;">
<%-- <div class="form-group col-xs-3">
<div class="onerow">
<input type="hidden" value="<%=id%>" name="id">
<p> <label for="firstname" style="margin:7px;">Item Name</label></p>
<select name="matgr" class="select1 form-control" id="pname1" style="width:170px;margin-left:10px;" value="<%=pname1%>" >
<option value="0">select</option>
<%
PreparedStatement pstmt=null;//create statement
pstmt=con.prepareStatement("select * from issue_table "); //sql select query
ResultSet rs1=pstmt.executeQuery(); //execute query and set in resultset object rs.
while(rs1.next())
{
%>
<option value="<%=rs1.getString("id")%>">
<%=rs1.getString("pname")%>
</option>
<%
}
%>
</select>
</div>
</div> --%>
<div class="form-group col-xs-3">
<input type="hidden" value="<%=id2%>" name="id2">
<input type="hidden" value="<%=id%>" name="id">
<p> <label for="firstname" style="margin:5px;">Item Name</label></p>
<input type="text" name="itemname" class="form-control" id="pname1" value="<%=pname1%>" readonly>
</div>
<div class="form-group col-xs-3">
<p> <label for="firstname" style="margin:5px;">Price</label></p>
<input type="text" name="price1" class="form-control price1" id="box1" oninput="calculate()" value="<%=price%>" readonly>
</div>
<div class="form-group col-xs-3">
<p> <label for="firstname" style="margin:5px;">Return Qty </label></p>
<input type="text" name="rettock" class="form-control price" id="box2" oninput="calculate()" value="<%=returnqty%>">
</div>
<div class="form-group col-xs-3">
<p> <label for="firstname" style="margin:5px;">Return Value </label></p>
<input type="text" name="retvalue" class="form-control netamt1" id="result" >
</div>
</div>
</div>
<div class="modal-footer" id="contact_submit">
<input type="button" value="Back" style="background:#489ee7;" class="pull-left btn btn-info" onclick="goBack()"/>
<a class="btn btn-default" href="">Reset</a>
<input type="submit" style="background:#489ee7;" class="btn btn-info" id="save" onclick="debitcredit();">
</div>
</div>
</div>
</div>
</form>
<%@include file="footer.jsp" %>
<script type="text/javascript">
function goBack() {
window.history.back();
};
</script>
<script>
function getdetails(pname1,issueqty,clstock)
{
document.getElementById("pname1").value=pname1;
document.getElementById("price").value=price;
document.getElementById("returnqty").value=returnqty;
document.getElementById("retvalue").value=retvalue;
}
</script>
<script>
function calculate() {
var myBox1 = document.getElementById('box1').value;
var myBox2 = document.getElementById('box2').value;
var result = document.getElementById('result');
var myResult = myBox1 * myBox2;
result.value = myResult;
}
</script>
</body>
</html>