<main role="main" class="main-content">
   <div class="row mt-7 mb-3">
      <div class="col-12">
         <h5 class="mb-2 page-title float-left"><i class="fe fe-bar-chart-2 text-success mb-0"></i> VISITOR LOGS</h5>
		 <button type="button" id="clearVisitor" class="btn mb-2 btn-danger btn-sm float-right" >Clear All</button>
		 </div>
		 </div>
         <div class="row mb-2">
            <div class="col-md-12">
			
                     <table class="table table-sm datatables" id="visitorTable">
                        <thead>
                           <tr class="bg-danger">
                              <th class="text-white">Date & Time</th>
                              <th class="text-white">Status</th>
                              <th class="text-white">IP Address</th>
                              <th class="text-white">Country</th>
                              <th class="text-white">Hostname</th>
                              <th class="text-white">ISP Domain</th>
                              <th class="text-white">ISP</th>
                              <th class="text-white">Type</th>
                              <th class="text-white">Browser</th>
                              <th class="text-white">Operating System</th>
                           </tr>
                        </thead>
                        <tbody>
                           <?php 
						$visitlogs = getActivityVisitor();
						if(array_filter($visitlogs)){
							foreach($visitlogs as $logs){
								$data = explode("|", $logs);
								echo '<tr class="table-success">
                              <td>'.$data[0].'</td>
                              <td>'.$data[1].'</td>
                              <td>'.$data[2].'</td>
                              <td><img width="20px" src="https://cdn.ipregistry.co/flags/noto/'.strtolower($data[3]).'.png">&nbsp;&nbsp;'.$data[4].'</td>
                              <td>'.$data[5].'</td>
                              <td>'.$data[6].'</td>
                              <td>'.$data[7].'</td>
                              <td>'.$data[8].'</td>
                              <td>'.$data[9].'&nbsp;-&nbsp;'.$data[10].'</td>
                              <td>'.$data[11].'&nbsp;-&nbsp;'.$data[12].'</td>
                           </tr>';
                     }
                  }
                  ?>
                     </table>
                  
            
         
      </div>
   </div>
</main>