Mini Kabibi Habibi

Current Path : C:/xampp/htdocs/esuporta/fts/ADMIN/
Upload File :
Current File : C:/xampp/htdocs/esuporta/fts/ADMIN/records_docs.php

<?php 

@include '../database.php';


session_start();

//Checking User Logged or Not
if(!isset($_SESSION['username'])){ 

 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 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;">TRACKING NUMBER</th>
                                         <th style="white-space: nowrap;">TITLE</th>
                                        <th style="white-space: nowrap;">DATE RECEIVED</th>
                                        <th style="white-space: nowrap;">DATE ACCEPTED</th>
                                        <th style="white-space: nowrap;">CURRENT LOCATION</th>
                                        <th style="white-space: nowrap;">EXPIRATION DATE</th>
                                        <th style="white-space: nowrap;">DAYS REMAINING</th>
                                        <th style="white-space: nowrap;">REMARKS</th>
                                        <th style="white-space: nowrap;">STATUS</th>
                                        <th style="white-space: nowrap;">ACTION</th>
                                        
                                       
                                    </tr>
                                </thead>
                                <tbody>
                                
                                  <?php
                                    include('../database.php');
                                     
                                  
                                  $sql = "SELECT * from documents_recieved where next_location = 'RECORDS' order by date_recieved";
                                  $data = mysqli_query($conn,$sql);
                                  while ($rows= mysqli_fetch_array($data)) 
                                    {
                                      ?>
                                  <tr>
                                  <td class="hidden"><?php echo $row['id']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $rows['tracking_no']; ?></td>
                                <td >    <a href="../files/<?php echo $rows['tracking_no'] ?>/<?php echo $rows['title'] ?>" target="_blank"><?php echo $rows['title']; ?></a></td>
                                  <td style="white-space: nowrap;"><?php echo $rows['recieving_date']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $rows['date_acknowledge']; ?></td>
                                  <td style="white-space: nowrap;"><?php echo $rows['current_location']; ?></td>
                                   <td style="white-space: nowrap;"><?php echo $rows['expiration_date']; ?></td>
                                   <td style="white-space: nowrap;"><?php echo $rows['days_remaining']; ?></td>
                                   <td style="white-space: nowrap;"><?php echo $rows['remarks']; ?></td>
                                  <td id="colorcell" style="white-space: nowrap;"><?php
                                   if ($rows['days_remaining']=="3"){
                                    echo "<span style='background-color:red;' class='badge badge-danger'>SOON TO EXPIRE</span>";
                                    }elseif ($rows['days_remaining']=="2"){
                                    echo "<span style='background-color:red;' class='badge badge-danger'>SOON TO EXPIRE</span>";
                                }elseif ($rows['days_remaining']=="1"){
                                    echo "<span style='background-color:red;' class='badge badge-danger'>SOON TO EXPIRE</span>";
                                }elseif ($rows['days_remaining']=="0"){
                                    echo "<span style='background-color:red;' class='badge badge-danger'>EXPIRED</span>";
                                }elseif ($rows['days_remaining']=="" && $rows['stats'] == "RETURN"){
                                    echo "<span style='background-color:yellow;' class='badge badge-danger'>RETURN</span>";
                                }elseif ($rows['days_remaining']=="" && $rows['stats'] == "DONE"){
                                    echo "<span style='background-color:green;' class='badge badge-danger'>DONE</span>";
                                }else{
                                    echo "<span style='background-color:blue;' class='badge badge-success'>ACTIVE</span>";
                                }
                                ?>
                                    </td>
                                   <td > 
                                          
                                    <a style="padding: 10px;" class="btn btn-success btn-sm" href="done_documents.php?tracking_no=<?php echo $rows['tracking_no']?>">
                                      <span class = "glyphicon glyphicon-open-file" 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");
?>e