Mini Kabibi Habibi

Current Path : C:/Users/ITO/Desktop/From USB/fts/SDO/
Upload File :
Current File : C:/Users/ITO/Desktop/From USB/fts/SDO/view_records.php

<?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>

        <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>All Personnel </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;" class="hidden">ID</th>
                                        <th style="white-space: nowrap;">EMPLOYEE NUMBER</th>
                                        <th style="white-space: nowrap;">START OF SERVICE</th>
                                        <th style="white-space: nowrap;">ENDE OF SERVICE</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;">STATION</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>
                                        <th style="white-space: nowrap;">ACTION</th>
                                       
                                    </tr>
                                </thead>
                                <tbody>
                                
                                  <?php
                                    include('../database.php');
                                     
                                  
                                   $sql = "SELECT * from service_record where  username='{$_GET['username']}'";
                                  $data = mysqli_query($conn,$sql);
                                  while ($row= mysqli_fetch_array($data)) 
                                    {
                                      ?>
                                  <tr>
                                  <td class="hidden"><?php echo $row['id']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $row['username']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $row['START_SERVICE'];?></td>
                                  <td style="white-space: nowrap;"><?php echo $row['END_SERVICE']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $row['DESIGNATION']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $row['STATUS']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $row['SALARY']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $row['STATION']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $row['BRANCH']; ?></td>
                                 
                                  <td style="white-space: nowrap;"><?php echo $row['LEAVES']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $row['separation_date']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $row['separation_cause']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $row['remarks']; ?></td>
                                   <td colspan="7" style="float: right;"> <a class="btn btn-success btn-sm" href="edit_servicerecords.php?id=<?php echo $rows['id']?>">
                                      <span class = "glyphicon glyphicon-pencil" aria-hidden = "true">Edit</span>
                                    </a> </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");
?>