Current File : /home/obabain/public_html/abc/Issue_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 issueqty=null; 
     String clstock=null; 
     String 	price=null; 
     String 	itemid=null; 
     %>
       
       
       <%
     Statement st=con.createStatement(); 
     ResultSet rsitem=null;
    
    
     rsitem=st.executeQuery("select * from issue_table where id='"+id+"'");
     while(rsitem.next())
     {
    	 pname1=rsitem.getString("pname");
    	 issueqty=rsitem.getString("issue_qty");
    	 clstock=rsitem.getString("closing_stock");
    	 
    		price=rsitem.getString("price");
    		itemid=rsitem.getString("item_name");
     }
     %>
   
     <!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%>','<%=issueqty%>','<%=clstock%>')">
<%@include file="master.jsp" %>
<form action="IssueUpdate.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">Issue 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>
                <input type="hidden" name="itemid" class="form-control"   value="<%=itemid%>" >
               </div>   
               <div class="form-group col-xs-3">
               <p> <label for="firstname" style="margin:5px;">Issue Price</label></p>
               <input type="text" name="price" class="form-control" id="box1" oninput="calculate()"  value="<%=price%>" readonly>
               
               </div> 
<div class="form-group col-xs-3">
               <p> <label for="firstname" style="margin:5px;">Issue Qty</label></p>
               <input type="text" name="issuqty" class="form-control" id="box2" oninput="calculate()" value="<%=issueqty%>">
               
               </div> 
 <div class="form-group col-xs-3">
               <p> <label for="firstname" style="margin:5px;">Closing Qty	</label></p>
               <input type="text" name="clstock" class="form-control" id="clstock"  value="<%=clstock%>">
              
               </div>

<div class="form-group col-xs-3">
               <p> <label for="firstname" style="margin:5px;">Issue Value	</label></p>
               <input type="text" name="value" class="form-control" 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("issueqty").value=issueqty;
  document.getElementById("clstock").value=clstock;
}
</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>