-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdetail.php
More file actions
84 lines (74 loc) · 2.95 KB
/
Copy pathdetail.php
File metadata and controls
84 lines (74 loc) · 2.95 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
session_start();
include 'koneksi.php';
if (!isset($_SESSION['email'])) {
header("Location: login.php");
exit;
}
$email_pengguna = $_SESSION['email'];
if (isset($_GET['id'])) {
$id = intval($_GET['id']);
$result = mysqli_query($conn, "SELECT * FROM jobs WHERE id = $id");
if ($row = mysqli_fetch_assoc($result)) {
// Ambil ID user dari email
$query_user = mysqli_query($conn, "SELECT id FROM users WHERE email = '$email_pengguna'");
$data_user = mysqli_fetch_assoc($query_user);
$id_user = $data_user['id'] ?? 0;
// Cek apakah sudah melamar
$check_lamaran = mysqli_query($conn, "SELECT * FROM lamaran WHERE id_user = '$id_user' AND id_lowongan = '$id'");
$sudah_melamar = mysqli_num_rows($check_lamaran) > 0;
} else {
echo "Lowongan tidak ditemukan.";
exit;
}
} else {
echo "ID pekerjaan tidak diberikan.";
exit;
}
?>
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Detail Lowongan - <?= htmlspecialchars($row['posisi']); ?></title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<nav class="navbar">
<a href="index.php">
<img class="logo" src="images/navbarLogo.png" alt="Logo Perusahaan">
</a>
<ul class="nav-links">
<li><a href="#">About</a></li>
<li><a href="index.php">Home</a></li>
<li><span style="color: white;"><?= htmlspecialchars($email_pengguna); ?></span></li>
<li><a href="logout.php" class="contact-btn">Logout</a></li>
</ul>
</nav>
</header>
<main>
<section class="job-detail">
<img src="<?= htmlspecialchars($row['logo']); ?>" alt="Logo Perusahaan" class="logo-detail">
<h1><?= htmlspecialchars($row['posisi']); ?></h1>
<h3>Perusahaan: <?= htmlspecialchars($row['username']); ?></h3>
<p><strong>Kategori:</strong> <?= htmlspecialchars($row['kategori']); ?></p>
<p><strong>Jenis Pekerjaan:</strong> <?= htmlspecialchars($row['jenis']); ?></p>
<p><strong>Gaji:</strong> Rp <?= number_format($row['gaji_min'], 0, ',', '.') ?> - Rp <?= number_format($row['gaji_max'], 0, ',', '.') ?></p>
<p><strong>Lokasi:</strong> <?= htmlspecialchars($row['lokasi'] ?? 'Tidak disebutkan'); ?></p>
<p><strong>Batas Lamaran:</strong> <?= htmlspecialchars($row['batas_lamaran']); ?></p>
<p><strong>Deskripsi Pekerjaan:</strong></p>
<p><?= nl2br(htmlspecialchars($row['deskripsi'])); ?></p>
<?php if ($sudah_melamar): ?>
<p style="color: red; font-weight: bold;">Anda sudah pernah melamar lowongan ini!</p>
<?php else: ?>
<a href="lamaran.php?id=<?= $row['id']; ?>" class="apply-btn">Lamar Pekerjaan Ini</a>
<?php endif; ?>
</section>
</main>
<footer>
<p>© 2025 Job Portal. All rights reserved.</p>
</footer>
</body>
</html>