Current File : //home/obabain/public_html/abc/Tc_Items.jsp |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ include file="Connection.jsp" %>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.*,java.util.*"%>
<%
String tname=null;
Statement st=con.createStatement();
String tid=request.getParameter("tid");
%>
<%
ResultSet rs123=st.executeQuery("select * from test_certificate12 where id='"+tid+"'");
while(rs123.next())
{
tname=rs123.getString("t_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 rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> -->
<!-- <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"> -->
<title>Insert title here</title>
<link href="fSelect.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="fSelect.js"></script>
<script>
(function($) {
$(function() {
$('#test').fSelect();
});
})(jQuery);
</script>
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> -->
</head>
<%@include file="master.jsp" %>
<style>
table {
border-collapse: collapse;
border-spacing: ;
width: 80%;
border: 1px solid #ddd;
}
th, td {
text-align: left;
padding: 16px;
}
tr:nth-child(even) {
background-color: #f2f2f2
}
.rrow {
display:inline-block;
clear: both;
}
.center {
margin: auto;
width: 60%;
padding: 20px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.hideform
{
display:none;
}
</style>
<body>
<script>
// JavaScript popup window function
function basicPopup(url) {
popupWindow = window.open(url,'popUpWindow','height=300,width=700,left=50,top=50,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes')
}
</script>
<div class="container">
<div class="row" style="width:120%">
<div class="col-md-9" >
<div class="panel panel-default" >
<div class="panel-heading main-color-bg" >
<h3 class="panel-title">Tc--Add Items</h3>
</div>
<div class="panel-body">
<br>
<!-- The Modal -->
<div class="">
<!-- Modal content -->
<div class="">
<form action="Tc_Item_DA.jsp" method="post">
<div class="form-group" style="margin-left:50px;">
<div class="row">
<div class="col-sm-4">
<label for="">Select Items:</label>
<select name="productid" class="form-control " style=""> <!-- style="height: 50px;" -->
<%
ResultSet rs1=st.executeQuery("SELECT * FROM ip_products where family_id=7");
while(rs1.next())
{
%>
<option value="<%=rs1.getString("product_id")%>"> <%=rs1.getString("product_name") %> </option>
<%
}
%>
</select>
</div>
<div class="col-sm-4" style="margin-left:10px;">
<label for="">PartNo/DRG No</label>
<input type="text" name="partno" class="form-control">
</div>
<div class="col-sm-3" >
<label for="">Tc No:</label>
<input type="text" name="tname" class="form-control" value="<%=tname%>" readonly>
<input type="hidden" name="tid" class="form-control" value="<%=tid%>" readonly>
</div>
</div>
</div>
<div class="form-group" style="margin-left:50px;">
<div class="row">
<div class="col-sm-4">
<label for="">Select Heat:</label>
<select name="heatno[]" multiple="multiple" id="test" class="form-control " > <!-- style="height: 50px;" -->
<%
ResultSet rs14=st.executeQuery("select * from test_certificate_data group by heat");
while(rs14.next())
{
%>
<option value="<%=rs14.getString("heat")%>"> <%=rs14.getString("heat") %> </option> <%--<%=rs14.getString("position") %> --%>
<%
}
%>
</select>
</div>
<div class="col-sm-3" >
<label for="">Qty in No:</label>
<input type="text" name="qtyno" class="form-control" required="required">
</div>
<div class="col-sm-2" >
<label for="">Total No:</label>
<input type="text" name="totalqty" class="form-control" required="required">
</div>
</div>
</div>
<br>
<input type="submit" class="btn btn-primary" style="margin-left:280px;" value="Add More">
<a href="TestCertificateView.jsp"><input type="button" class="btn btn-primary" style="margin-left:80px;" value="Finish"></a>
</form>
</p>
</div>
</div>
<hr>
<table class="table table-bordered">
<tr class="info">
<!-- <th>Sl No</th> -->
<th>Item Name</th>
<th>PartNo/DRG No</th>
<th>Tc No:</th>
<th>Heat:</th>
<th>Qty in No:</th>
<th>Total No:</th>
<th>Delete</th>
</tr>
<%
try{
Statement st1=con.createStatement();
/* String sql1 ="select tb.*,(select f_name from employee_table where e_id=tb.e_id)lname from melting tb "; */
String sql1 ="select * from test_items_sc where tid='"+tid+"'";
ResultSet resultSet= st1.executeQuery(sql1);
while(resultSet.next()){
/* String ab=resultSet.getString("l_id"); */
%>
<tbody>
<tr>
<td>
<%=resultSet.getString("item_des") %>
</td>
<td>
<%=resultSet.getString("part_no") %>
</td>
<td>
<%=resultSet.getString("tid") %>
</td>
<td>
<%=resultSet.getString("heat_no") %>
</td>
<td>
<%=resultSet.getString("qty_no") %>
</td>
<td>
<%=resultSet.getString("total_qty") %>
</td>
<td>
<a href="Tc_Item_Delete.jsp?Id=<%=resultSet.getString("id")%>&tid=<%=resultSet.getString("tid")%>" onclick = "if (! confirm('Are you Sure To Delete?')) { return false; }"><span class="glyphicon glyphicon-remove"></span></a>
</td>
<%
}
} catch (Exception e) {
e.printStackTrace();
}
%>
</tr>
</tbody>
</table>
<div style="margin-left:10px;">
<button onclick="goBack()" type="button" class="btn btn-primary">Back</button>
</div>
<script>
function goBack() {
window.history.back();
}
</script>
<!-- script>
// JavaScript popup window function
function basicPopup(url) {
popupWindow = window.open(url,'popUpWindow','height=300,width=700,left=50,top=50,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes')
}
</script> -->
<!-- <a href="Foundary.jsp" onclick="basicPopup(this.href);return false">Open a popup window</a>
-->
</div>
<br><br>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function goBack()
{
window.history.back();
};
</script>
</body>
</html>