Current File : //home/obabain/khb_obaba_in/ViewCustomer.jsp
<%--  <%@include file="master.jsp"%> 
 --%> <%@page import="java.sql.ResultSet"%>
<%@ 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">

 <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>
<body>
<script type="text/javascript">
$(document).ready(function() {
    $('#example').DataTable();
} );
</script>
<form>
<div class="row" style="width:108%;">
<div class="col-md-9"  style="background-color:#eae9e9;">
<div class="panel panel-default" >
       <div class="panel-heading main-color-bg">
        <h3 class="panel-title">Customers view</h3> 
       
       
   <div style="margin-top:-18px;" class="pull-right">
      <a class="btn btn-danger" href="customerNew.jsp">+New</a>
   </div>
        
    </div>
   </div>         
   <br>
                        

<div style="overflow-x:auto;width:100%;">


<table id="example"  class="table table-striped table-bordered">                              
           <thead>
            <tr class="success">
            <th>Edit</th>
            <th>Delete</th>
              <th class="active">Created Date</th>
                <th class="Cname">Client&nbsp;Name</th>  
                <th class="Email">Email&nbsp;Address</th>
                <th class="phone">Phone&nbsp;Number</th>
                <th class="balance">ADD&nbsp;/&nbsp;Edit&nbsp;Items</th>
              
            </tr>
       </thead>
              <tbody>
             <%
ResultSet rs=null;


	rs=st.executeQuery("select tb.*,(case when tb.client_active=1 then 'Yes' else 'No' end)active from ip_clients tb  ");

    	while(rs.next())
    	{
    		 %>
    	
<tr>

                 <td> <a href="editCustomer.jsp?Id=<%=rs.getString("client_id")%>" title="EDIT"> <span class="glyphicon glyphicon-pencil"></span></a>   </td>
                 <td>  
                     <a href="DeleteCustomer.jsp?Id=<%=rs.getString("client_id")%>" title="DELETE" onclick = "if (! confirm('Are You Sure To Delete?')) {return false;}">
                       <span class="glyphicon glyphicon-remove"></span> </a>
                 </td>
             
<td>
<%
ResultSet md=null;Statement sw=con.createStatement();
md=sw.executeQuery("select DATE_FORMAT('"+rs.getString("client_date_created")+"', '%e-%c-%Y') as dat");
while(md.next())
{%>

<%=md.getString("dat") %>

</td>
        <td> <a href="viewCustomerById.jsp?Id=<%=rs.getString("client_id")%>">  <%=rs.getString("client_name")%> </a></td>


<td><%=rs.getString("client_email") %></td>
<td><%=rs.getString("client_phone") %></td>

<td width=140px;><a href="Addcustomeritems.jsp?Id=<%=rs.getString("client_id") %>">
<button type="button" class="btn btn-success">Add&nbsp;/&nbsp;Edit&nbsp;Items</button>
 <!-- <span class="fontstyle" >Add Items</span>  -->
</a>
</td></td>




<%} }%>
</tr>


</tbody>

</table>

</div>
</div>
</div>
</div>
<%@include file="footer.jsp" %>
</form>
<script type="text/javascript">
function goBack() {
    window.history.back();
   
};
</script>
</body>
</html>