<?php 
    include'include/session.php';
    
    $result=mysql_query("SELECT * FROM gatepass WHERE status = '1' AND end_date >= NOW() AND reported IS NULL ORDER BY applied DESC");
   
?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Approved Pass | Secretary | WAKA CMEC</title>
    <link rel="shortcut icon" href="../../../assets/img/logo.png" />
    <link rel="stylesheet" href="../../../assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,700">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Slab:300,400|Roboto:300,400,700">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Slab:300,400">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Romanesco">
    <link rel="stylesheet" href="../../../assets/fonts/font-awesome.min.css">
    <link rel="stylesheet" href="../../../assets/fonts/material-icons.css">
    <link rel="stylesheet" href="../../../assets/css/ebs-simple-login-form1.css">
    <link rel="stylesheet" href="../../../assets/css/ebs-simple-login-form2.css">
    <link rel="stylesheet" href="../../../assets/css/Data-Table.css">
    <link rel="stylesheet" href="../../../assets/css/Data-Table1.css">
    <link rel="stylesheet" href="../../../assets/css/ebs-simple-login-form.css">
    <link rel="stylesheet" href="../../../assets/css/FPE-Gentella-form-elements.css">
    <link rel="stylesheet" href="../../../assets/css/FPE-Gentella-form-elements1.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/1.10.15/css/dataTables.bootstrap.min.css">
    <link rel="stylesheet" href="../../../assets/css/MUSA_no-more-tables.css">
    <link rel="stylesheet" href="../../../assets/css/MUSA_no-more-tables1.css">
    <link rel="stylesheet" href="../../../assets/css/MUSA_panel-table.css">
    <link rel="stylesheet" href="../../../assets/css/MUSA_panel-table1.css">
    <link rel="stylesheet" href="../../../assets/css/nav.css">
    <link rel="stylesheet" href="../../../assets/css/Navbar---App-Toolbar--LG--MD---Mobile-Nav--SM--XS.css">
    <link rel="stylesheet" href="../../../assets/css/JLX-Fixed-Nav-on-Scroll.css">
    <link rel="stylesheet" href="../../../assets/css/Navbar---App-Toolbar--LG--MD---Mobile-Nav--SM--XS1.css">
    <link rel="stylesheet" href="../../../assets/css/Navbar-Fixed-Side1.css">
    <link rel="stylesheet" href="../../../assets/css/Pretty-Table.css">
    <link rel="stylesheet" href="../../../assets/css/Pretty-Table1.css">
    <link rel="stylesheet" href="../../../assets/css/Profile-Edit.css">
    <link rel="stylesheet" href="../../../assets/css/Profile-Edit1.css">
    <link rel="stylesheet" href="../../../assets/css/Responsive-Form.css">
    <link rel="stylesheet" href="../../../assets/css/Responsive-Form1.css">
    <link rel="stylesheet" href="../../../assets/css/Sidebar-Menu.css">
    <link rel="stylesheet" href="../../../assets/css/Sidebar-Menu1.css">
    <link rel="stylesheet" href="../../../assets/css/styles.css">
    <link rel="stylesheet" href="../../../assets/css/tabela-mloureiro1973.css">
    <link rel="stylesheet" href="../../../assets/css/Team-Clean.css">
    
    <script>
        function PrintElem(elem)
        {
            Popup($(elem).html());
        }

        function Popup(data) 
        {

            var mywindow = window.open('', 'printReport', 'height=500,width=700');
            mywindow.document.write('<html><head><title></title>');
            mywindow.document.write('<link rel="stylesheet" href="../../../assets/bootstrap/css/bootstrap.min.css"  media="print">');
            mywindow.document.write('<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,700"  media="print">');
            mywindow.document.write('<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Slab:300,400|Roboto:300,400,700"  media="print">');
            mywindow.document.write('<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Slab:300,400"  media="print">');
            mywindow.document.write('<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Romanesco"  media="print">');
            mywindow.document.write('<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Slab:300,400"  media="print">');
            mywindow.document.write('<link rel="stylesheet" href="../../../assets/fonts/font-awesome.min.css"  media="print">');
            mywindow.document.write('<link rel="stylesheet" href="../../../assets/css/FPE-Gentella-form-elements.css"  media="print">');
            mywindow.document.write('<link rel="stylesheet" href="../../../assets/css/FPE-Gentella-form-elements1.css"  media="print">');
            mywindow.document.write('<link rel="stylesheet" href="../../../assets/css/FPE-Gentella-form-elements1.css"  media="print">');
            
            mywindow.document.write('<link rel="stylesheet" href="../../../assets/css/Data-Table.css" media="print">');
            mywindow.document.write('<link rel="stylesheet" href="../../../assets/css/Data-Table1.css" media="print">');
            
            mywindow.document.write('</head><body >');
            mywindow.document.write(data);
            mywindow.document.write('</body></html>');

            mywindow.document.close(); // necessary for IE >= 10
            mywindow.focus(); // necessary for IE >= 10

            mywindow.print();
            mywindow.close();

            return true;
        }
    </script>
</head>

<body style="background-color:rgba(42,63,84,0);">
    <nav class="navbar navbar-default" style="background-color:rgb(52,73,94);">
        <div class="container-fluid">
            <div class="navbar-header"><a class="navbar-brand navbar-link" href="#" style="font-weight:bold;background-color:rgb(52,73,94);">Secretary | Waka CMEC Training Institute</a>
                <button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navcol-2" style="background-color:rgb(52,73,94);color:rgb(255,255,255);"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
            </div>
            <div class="collapse navbar-collapse" id="navcol-2">
                <ul class="nav navbar-nav hidden-xs hidden-sm navbar-right" id="desktop-toolbar">
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#"> <i class="fa fa-user"></i> &nbsp; <?php echo $pro;?>  <i class="fa fa-chevron-down fa-fw"></i></a>
                        <ul class="dropdown-menu" role="menu" style="background-color:rgb(249,249,249);">
                            <li role="presentation"><a href="settings.php"><i class="fa fa-user fa-fw"></i> Profile </a></li>
                            <li role="presentation"><a href="../validate/logout.php"><i class="fa fa-power-off fa-fw"></i>Logout </a></li>
                        </ul>
                    </li>
                </ul>
                <ul class="nav navbar-nav visible-xs-block visible-sm-block" id="mobile-nav">
                    
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#"> <i class="fa fa-user"></i> &nbsp; <?php echo $pro;?> </i> <i class="fa fa-chevron-down fa-fw"></i></a>
                        <ul class="dropdown-menu" role="menu" style="background-color:rgb(249,249,249);">
                            <li role="presentation"><a href="settings.php"><i class="fa fa-user fa-fw"></i> Profile </a></li>
                            <li role="presentation"><a href="../validate/logout.php"><i class="fa fa-power-off fa-fw"></i>Logout </a></li>
                        </ul>
                    </li>
                    <li role="presentation"><a>&nbsp;</a></li>
                    <li role="presentation"><a>&nbsp;</a></li>
                    
                </ul>
            </div>
        </div>
    </nav>
    <div class="top">
        <nav class="navbar navbar-default" id="navbar-main">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand hidden navbar-link" href="#" style="padding:0px;"> </a>
                    <button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navcol-1"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
                </div>
                <div class="collapse navbar-collapse" id="navcol-1">
                    <ul class="nav navbar-nav">
                        <li class="active" role="presentation">
                            <a href="index.php">
                                <i class="fa fa-table" style="margin-right:5px;"></i>
                                Dashboard
                            </a>
                        </li>
                        <li role="presentation">
                            <a href="items.php">
                                <i class="fa fa-book" style="margin-right:5px;"></i>
                                Items
                            </a>
                        </li>
                        <li role="presentation">
                            <a href="requisitions.php">
                                <i class="fa fa-book" style="margin-right:5px;"></i>
                                Requisitions
                            </a>
                        </li>
                        <li class="dropdown">
                            <a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#">
                                Gate Pass <span class="badge bg-red" id="notificationCounter" style="font-weight:normal;"></span>
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu" role="menu">
                                <li role="presentation"><a href="pass.php">Gate Pass &nbsp;<span class="badge bg-red" id="requestCounter"></span></a></li>
                                <li role="presentation"><a href="expired-pass.php">Expired Gate Pass &nbsp;<span class="badge bg-red" id="expiredCounter"></span></a></li>
                            </ul>
                        </li>   
                        <li role="presentation">
                            <a href="leave.php">
                                <i class="fa fa-shield" style="margin-right:5px;"></i>
                                Leave
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
    </div>
    <div class="row" style="width:98%;margin-right:auto;margin-left:auto;-webkit-box-shadow:0px 4px 4px 0px rgba(0,0,0,1);-moz-box-shadow:0px 4px 4px 0px rgba(0,0,0,1);box-shadow:0px 4px 4px 0px rgba(0,0,0,1);margin-bottom:5%;overflow:hidden;">
        <form method="POST">
            <div class="col-md-12" style="margin-bottom:1%;padding-top:2px;padding-bottom:2px;background-color:rgb(239,239,239);">
                <h2 style="margin-left:1%;font-size:16px;color:rgb(1,1,1);font-weight:bold;">Gate Pass Requests</h2>
            </div>
            <?php 
                if(isset($_SESSION['check_success'])=="True"){
                    echo'<div class="col-md-12 alert alert-success absolue center text-center" role="alert">
                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                <span aria-hidden="true">×</span>
                            </button>
                            <span class="text-success">Student Checked in successfully</span>
                        </div>';
                    unset($_SESSION['check_success']); 
                }
                if(empty($result)){
                    echo'<div class="col-md-12 alert alert-danger absolue center text-center" role="alert">
                            <span class="text-danger">No records found</span>
                        </div>';
                }else{
                    include 'validate/check-in-student.php';
                    
            ?>
                <div class="col-md-12" style="width:100%;">
                    <div class="table-responsive" style="margin-right:auto;margin-left:auto;">
                        <table class="table table-striped" id="myTable">
                            <thead style="background-color:rgb(42,63,84);color:rgb(254,255,255);">
                                <tr>
                                    <th style="width:7%;text-align:center;"># </th>
                                    <th>Adm</th>
                                    <th>Student</th>
                                    <th>Course</th>
                                    <th>Yr/Block</th>
                                    <th>Phone</th>
                                    <th>Start Date</th>
                                    <th>Report Date</th>
                                    <th>Reason</th>
                                    <th style="width:80px;"><i class="fa fa-cog ml-3x"></i></th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php 
                                    $i=$p=$s=$q=$r=$a=$b=$t=$x=$m=1;
                                    while($row = mysql_fetch_array($result)) { 
                                        
                                ?>
                                    <tr>
                                        <td style="text-align:center;font-size:12px;font-weight:normal;color:rgb(3,3,3);"> <?php echo $i++;?> </td>
                                        <td style="font-size:12px;font-weight:normal;color:rgb(3,3,3);"> <?php echo $row['adm'];?> </td>
                                        <td style="font-size:12px;font-weight:normal;color:rgb(3,3,3);"> <?php echo $row['student'];?> </td>
                                        <td style=font-size:12px;font-weight:normal;color:rgb(3,3,3);"> <?php echo $row['course'];?> </td>
                                        <td style="font-size:12px;font-weight:normal;color:rgb(3,3,3);"> <?php echo addOrdinallyNumberSuffix($row['yos'])." yr, Blk ".$row['sem'];?> </td>
                                        <td style="font-weight:normal;font-size:12px;color:rgb(6,6,6);"> <?php echo $row['phone'];?> </td>
                                        <td style="font-weight:normal;font-size:12px;color:rgb(6,6,6);"> <?php echo date_format(date_create($row['start_date']),"D d M, Y.").date(" g:i A", strtotime($row['start_date']));?> </td>
                                        <td style="font-size:12px;font-weight:normal;color:rgb(4,4,4);"> <?php echo date_format(date_create($row['end_date']),"D d M, Y.").date(" g:i A", strtotime($row['end_date']));?> </td>
                                        <td style="font-size:12px;font-weight:normal;color:rgb(4,4,4);"> 
                                            <a href="#myModal<?php echo $p++;?>" data-toggle="modal" title="See full request details" style="display:block;">
                                                <?php echo $row['pass'];?> 
                                            </a>
                                            <div role="dialog" tabindex="-1" class="modal fade" id="myModal<?php echo $s++;?>">
                                                <div class="modal-dialog" role="document">
                                                    <div class="modal-content">
                                                        <div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                                            <h4 class="modal-title">Gate Pass Request Details - <?php echo $row['phone'];?></h4>
                                                        </div>
                                                        <div class="modal-body">
                                                            <div class="row">
                                                                <div class="col-md-12">
                                                                    <div class="col-md-6 bg-info text-info">
                                                                        <h2 style="padding:5px;"><b>Pass Type:</b> <?php echo $row['pass'];?></h2>
                                                                    </div>
                                                                    <div class="col-md-6 bg-info text-info">    
                                                                        <h2 style="padding:5px;"><?php echo date_format(date_create($row['applied']),"D d M, Y.").date(" g:i A", strtotime($row['applied']));?></h2>
                                                                    </div>
                                                                </div>
                                                                <div class="col-md-12">
                                                                    <div class="col-md-4">
                                                                        <p style="font-weight:bold;">Student:</p>
                                                                        <p><?php echo $row['student'];?></p>
                                                                    </div>
                                                                    <div class="col-md-3">
                                                                        <p style="font-weight:bold;">Admission No:</p>
                                                                        <p><?php echo $row['adm'];?></p>
                                                                    </div>
                                                                    <div class="col-md-2">
                                                                        <p style="font-weight:bold;">Gender:</p>
                                                                        <p><?php echo $row['gender'];?></p>
                                                                    </div>
                                                                    <div class="col-md-3">
                                                                        <p style="font-weight:bold;">Home:</p>
                                                                        <p><?php echo $row['home'];?></p>
                                                                    </div>
                                                                </div>
                                                                <div class="col-md-12"><hr></div>
                                                                <div class="col-md-12">
                                                                    <div class="col-md-4">
                                                                        <p style="font-weight:bold;">Faculty:</p>
                                                                        <p><?php echo $row['faculty'];?></p>
                                                                    </div>
                                                                    <div class="col-md-4">
                                                                        <p style="font-weight:bold;">Course:</p>
                                                                        <p><?php echo $row['course'];?></p>
                                                                    </div>
                                                                    <div class="col-md-4">
                                                                        <p style="font-weight:bold;">Year / Block:</p>
                                                                        <p><?php echo addOrdinallyNumberSuffix($row['yos'])." / Block".$row['sem'];?></p>
                                                                    </div>
                                                                </div>
                                                                <div class="col-md-12"><hr></div>
                                                                <div class="col-md-12">
                                                                    <div class="col-md-4">
                                                                        <p style="font-weight:bold;">Approved</p>
                                                                        <p><?php echo date_format(date_create($row['approved']),"D d M, Y.")." <b>at</b> ".date(" g:i A", strtotime($row['approved']));?></p>
                                                                    </div>
                                                                    <div class="col-md-4">
                                                                        <p style="font-weight:bold;">Start:</p>
                                                                        <p><?php echo date_format(date_create($row['start_date']),"D d M, Y.").date(" g:i A", strtotime($row['start_date']));?></p>
                                                                    </div>
                                                                    <div class="col-md-4">
                                                                        <p style="font-weight:bold;">Report:</p>
                                                                        <p><?php echo date_format(date_create($row['end_date']),"D d M, Y.").date(" g:i A", strtotime($row['end_date']));?></p>
                                                                    </div>
                                                                </div>
                                                                <div class="col-md-12"><hr></div>
                                                                <div class="col-md-12">
                                                                    <label>Explanation</label>
                                                                    <p><?php echo $row['explanation'];?></p>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="modal-footer">
                                                            <button type="button" data-dismiss="modal" style="padding:5px 20px;color:rgb(1,1,1);">Close</button>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </td>
                                        <td style="font-size:12px;font-weight:normal;"> 
                                            <a href="#myModalX<?php echo $x++;?>" data-toggle="modal" class="text-info" role="button" title="Print Gate Pass" style="font-weight:bold;font-size:14px;margin-right:10px;">
                                                <em class="fa fa-print text-info"></em>
                                            </a>
                                            
                                            <button name="check" value="<?php echo $row['gatepassID']?>" title="Check in Student" onClick="return confirm('Sure you want to check in this student?');" style="background-color:transparent;border:none;">
                                                <i class="fa fa-check-square text-success" style="font-size:14px;"></i>
                                            </button>
                                            <div role="dialog" tabindex="-1" class="modal fade" id="myModalX<?php echo $t++;?>">
                                                <div class="modal-dialog modal-lg" role="document">
                                                    <div class="modal-content">
                                                        <div class="modal-header">
                                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                                            <button type="submit" class="print" onclick="PrintElem('#printReport')" style="padding:5px 20px;color:rgb(1,1,1);">
                                                                <i class="fa fa-print"></i> Print
                                                            </button>
                                                        </div>
                                                        <div id="printReport">
                                                            <div class="modal-body">
                                                                <div class="row">
                                                                    <div class="col-md-12 text-center" style="text-align:center;width:100%;">
                                                                        <img src="../../../assets/img/logo.png" style="width:150px;" align="center">
                                                                    </div>
                                                                    <div class="col-md-12 text-center" style="text-align:center;width:100%;color:black;font-weight:bold;">
                                                                        <h2 style="font-weight:bold;">WAKA CMEC SCHOOL OF <?php echo strtoupper($row['faculty']);?></h2>
                                                                        <h2 style="font-size:15px;font-weight:bold;">STUDENTS LEAVE OUT FORM</h2>
                                                                    </div>

                                                                    <div class="col-md-12" style="font-size:14px;color:black;font-family:'Times New Roman',Times,sans-serif;width:100%;">
                                                                        <div class="col-md-12" style="width:100%;">
                                                                            <p>
                                                                                <b>Name of the Student: &nbsp;</b>
                                                                                <?php echo $row['student'];?>
                                                                            </p>
                                                                        </div>
                                                                        <div class="col-md-12" style="width:100%;">
                                                                            <p>
                                                                                <b>Admission number: &nbsp;</b>
                                                                                <?php echo $row['adm'];?>
                                                                            </p>
                                                                        </div>
                                                                        <div class="col-md-12"style="width:100%;">
                                                                            <p>
                                                                                <b>Time out from school/hostel-> &nbsp;</b>
                                                                                <b>Start date</b> <?php echo date_format(date_create($row['start_date']),"d.m.Y");?>
                                                                                <b>Time:</b> <?php echo date(" g:i A", strtotime($row['start_date']));?>
                                                                            </p>
                                                                        </div>
                                                                        <div class="col-md-12" style="width:100%;">
                                                                            <p>
                                                                                <b>Time out from school/hostel-> &nbsp;</b>
                                                                                <b>End date</b> <?php echo date_format(date_create($row['end_date']),"d.m.Y");?>
                                                                                <b>Reporting Time:</b> <?php echo date(" g:i A", strtotime($row['end_date']));?>
                                                                            </p>
                                                                        </div>
                                                                        <div class="col-md-12" style="width:100%;">
                                                                            <p>
                                                                                <b>Reason for taking time out OR requesting for time out from school/hostel: &nbsp;</b>
                                                                                <?php echo $row['pass'];?>
                                                                            </p>
                                                                        </div>

                                                                        <div class="col-md-12" style="width:100%;"><hr style="color:black;border:1px solid black;"></div>

                                                                        <div class="col-md-12" style='font-weight:bold;width:100%;'>APPROVAL</div>

                                                                        <div class="col-md-12" style="width:100%;">
                                                                            <p>
                                                                                <b>Administrator Name: &nbsp;</b>
                                                                                <?php echo $row['staff'];?>, <b>signature</b> __________________________________
                                                                            </p>
                                                                            <p><b>Date:</b>&nbsp;<?php echo date_format(date_create($row['approved']),"d.m.Y");?> 
                                                                                <b>Time:</b>&nbsp;<?php echo date(" g:i A", strtotime($row['approved']));?>
                                                                            </p>
                                                                        </div>

                                                                        <div class="col-md-12" style="width:100%;">
                                                                            <p>
                                                                                <b>Parent's name: &nbsp;</b>______________________________ <b>signature</b> ______________________________
                                                                            </p>
                                                                            <p><b>Date:</b>&nbsp;______________________________
                                                                                <b>Time:</b>&nbsp;______________________________
                                                                            </p>
                                                                        </div>

                                                                        <div class="col-md-12" style="width:100%;">
                                                                            <br><br>
                                                                            <p style="font-weight:bold;">NOTE: Leave applications should be made on the student's portal, two weeks prior to your request time start date off for approval</p>
                                                                        </div>
                                                                        <div class="col-md-12" style="width:100%;text-align:center;margin-top:10px;font-size:12px;">
                                                                            <hr style="color:black;border:1px solid black;">
                                                                            <p>WAKA Continuing Medical Education Center (CMEC) - P.O Box 188-10100, Nyeri Kenya.</p>
                                                                            <p><b>Email:</b> <a style="text-decoration:none;">wakacmec@gmail.com</a></p>
                                                                            <p><b>Tel:</b> <a style="text-decoration:none;">0707472152</a> / <a style="text-decoration:none;">0788307979</a> / <a style="text-decoration:none;">0722963213</a></p>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="modal-footer">
                                                            <button type="button" data-dismiss="modal" style="padding:5px 20px;color:rgb(1,1,1);">Close</button>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                <?php } ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            <?php } ?>
        </form>    
    </div>
    <script src="../../../assets/js/jquery.min.js"></script>
    <script src="../../../assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/1.10.15/js/dataTables.bootstrap.min.js"></script>
    <script src="../../../assets/js/ebs-simple-login-form.js"></script>
    <script src="../../../assets/js/Profile-Edit.js"></script>
    <script src="../../../assets/js/Sidebar-Menu.js"></script>
    
    <script type="text/javascript">
        $(document).ready(function(){
            setInterval(function(){
                $("#notificationCounter").load("include/counter_3.php");
                $("#requestCounter").load("include/counter_1.php");
                $("#expiredCounter").load("include/counter_2.php");
            }, 500); /* time in milliseconds (ie 2 seconds)*/
        });
    </script>
</body>
    <script>
        $(document).ready(function(){
            $('#myTable').dataTable();
        });
    </script>
</html>