-
Notifications
You must be signed in to change notification settings - Fork 6
/
lowongan_index.php
107 lines (95 loc) · 4.26 KB
/
lowongan_index.php
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
ob_start();
session_start();
require_once 'dbconnect.php';
if (!isset($_SESSION['user'])) {
header("Location: login.php");
exit;
}
// select logged in users detail
$res = $conn->query("SELECT * FROM users WHERE id=" . $_SESSION['user']);
$userRow = mysqli_fetch_array($res, MYSQLI_ASSOC);
$lowongans = $conn->query("SELECT * FROM lowongan");
?>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Hello,<?php echo $userRow['email']; ?></title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css" type="text/css"/>
<link rel="stylesheet" href="assets/css/index.css" type="text/css"/>
</head>
<body>
<!-- Navigation Bar-->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?= $pathUrl ?>index.php">Sistem Informasi Alumni</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
</ul>
<ul class="nav navbar-nav navbar-right">
<?php if ($userRow['admin'] == 1): ?>
<li><a href="<?= $pathUrl ?>mahasiswa_index.php">Dashboard</a></li>
<?php endif ?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false">
<span
class="glyphicon glyphicon-user"></span> Logged
in: <?php echo $userRow['email']; ?>
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="<?= $pathUrl ?>mahasiswa_show.php?nim=<?= $userRow['nim']; ?>"><span class="glyphicon glyphicon-user"></span> Profile</a></li>
<li><a href="logout.php?logout"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<br>
<div class="container">
<div class="well">
<a href="<?= $pathUrl ?>mahasiswa_index.php" class="btn btn-sm btn-primary">Mahasiswa</a>
<a href="<?= $pathUrl ?>lowongan_index.php" class="btn btn-sm btn-primary">Lowongan</a>
<a href="<?= $pathUrl ?>alumni_index.php" class="btn btn-sm btn-primary">Alumni</a>
</div>
<h3>Data Lowongan</h3>
<a href="<?= $pathUrl ?>lowongan_create.php" class="btn btn-primary btn-sm pull-right">Tambah Lowongan</a>
<br>
<br>
<table class="table table-bordered">
<thead>
<tr>
<th>Nama</th>
<th>Deskripsi</th>
<th>Opsi</th>
</tr>
</thead>
<tbody>
<?php while ($lowongan = $lowongans->fetch_assoc()): ?>
<tr>
<td><?= $lowongan['nama']; ?></td>
<td><?= $lowongan['deskripsi']; ?></td>
<td>
<a href="<?= $pathUrl ?>lowongan_edit.php?id=<?= $lowongan['id']; ?>" class="btn btn-xs btn-info">Edit</a>
<a href="<?= $pathUrl ?>lowongan_delete.php?id=<?= $lowongan['id']; ?>" class="btn btn-xs btn-danger">Delete</a>
</td>
</tr>
<?php endwhile ?>
</tbody>
</table>
</div>
<br>
<script src="assets/js/jquery-2.2.0.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
</body>
</html>