Current File : //home/obabain/public_html/abc/ViewSupplier.jsp |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ include file="Connection.jsp" %>
<%@include file="master.jsp" %>
<%
Statement st=con.createStatement();
%>
<!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">
<title>Insert title here</title>
<script src='https://code.jquery.com/jquery-3.3.1.js'></script>
<script src='https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js'></script>
<script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap4.min.js" charset="utf-8"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap4.min.css">
</head>
<style>
table
{
border-collapse: ;
}
tr,td
{
border:1px solid #ccc;
text-align:center
}
#a1
{
border-left:1px solid #ccc;
height:10px
}
td
{
}
</style>
<body>
<script type="text/javascript">
$(document).ready(function() {
$('#example').DataTable();
} );
</script>
<form>
<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">Suppliers View</h3>
<!-- <a href="SupplierAp.jsp" class="btn btn-danger" style="color:white;margin-top:-22px;margin-left:110px; ">Approved List</a>
-->
</div>
<div style="margin-top:-22px;" class="pull-right">
<!-- <a href="supplierRA.jsp" class="btn btn-danger" style="color:white;margin-top:-22px; ">Suppliers Rating List</a>
-->
<a class="btn btn-danger" style="margin-top:-20px;" href="supplier.jsp">+New</a>
</div>
</div>
<!-- <div class="headerbar-item pull-right" style="margin-top:10px;"><a class="btn btn-primary" style="background:#204b58" onclick="goBack()">Back</a>
<a class="btn btn-primary" style="background:#204b58" href="supplier.jsp">New</a>
</div> -->
<div>
<table id="example" class="table table-striped table-bordered" >
<thead>
<tr>
<th>Edit/Delete</th>
<!-- <th>Delete</th> -->
<th>Date</th>
<th >Supplier Name</th>
<th style="align:center;">        Products     Price   HSN </th>
<!--th>Email Address</th-->
<th>Phone number</th>
<!-- <th>Balance</th> -->
<th>Add/Edit Items</th>
</tr>
</thead>
<tbody>
<%
ResultSet rs=null;
rs=st.executeQuery("select tb.*,(case when tb.supplier_active=1 then 'Yes' else 'No' end)active from ip_suppliers tb order by supplier_name ");
while(rs.next())
{
%>
<tr>
<td> <a href="editSupplier.jsp?Id=<%=rs.getString("supplier_id")%>" title="Edit">
<!-- <span class="fontstyle">Edit</span> -->
<span class="glyphicon glyphicon-pencil"></span></a>
<a title="Delete" href="DeleteSupplier.jsp?Id=<%=rs.getString("supplier_id")%>" onclick = "if (! confirm('Continue?')) { return false; }">
<span class="glyphicon glyphicon-remove"></span>
</a>
</td>
<td style="width:70px;">
<%
ResultSet md=null;Statement sw=con.createStatement();
md=sw.executeQuery("select DATE_FORMAT('"+rs.getString("supplier_date_created")+"','%e-%c-%Y') as dat");
while(md.next())
{%>
<%=md.getString("dat") %>
</td>
<td><%=rs.getString("supplier_name") %></td>
<td>
<table>
<%
int iz=1;
Statement st1=con.createStatement();
ResultSet rsunit=st1.executeQuery("select * from ip_supplier_product it right join ip_suppliers is1 on it.supplier_id=is1.supplier_id inner join ip_products ip on it.product=ip.product_id where it.supplier_id='"+ rs.getString("supplier_id")+"'");
while(rsunit.next())
{
%>
<tr id="a3">
<td style="color:blue;">
<div id="a2" align="center" style="width:190px;"> <%=rsunit.getString("ip.product_name")%></div>
</td>
<td style="color:;">
<div id="a2" align="center" style="width:80px;"> <%=rsunit.getString("s_product_rate")%></div>
</td>
<td style="color:;">
<div id="a2" align="center" style="width:110px;"> <%=rsunit.getString("mode_of_transport")%></div>
</td>
</tr>
<%
iz++;
}
%>
</table>
</td>
<!--td><%=rs.getString("supplier_email") %></td-->
<td><%=rs.getString("supplier_phone") %></td>
<!-- <td></td> -->
<%-- <td>
<div class="options btn-group">
<a class="btn btn-default dropdown-toggle fontstyle" data-toggle="dropdown">
<li class="glyphicon glyphicon-cog"><span class="fontstyle">Options</span></li>
</a>
<ul class="dropdown-menu">
<li>
<a href="viewSupplierById.jsp?Id=<%=rs.getString("supplier_id")%>">
<span class="fontstyle">View</span>
</a>
</li>
<li>
<a href="viewSupplierById.jsp?Id=<%=rs.getString("supplier_id")%>">
<span class="fontstyle">Rating</span>
</a>
</li>
<li>
<a href="viewSupplierById.jsp?Id=<%=rs.getString("supplier_id")%>">
<span class="fontstyle">Approved</span>
</a>
</li>
<li>
<a href="editSupplier.jsp?Id=<%=rs.getString("supplier_id")%>">
<span class="fontstyle">Edit</span>
</a>
</li>
<li>
<a href="DeleteSupplier.jsp?Id=<%=rs.getString("supplier_id")%>" onclick = "if (! confirm('Continue?')) { return false; }">
<span class="fontstyle">Delete</span>
</a>
</li>
</ul>
</div>
</td>
--%>
<td>
<a href="SupplierAdditem.jsp?Id=<%=rs.getString("supplier_id")%>" >
<button type="button">Add/Edit Items</button></a>
</td>
</tr>
<%} }%>
</tbody>
</table>
</div>
</div>
</div>
</div>
</form>
<script type="text/javascript">
function goBack() {
window.history.back();
};
</script>
</body>
<%-- <%@include file="footer.jsp" %> --%>
</html>