-
Notifications
You must be signed in to change notification settings - Fork 6
/
alumni_index.php
121 lines (109 loc) · 4.97 KB
/
alumni_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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?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);
$mahasiswas = $conn->query("SELECT * FROM alumni");
?>
<!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 Alumni</h3>
<a href="<?= $pathUrl ?>mahasiswa_create.php" class="btn btn-primary btn-sm pull-right">Tambah Mahasiswa</a>
<br>
<br>
<table class="table table-bordered">
<thead>
<tr>
<th>NIM</th>
<th>Nama</th>
<th>Email</th>
<th>Program Studi</th>
<th>Jenjang Studi</th>
<th>Alamat Rumah</th>
<th>Agama</th>
<th>Handphone</th>
<th>Status</th>
<th>Opsi</th>
</tr>
</thead>
<tbody>
<?php while ($mahasiswa = $mahasiswas->fetch_assoc()): ?>
<tr>
<td><?= $mahasiswa['nim']; ?></td>
<td><?= $mahasiswa['username']; ?></td>
<td><?= $mahasiswa['email']; ?></td>
<td><?= $mahasiswa['program_studi']; ?></td>
<td><?= $mahasiswa['jenjang_studi']; ?></td>
<td><?= $mahasiswa['alamat_rumah']; ?></td>
<td><?= $mahasiswa['agama']; ?></td>
<td><?= $mahasiswa['handphone']; ?></td>
<td><?= $mahasiswa['status']; ?></td>
<td>
<a href="<?= $pathUrl ?>mahasiswa_edit.php?nim=<?= $mahasiswa['nim']; ?>" class="btn btn-xs btn-info">Edit</a>
<a href="<?= $pathUrl ?>mahasiswa_delete.php?nim=<?= $mahasiswa['nim']; ?>" 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>