<?php 
	session_start();

?>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>The Catalog Shopper (QR)</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<script type="text/javascript" src="js/instascan.min.js"></script>
	<link rel="stylesheet" href="plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
	<link rel="stylesheet" href="plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
	<link rel="stylesheet" href="css/bootstrap.min.css">
	</head>
    <body style="background:#F5F5DC">
        <nav class="navbar" style="background:#fff">
		  <div class="container-fluid">
			<div class="navbar-header">
			  <img src="database/TCS2.png" class="navbar-brand" href="#"></img>
			  <a class="navbar-brand" href="#">THE CATALOG SHOPPER</a>
			</div>
			<ul class="nav navbar-nav">
			  <li class="active"><a href="index.php"><span class="glyphicon glyphicon-time"></span> Home</a></li>
			  <li><a href="attendance.php"><span class="glyphicon glyphicon-cog"></span> Attendance </a></li>
			</ul>
		  </div>
		</nav>
       <div class="container">
            <div class="row">
				
                <div class="col-md-12">
				<div style="border-radius: 5px;padding:10px;background:#fff;">
               <p>Attendance Summary</p>
                  <table id="example1" class="table table-bordered">
                    <thead>
                        <tr>
                            <td>EMPLOYEE ID</td>
							<td>LOGDATE</td>
                            <td>DEVICENO</td>
                            <td>DEVICENAME</td>
                            <td>STATUS</td>
							<td>LOCATION</td>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        $server = "localhost";
                        $username="motoxlicagroup_root";
                        $password="Licaland@123!";
                        $dbname="motoxlicagroup_motox";
                    
                        $conn = new mysqli($server,$username,$password,$dbname);
						$date = date('Y-m-d');
                        if($conn->connect_error){
                            die("Connection failed" .$conn->connect_error);
                        }
                           $sql ="SELECT * FROM qrattendance";
                           $query = $conn->query($sql);
                           while ($row = $query->fetch_assoc()){
                        ?>
                            <tr>
								<td><?php echo $row['EMPID'];?></td>
								<td><?php echo $row['LOGDATE'];?></td>
                                <td><?php echo $row['DEVICENO'];?></td>
                                <td><?php echo $row['DEVICENAME'];?></td>
                                <td><?php echo $row['STATUS'];?></td>
								<td><?php echo $row['LOC'];?></td>
                            </tr>
                        <?php
                        }
                        ?>
                    </tbody>
                  </table>
				  
                </div>
				
                </div>
				
            </div>
						
        </div>
	
    
		<script src="plugins/jquery/jquery.min.js"></script>
		<script src="plugins/bootstrap/js/bootstrap.min.js"></script>
		<script src="plugins/datatables/jquery.dataTables.min.js"></script>
		<script src="plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
		<script src="plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
		<script src="plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>

		<script>
		  $(function () {
			$("#example1").DataTable({
			  "responsive": true,
			  "autoWidth": false,
			  "order": [[1,"desc"]],
			});
			$('#example2').DataTable({
			  "paging": true,
			  "lengthChange": false,
			  "searching": false,
			  "ordering": true,
			  "info": true,
			  "autoWidth": false,
			  "responsive": true,
			  
			});
		  });
		</script>
		
    </body>
</html>