| Server IP : 173.209.174.21 / Your IP : 216.73.216.89 Web Server : Apache/2.4.58 (Ubuntu) System : Linux wcfs-server 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 User : nodor ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/thelittlebigshow/app/admin/ |
Upload File : |
<?php
session_start();
require_once 'config/config.php';
require_once BASE_PATH . '/includes/auth_validate.php';
$db = getDbInstance();
$currentYear = date('Y');
$scoreColumns = [
'fit_finish' => "TINYINT UNSIGNED DEFAULT NULL",
'paint' => "TINYINT UNSIGNED DEFAULT NULL",
'interior' => "TINYINT UNSIGNED DEFAULT NULL",
'overall_look' => "TINYINT UNSIGNED DEFAULT NULL",
'stance' => "TINYINT UNSIGNED DEFAULT NULL",
'engine_bay' => "TINYINT UNSIGNED DEFAULT NULL",
'wheels_tires' => "TINYINT UNSIGNED DEFAULT NULL",
'cleanliness_detail' => "TINYINT UNSIGNED DEFAULT NULL",
'total_score' => "SMALLINT UNSIGNED DEFAULT NULL",
'judge_notes' => "TEXT NULL",
'created_at' => "TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP",
];
foreach ($scoreColumns as $column => $definition) {
$existingColumn = $db->rawQuery("SHOW COLUMNS FROM `vote` LIKE '" . $column . "'");
if (empty($existingColumn)) {
$db->rawQuery("ALTER TABLE `vote` ADD COLUMN `$column` $definition");
}
}
$unvotedRows = $db->rawQuery("
SELECT
vehicles.id,
vehicles.name,
vehicles.vehicle_maker,
vehicles.vehicle_model,
vehicles.vehicle_year,
vehicles.category,
vehicles.qrcode
FROM vehicles
LEFT JOIN vote ON vote.vehicle_id = vehicles.id
WHERE YEAR(vehicles.created_date) = ?
AND vehicles.status = 1
GROUP BY vehicles.id, vehicles.name, vehicles.vehicle_maker, vehicles.vehicle_model, vehicles.vehicle_year, vehicles.category, vehicles.qrcode
HAVING COUNT(vote.id) = 0
ORDER BY vehicles.category ASC, vehicles.id ASC
", [$currentYear]);
include BASE_PATH . '/includes/header.php';
?>
<div id="page-wrapper">
<div class="row">
<div class="col-lg-8">
<h1 class="page-header">Vehicles Not Scored</h1>
</div>
</div>
<?php include BASE_PATH . '/includes/flash_messages.php'; ?>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th width="7%">Vehicle ID</th>
<th width="18%">Owner</th>
<th width="25%">Vehicle</th>
<th width="18%">Category</th>
<th width="12%">Judging QR</th>
<th width="12%">Vote Link</th>
</tr>
</thead>
<tbody>
<?php if (count($unvotedRows) > 0): ?>
<?php foreach ($unvotedRows as $row): ?>
<tr>
<td><?php echo xss_clean($row['id']); ?></td>
<td><?php echo xss_clean($row['name']); ?></td>
<td><?php echo xss_clean(trim($row['vehicle_year'] . ' ' . $row['vehicle_maker'] . ' ' . $row['vehicle_model'])); ?></td>
<td><?php echo xss_clean($row['category']); ?></td>
<td>
<img src="../images/<?php echo xss_clean($row['qrcode']); ?>" width="70" alt="">
</td>
<td>
<a href="../vote.php?id=<?php echo urlencode($row['id']); ?>&override=1" class="btn btn-info" target="_blank">Open</a>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="6" align="center">All current vehicles have at least one score.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<?php include BASE_PATH . '/includes/footer.php'; ?>