-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathberanda.php
103 lines (97 loc) · 4.69 KB
/
beranda.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
<div class="container">
<div class="row">
<div class ="col-xs-12">
<div class="alert alert-info">
<strong>Selamat Datang di SIA BUKU TAMU DINAS KOMINFO Kisaran</strong>
</div>
</div>
</div>
<div class="row">
<!--colomn kedua-->
<div class="col-sm-9 col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Arsip Berkas Perkara</h3>
</div>
<div class="panel-body">
<table id="dtskripsi" class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>ID Tamu</th><th width="30%">Tanggal</th><th>Nama</th><th>Jabatan</th><th>Alamat</th><th>No HP</th><th>Keperluan</th>
</tr>
</thead>
<tbody>
<!--ambil data dari database, dan tampilkan kedalam tabel-->
<?php
//buat sql untuk tampilan data, gunakan kata kunci select
$sql = "SELECT * FROM buku_tamu";
$query = mysqli_query($koneksi, $sql) or die("SQL Anda Salah");
//Baca hasil query dari databse, gunakan perulangan untuk
//Menampilkan data lebh dari satu. disini akan digunakan
//while dan fungdi mysqli_fecth_array
//Membuat variabel untuk menampilkan nomor urut
$nomor = 0;
//Melakukan perulangan u/menampilkan data
while ($data = mysqli_fetch_array($query)) {
$nomor++; //Penambahan satu untuk nilai var nomor
?>
<tr>
<td><?= $nomor ?></td>
<td><?= $data['tanggal'] ?></td>
<td><?= $data['nama'] ?></td>
<td><?= $data['jabatan'] ?></td>
<td><?= $data['alamat'] ?></td>
<td><?= $data['nohp'] ?></td>
<td><?= $data['keperluan'] ?></td>
</tr>
<!--Tutup Perulangan data-->
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<!--akhir colomn kedua-->
<div class="col-sm-3 col-xs-12">
<!--Jika terjadi login error tampilkan pesan ini-->
<?php if(isset($_GET['error']) ) {?>
<div class="alert alert-danger">Maaf! Login Gagal, Coba Lagi..</div>
<?php }?>
<?php if (isset($_SESSION['username'])) { ?>
<div class="alert alert-info">
<strong>Welcome <?=$_SESSION['nama']?></strong>
</div>
<?php
} else { ?>
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">Masuk Ke Sistem</h3>
</div>
<div class="panel-body">
<form class="form-horizontal" action="proses_login.php" method="post">
<div class="form-group">
<div class="col-sm-12">
<input type="text" name="user" class="form-control input-sm"
placeholder="Username" required="" autocomplete="off"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<input type="password" name="pwd" class="form-control input-sm"
placeholder="Password" required="" autocomplete="off"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<button type="submit" name="login" value="login"
class="btn btn-success btn-block"><span class="fa fa-unlock-alt"></span>
Login Sistem
</button>
</div>
</form>
</div>
</div>
</div>
<?php } ?>
</div>
</div>