63 lines
3.9 KiB
PHP
63 lines
3.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 Applications</h2>
|
|
<a href="<?= site_url('administrator/job-postings/positions') ?>" class="btn btn-outline-secondary">Positions</a>
|
|
</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; ?>
|
|
<form method="get" class="row g-2 mb-4">
|
|
<div class="col-md-4">
|
|
<select name="position_id" class="form-select">
|
|
<option value="">All positions</option>
|
|
<?php foreach ($positions as $position): ?>
|
|
<option value="<?= esc($position['position_id']) ?>" <?= $selectedPosition === $position['position_id'] ? 'selected' : '' ?>><?= esc($position['title']) ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<select name="status" class="form-select">
|
|
<option value="">All statuses</option>
|
|
<?php foreach ($statuses as $status): ?>
|
|
<option value="<?= esc($status) ?>" <?= $selectedStatus === $status ? 'selected' : '' ?>><?= esc(ucfirst($status)) ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
<div class="col-auto"><button class="btn btn-outline-primary" type="submit">Filter</button></div>
|
|
</form>
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-bordered align-middle no-mgmt-sticky">
|
|
<thead><tr><th>Applicant</th><th>Position</th><th>Position ID</th><th>Email</th><th>Phone</th><th>Submitted</th><th>Status / Notes</th><th>Resume</th></tr></thead>
|
|
<tbody>
|
|
<?php foreach ($applications as $application): ?>
|
|
<tr>
|
|
<td><?= esc(trim($application['first_name'] . ' ' . $application['last_name'])) ?></td>
|
|
<td><?= esc($application['position_title'] ?? '') ?></td>
|
|
<td><?= esc(substr((string) ($application['position_id'] ?? ''), 0, 8)) ?></td>
|
|
<td><a href="mailto:<?= esc($application['email']) ?>"><?= esc($application['email']) ?></a></td>
|
|
<td><?= esc($application['phone']) ?></td>
|
|
<td><?= esc($application['submitted_at']) ?></td>
|
|
<td style="min-width: 280px;">
|
|
<form action="<?= site_url('administrator/job-postings/applications/' . $application['application_id']) ?>" method="post">
|
|
<?= csrf_field() ?>
|
|
<select name="status" class="form-select form-select-sm mb-2">
|
|
<?php foreach ($statuses as $status): ?>
|
|
<option value="<?= esc($status) ?>" <?= $application['status'] === $status ? 'selected' : '' ?>><?= esc(ucfirst($status)) ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<textarea name="admin_notes" class="form-control form-control-sm mb-2" rows="2"><?= esc($application['admin_notes'] ?? '') ?></textarea>
|
|
<button class="btn btn-sm btn-primary" type="submit">Save</button>
|
|
</form>
|
|
</td>
|
|
<td><a class="btn btn-sm btn-outline-secondary" href="<?= site_url('administrator/job-postings/applications/' . $application['application_id'] . '/resume') ?>">Download</a></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<?= $this->endSection() ?>
|