
<?php
	$Querytablename = $wpdb->prefix.'geek_cybersecurity_queries_emails';
?>

<div class="wrap">
	<h1 class="wp-heading-inline">All Queries Emails</h1>
	<a href="admin.php?page=cybersecure-adminsettings" class="page-title-action">View Dashboard</a>


	<table class="wp-list-table widefat fixed striped table-view-list queries" id="CyberSecurityQueryTableData">
		<thead>
			<tr>
				<th scope="col" class=""><strong>Sn.</strong></th>		
				<th scope="col" class=""><strong>Email</strong></th>
				<th scope="col" class=""><strong>Date</strong></th>	
				<th scope="col" class=""><strong>Action</strong></th>	
			</tr>
		</thead>

		<tbody>
			<?php 
				$QueriesResults = $wpdb->get_results("SELECT * FROM $Querytablename ORDER BY time DESC");
				foreach($QueriesResults as $key => $row){
					echo '<tr>
							
							<td class="">'.++$key.'</td>
							<td class="">'.$row->email.'</td>	
							<td class="date column-date" data-colname="Date">'.date('m/d/Y', $row->time).' at '.date('h:s A', $row->time).'</td>
							<td class="">
								<span class="button CyberDeleteEmailRowTrigger"  dbname="'.$Querytablename.'" dbid="'.$row->id.'"><span class="dashicons dashicons-trash"></span> Delete</span>
							</td>			

						</tr>';
				}
			?>
			
			
		</tbody>

	</table>

</div>

