<?php require_once('head.php'); ?>

  <body>
  <!-- container section start -->
  <section id="container" class="">
      
	<?php require_once('header.php'); ?>	

	<?php require_once('sidebar.php'); ?>
      
      <!--main content start-->
      <section id="main-content">
          <section class="wrapper">

			  <div class="row">
                  <div class="col-lg-12">
                      <!--breadcrumbs start -->
                      <ul class="breadcrumb">
                          <li><a href="dashboard.php"><i class="icon_house_alt"></i> Home</a></li>
                          <li class="active"> Activity Log</li>
						  <li class="pull-right"> <i class="icon_calendar"></i>
							 <?php echo date('l jS F Y'); ?></li>
                      </ul>
                      <!--breadcrumbs end -->
                  </div>
              </div>		  
			  
			  <div class="row">
					<div class="col-lg-12">
					<section class="panel panel-body">
					<h3><?php echo WEB_NAME ?></h3>
					<h4>WEBSITE ACTIVITY LOGS</h4>
					<p>Find the logs of all activities on the website below</p>
					</section>
					</div>
              </div>
			  
			  <!-- Recent Transactions Starts -->
			  <div class="row">
                  <div class="col-lg-12">
                      <section class="panel">
                          <header class="panel-heading">
                              Activity Log
                          </header>
						  
						  <div class="panel-body">
						  
                          <table class="table table-striped border-top" id="sample_1">
  <thead>
    <tr>     
      <th>Date</th>
											<th>Details</th>
											<th>User ID</th>
											<th>Logged ID</th>
											<th>IP Address</th>
    </tr>
  </thead>
  <tbody>
	<?php
										dbconnect();
										$sql = "SELECT * FROM `".SITE_LOG_TABLE."` ORDER BY ID DESC";
										$stmt = $pdo->query($sql);
										while($row = $stmt->fetch(PDO::FETCH_ASSOC)){ 
									?>   
    <tr class="odd gradeX">
        <td><?php echo date('D,jS F Y', strtotime($row['log_date'])); ?></td>
											<td><?php echo $row['log_details']; ?></td>
											<td><?php echo $row['user_name']; ?></td>
											<td><?php echo $row['log_id']; ?></td>
											<td><?php echo $row['ipaddr']; ?></td>
    </tr>
    <?php } ?>
  </tbody>
</table>
						</div>
                      </section>
                  </div>
              </div>
			  <!-- Recent Transactions end -->

              

          </section>
      </section>
      <!--main content end-->
  </section>
  <!-- container section start -->

    <!-- javascripts -->
    <script src="../js/jquery.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <!-- nice scroll -->
    <script src="../js/jquery.scrollTo.min.js"></script>
    <script src="../js/jquery.nicescroll.js" type="text/javascript"></script>
    <!-- data tables js -->
    <script type="text/javascript" src="../assets/data-tables/jquery.dataTables.js"></script>
    <script type="text/javascript" src="../assets/data-tables/DT_bootstrap.js"></script>
    <!-- dynamic table cuatom script for this page only-->
    <script src="../js/dynamic-table.js"></script>
    <!--custome script for all page-->
    <script src="../js/scripts.js"></script>

  </body>
</html>