<?php include('usersession.php');?>
<!DOCTYPE html>
<html lang="en">
  <head>
	<title>ECIMS USER | USER LOGS</title>
    <?php include('includes/head.php'); ?>
    <style>
        th,td { text-align:center; }
    </style>
  </head>
  <body>
    <div class="container-scroller">
      <div class="horizontal-menu">
        <?php $activePage = basename($_SERVER['PHP_SELF'], ".php"); ?>
<nav class="navbar top-navbar col-lg-12 col-12 p-0">
  <div class="container-fluid">
	<div class="text-center navbar-brand-wrapper d-flex align-items-center justify-content-start">
	  <a class="navbar-brand brand-logo" href="index.php"><img style="width: 115px;height:auto;" src="assets/images/logo.png" alt="logo" /></a>
	  <a class="navbar-brand brand-logo-mini" href="index.php"><img style="width: 115px;height:auto;" src="assets/images/logo.png" alt="logo" /></a>
	</div>
	<div class="text-center navbar-menu-wrapper d-none d-lg-block d-flex align-items-center justify-content-center">
	  <span style="text-transform:uppercase;font-size: 30px;font-weight: bold;color: #000;">military engineer services <br> HISAR/ALWAR</span>
	</div>
	<div class="navbar-brand-wrapper d-flex align-items-center justify-content-end">
	  <a class="navbar-brand brand-logo d-none d-lg-block" href="index.php"><img style="width: 115px;height:auto;" src="assets/images/logo-right.png" alt="logo" /></a>
	  <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="horizontal-menu-toggle">
		<i class="fa fa-bars text-white"></i>
	  </button>
	</div>
  </div>
</nav>
<p class="text-center p-0 m-1 fw-bolder">Login Date : <?php echo date('d/m/Y'); ?></p>
<nav class="bottom-navbar">
  <div class="container-fluid">
	<?php include('includes/nav.php'); ?>
  </div>
</nav>
      </div>
      <div class="container-fluid page-body-wrapper">
        <div class="main-panel">
          <div class="content-wrapper">
            <div class="card grid-margin">
              <div class="card-body">
                <div class="row">
                  <div class="col-12">
                    <div class="table-responsive">
                      <table class="table table-striped table-bordered" width="100%">
                        <thead>
                          <tr>
                            <th>Sr. No.</th>
                            <th>Date/Time</th>
                          </tr>
                        </thead>
                        <tbody>
                            
                    <?php $count=0; 
                            $tcomplaints1 = $conn->query("SELECT * FROM userlogs WHERE userlogs.user='".$_SESSION['ecimsuser']."'"); 
                            if($tcomplaints1->num_rows > 0) {
                            while($fetchusers_complaint = $tcomplaints1->fetch_assoc()) { $count++;
                            ?>
                              <tr>
                                <td><?php echo $count; ?></td>
                                <td><?php echo date('d-M-Y H:i:s', strtotime($fetchusers_complaint['date'])); ?></td>
                              </tr>
                          <?php }} else {
                          echo '<tr><td colspan="2"><center>No Records Found!</center></td></tr>';
                          } ?>
                        </tbody>
                      </table>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
		  <?php include('includes/footer.php'); ?>
        </div>
      </div>
    </div>
    </div>
    <?php include('includes/foot.php'); ?>
  </body>
</html>