HEX
Server: Apache
System: Linux vps-1289444.devslamantis.cl 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64
User: vspt (1013)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/vspt/public_html/wp-content/plugins/winwheel4wp/templates/table.php
<?php if ( ! defined( 'ABSPATH' ) ) { exit; } ?><html>
<style>
body {
	font-family: sans-serif;
	font-size: .95em;
}
table,th,td {
	font: inherit;
	border: 1px solid darkgray;
	border-collapse: collapse;
}
th,td {
	padding: .5em;
}
th {
	font-weight: bold;
}
select {
	padding: .5em;
	width: 5em;
}
</style>
<body>
<p><a href="admin.php?page=winwheel4wp_settings">&lt;&lt; Return to WordPress Dashboard</a></p>

<?php if($_GET['action'] == 'winwheel4wp_download_log') { ?>

<?php
$http_query = $_GET;

$columns = array();
if (isset($rows[0])) $columns = array_keys($rows[0]);
?>

Show Slice number:
<select onchange="if (this.value) window.location.href=this.value;">
	<?php
		$http_query['wheel_id'] = $wheel_row->wheel_id;
		unset($http_query['slice_number']);
	?>
	<option value="admin-ajax.php?<?php echo http_build_query($http_query); ?>">ANY</option>
	<?php foreach(range(1,8) as $i) {
		$http_query['slice_number'] = $i;
	?>
	<option <?php if(isset($_GET['slice_number']) && $_GET['slice_number'] == $i) echo 'selected'?> value="admin-ajax.php?<?php echo http_build_query($http_query); ?>"><?php echo $i ?></option>
	<?php } ?>
</select>

<?php $http_query = $_GET; ?>

<?php } ?>

<p>Showing newest 200 entries. <a href="<?php echo admin_url( '?page=winwheel4wp_settings&download_log&wheel_id=' . $_GET['wheel_id'] )?>" class="button"><span class="dashicons dashicons-download"></span>Download</a> log for all entries.</p>

<table>
	<tr>
		<?php foreach($columns as $column) { ?>
		<th><?php echo $column ?></th>
		<?php } ?>
	</tr>
	<?php foreach($rows as $row) { ?>
	<tr>
		<?php foreach($row as $key => $column) {
			if (isset($_GET['column']) && ($key != $_GET['column'])) continue;
		?>
		<td><?php echo esc_html(stripslashes($column)) ?></td>
		<?php } ?>
	</tr>
	<?php } ?>
</table>

</body>
</html>