-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtickets.php
More file actions
29 lines (27 loc) · 981 Bytes
/
Copy pathtickets.php
File metadata and controls
29 lines (27 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
// ============ HelpDesk Portal · tickets ============
require __DIR__ . '/includes/functions.php';
$me = require_login();
$st = db()->prepare('SELECT * FROM tickets WHERE user_id = ? ORDER BY id DESC');
$st->execute([(int)$me['id']]);
$tickets = $st->fetchAll();
page_header('Tickets');
flash();
?>
<div class="card">
<h2>Semua Ticket Saya</h2>
<p><a class="btn" href="/create-ticket.php">+ Buat Ticket</a></p>
<?php if (!$tickets): ?>
<p class="muted">Belum ada ticket. Buat yang pertama!</p>
<?php else: ?>
<?php foreach ($tickets as $t): ?>
<div class="list-item">
<h3>#<?= (int)$t['id'] ?> — <?= e($t['subject']) ?></h3>
<span class="badge <?= e($t['status']) ?>"><?= e($t['status']) ?></span>
<span class="muted small"> · <?= e($t['created_at']) ?></span><br>
<a href="/ticket.php?id=<?= (int)$t['id'] ?>">Lihat ticket</a>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
<?php page_footer(); ?>