Files
root 9e2f858343
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 48s
Tests / PHPUnit (push) Successful in 1m22s
fix job positions
2026-09-03 13:01:36 -04:00

50 lines
2.9 KiB
PHP

<?= $this->extend('layout/management_layout') ?>
<?= $this->section('content') ?>
<div class="container-fluid mt-4">
<div class="d-flex justify-content-between align-items-center mb-3">
<h2>Job Positions</h2>
<div class="d-flex gap-2">
<a href="<?= site_url('administrator/job-postings/applications') ?>" class="btn btn-outline-secondary">Applications</a>
<a href="<?= site_url('administrator/job-postings/templates') ?>" class="btn btn-primary">New Position</a>
</div>
</div>
<?php if (session('success')): ?><div class="alert alert-success"><?= esc(session('success')) ?></div><?php endif; ?>
<?php if (session('error')): ?><div class="alert alert-danger"><?= esc(session('error')) ?></div><?php endif; ?>
<div class="table-responsive">
<table class="table table-striped table-bordered no-mgmt-sticky">
<thead><tr><th>Title</th><th>Department</th><th>Location</th><th>Type</th><th>Status</th><th>Post Date</th><th>Detail Clicks</th><th>Actions</th></tr></thead>
<tbody>
<?php foreach ($positions as $position): ?>
<?php
$status = strtolower((string) ($position['status'] ?? 'draft'));
$statusBadgeClass = match ($status) {
'open' => 'bg-success',
'filled' => 'bg-primary',
'closed' => 'bg-secondary',
default => 'bg-warning text-dark',
};
?>
<tr>
<td><?= esc($position['title']) ?></td>
<td><?= esc($position['department'] ?? '') ?></td>
<td><?= esc($position['location'] ?? '') ?></td>
<td><?= esc($position['employment_type'] ?? '') ?></td>
<td><span class="badge <?= esc($statusBadgeClass) ?>"><?= esc(ucfirst($status)) ?></span></td>
<td><?= !empty($position['posted_at']) ? esc(date('M j, Y', strtotime((string) $position['posted_at']))) : '&mdash;' ?></td>
<td><?= esc(number_format((int) ($position['details_click_count'] ?? 0))) ?></td>
<td>
<a class="btn btn-sm btn-outline-primary" href="<?= site_url('administrator/job-postings/positions/' . $position['position_id'] . '/edit') ?>">Edit</a>
<?php if ($status === 'open'): ?>
<a class="btn btn-sm btn-outline-secondary" href="<?= site_url('careers/' . $position['position_id']) ?>">Public View</a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<?= $this->endSection() ?>