-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage_pelanggan.php
117 lines (80 loc) · 1.98 KB
/
manage_pelanggan.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
<div style='min-height:620px;'>
<?php
include "koneksi.php";
$per_page=10;
if (isset($_GET['page'])) {
$page = $_GET['page'];
}else {
$page=1;
}
// Page will start from 0 and Multiple by Per Page
$start_from = ($page-1) * $per_page;
$query_limit = "LIMIT $start_from, $per_page";
if(!isset($_GET['submit'])){
$query = "SELECT * FROM user WHERE hak_akses='user'";
$sql = mysqli_query($connect,$query);
}else{
$query = "SELECT * FROM user WHERE ". $_GET['search_select'] ." LIKE '%". $_GET['search_value'] ."%' ORDER BY tanggal_daftar DESC $query_limit";
$sql = mysqli_query($connect,$query);
}
?>
<div class="row">
<div class="col-md-12">
<style>
table {
border-collapse: collapse;
width: 100%;
}
th, td {
text-align: left;
padding: 8px;
}
tr:nth-child(even){background-color: #e6ecff}
th {
background-color: #3366ff;
color: white;
}
</style>
<table class='table table-striped' id="tblData">
<br><br><br><br><br>
<center><legend><h2>Data Pelanggan</h2></legend></center>
<br>
<div class="row space-form ">
<div class="col-sm-8 col-sm-offset-0">
</div>
<div class="col-sm-4">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-search-plus"></i></span>
<input class="form-control" id="search" type="text" placeholder="Pencarian">
</div>
</div>
</div>
<br><br>
<tr>
<th>No.</th>
<th>NIK</th>
<th>Nama Klien</th>
<th>Alamat</th>
</tr>
<?php
$no = 1;
$count = mysqli_num_rows($sql);
if($count<1){
echo "<tr><td colspan='6'><center>Data Tidak Ditemukan!</center></td></tr>";
}else{
while($data=mysqli_fetch_array($sql,MYSQLI_BOTH)){
?>
<tr>
<td><?php echo $no."."; ?></td>
<td><?php echo $data['nik'] ?></td>
<td><?php echo $data['nama_klien'] ?></td>
<td><?php echo $data['alamat']; ?></td>
</tr>
<?php
$no++;
}
}
?>
</table>
</div>
</div>