Mini Kabibi Habibi
<?php
@include '../database.php';
session_start();
//Checking User Logged or Not
if(!isset($_SESSION['username_ao'])){
header('location:../index.php');
}
include('header.php');
include('script.php');
include('conn.php');
?>
<section class="content">
<div class="container-fluid">
<!-- Exportable Table -->
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class = "panel panel-primary">
<div class = "panel-heading">
<h4>Service Record</h4>
</div>
</div>
<div id="print">
<div class = "scroll">
<div class="body">
<table id = "example" class = "table table-bordered" cellspacing = "0" >
<thead>
<tr>
<th style="white-space: nowrap;">Start Date</th>
<th style="white-space: nowrap;">End Date</th>
<th style="white-space: nowrap;">Designation</th>
<th style="white-space: nowrap;">Status</th>
<th style="white-space: nowrap;">Salary</th>
<th style="white-space: nowrap;">Statio</th>
<th style="white-space: nowrap;">Branch</th>
<th style="white-space: nowrap;">Leaves</th>
<th style="white-space: nowrap;">Separation Date</th>
<th style="white-space: nowrap;">Separation Cause</th>
<th style="white-space: nowrap;">Remarks</th>
</tr>
</thead>
<tbody>
<?php
include('../database.php');
$sql = "SELECT * from service_record where username = '$_SESSION[login_user]'";
$data = mysqli_query($conn,$sql);
while ($row= mysqli_fetch_array($data))
{
?>
<tr>
<td> <?php echo $row['START_SERVICE']; ?></td>
<td> <?php echo $row['END_SERVICE']; ?></td>
<td> <?php echo $row['DESIGNATION']; ?></td>
<td> <?php echo $row['STATUS']; ?></td>
<td> <?php echo $row['SALARY']; ?></td>
<td> <?php echo $row['STATION']; ?></td>
<td> <?php echo $row['BRANCH']; ?></td>
<td> <?php echo $row['LEAVES']; ?></td>
<td> <?php echo $row['separation_date']; ?></td>
<td> <?php echo $row['separation_cause']; ?></td>
<td> <?php echo $row['remarks']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<script>
function printDiv() {
//Get the HTML of div
var divElements = document.getElementById("print").innerHTML;
//Get the HTML of whole page
var oldPage = document.body.innerHTML;
//Reset the page's HTML with div's HTML only
document.body.innerHTML = "<table></table>" + divElements;
//Print Page
window.print();
//Restore orignal HTML
document.body.innerHTML = oldPage;
}
</script>
<script src="plugins/js/jquery-1.js"></script>
<script src="plugins/js/jquery.dataTables.min.js"></script>
<script>
$(document).ready(function() {
$('#example').DataTable();
} );
</script>
<?php
include("script.php");
?>