Current File : //home/obabain/public_html/abc/SQProductSelection.jsp |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*" %>
<%@ include file="Connection.jsp" %>
<!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 href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/estilos.css" rel="stylesheet">
<link href="css/Mystyle.css" rel="stylesheet">
<title>Insert title here</title>
</head>
<body>
<div class="content-page"><div class="content">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="page-header-title">
<div class="clearfix"></div></div></div></div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default" >
<div class="panel-heading main-color-bg">
<h3 class="panel-title">Select Product</h3></div>
<div class="panel-body">
<form action="SalesQuotation.jsp" method="post">
<input type="submit" id="approve" class="btn btn-info pull-right" style="background:#204b58" data-toggle="modal" value="submit" >
<input type="button" value="Back" style="background:#204b58;" class="btn btn-info pull-left" onclick="goBack()"/>
<div>
<input class="form-control" type="text" placeholder="Search product..." name="filter" id="myInput" onkeyup="myFunction()"><a></a>
</div>
<table id="datatable-responsive" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
<thead>
<tr>
<th>Sl. No</th>
<th>Product Name</th>
<th>Product Description</th>
<th>HSN</th>
<th>Price</th>
<th></th>
</tr>
</thead>
<tbody>
<%
/* String sql="SELECT id, jcn_name FROM job_certification_name where del_status='1'";
*/
Statement st=con.createStatement();
String sql="select * from ip_products";
String sqno=request.getParameter("sqno");
session.setAttribute("sqno", sqno);
ResultSet rs=st.executeQuery(sql);
String js;
String jd;
String jh;
String jp;
int i=0;
%>
<%
while(rs.next())
{
int id=rs.getInt("product_id");
//out.print(id);
js=rs.getString("product_name");
jd=rs.getString("product_description");
jh=rs.getString("product_sku");
jp=rs.getString("product_price");
%>
<tr>
<td><%=id%></td>
<td><%=js%></td>
<td><%=jd%></td>
<td><%=jh%></td>
<td><%=jp%></td>
<td> <input name="qns[]" id="check" type="checkbox" value="<% out.print(rs.getString("product_id")); %>_<% out.print(rs.getString("product_name")); %>_<% out.print(rs.getString("product_description")); %>_<% out.print(rs.getString("product_sku")); %>_<% out.print(rs.getString("product_price")); %>_<% out.print(rs.getString("unit_id")); %>" placeholder="check" ></td>
</tr>
<%
i++;
}
%>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$(document).on('change', '[type=checkbox]', function (e)
{
if (this.checked)
{
$("#approve").removeAttr('disabled');
}
else
{
$("#approve").attr('disabled','disabled');
alert("your checkbox is selected to Aprrove");
}
});
//alert("your checkbox is not selected to Aprrove");
});
</script>
<script type="text/javascript">
function goBack() {
window.history.back();
};
</script>
<script>
function myFunction() {
var input, filter, table, tr, td, i;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("datatable-responsive");
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[1];
if (td) {
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
</script>
</body>
</html>