-
Notifications
You must be signed in to change notification settings - Fork 1
/
paket.php
151 lines (131 loc) · 4.75 KB
/
paket.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
//cek session
session_start();
require_once 'config/config.php';
if (empty($_SESSION['loggedin'])) {
header("Location: ./");
die();
} elseif ($_SESSION['level'] === 'Kasir') {
header("Location: ./home.php");
} else {
?>
<!DOCTYPE html>
<html lang="en">
<?php include('_partials/head.php'); ?>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<?php include('_partials/navbar.php'); ?>
<?php include('_partials/sidebar.php'); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Paket
</h1>
<ol class="breadcrumb">
<li><a href="dashboard.php"><i class="fa fa-dashboard"></i> Dashboard</a></li>
<li class="active">Paket</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<?php if(isset($_SESSION['success'])): ?>
<p>
<?php
$success = $_SESSION['success'];
if ($success) {
?>
<div id="successMessage" class="alert alert-success" role="alert">
<i class="fa fa-check"></i> <?=$success;?>
</div>
<?php
}
?>
</p>
<?php
unset($_SESSION['success']);
endif;
?>
<div class="row">
<div class="col-xs-12">
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title">Data Paket
<a class="btn btn-primary" href="paket_add.php"><i class="fa fa-fw fa-plus"></i> Tambah Data Paket</a></h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover" width="100%">
<thead>
<tr>
<th>No</th>
<th>Paket</th>
<th>Harga Paket</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
//script untuk menampilkan data
$query = mysqli_query($db, "SELECT * FROM tb_paket ORDER BY paket ASC");
if (mysqli_num_rows($query) > 0) {
$no = 1;
while ($row = mysqli_fetch_array($query)) {
?>
<tr>
<td>
<?=$no;?>
</td>
<td>
<?=$row['paket'];?>
</td>
<td>
<?='Rp ' . number_format($row['biaya'], 0, ",", ".");?>
</td>
<td>
<a href="paket_edit.php?id_paket=<?=$row['id_paket'];?>" class="btn btn-success"><i class="fa fa-fw fa-edit"></i> Edit</a>
<a onclick="return confirmDialog();" href="paket_delete.php?id_paket=<?php echo $row['id_paket'] ?>" class="btn btn-danger mb-1"><i class="fa fa-fw fa-trash"></i> Delete</a>
</td>
</tr>
<?php
$no++;
}
} else {
echo '<tr>
<th colspan="6"><center><b>Tidak ada data yang tersedia.</b></center></th>
</tr>';
}
?>
</tbody>
</table>
<script>
function confirmDialog() {
return confirm("Data yang dihapus tidak akan bisa dikembalikan. Apakah Anda yakin akan menghapus data ini?");
}
</script>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php include('_partials/footer.php'); ?>
</div>
<!-- ./wrapper -->
<?php include('_partials/modal.php'); ?>
<?php include('_partials/js.php'); ?>
<?php include('_partials/ajax.php'); ?>
</body>
</html>
<?php
}
?>