-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproses_ubah_paket.php
More file actions
25 lines (23 loc) · 895 Bytes
/
Copy pathproses_ubah_paket.php
File metadata and controls
25 lines (23 loc) · 895 Bytes
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
<?php
if($_POST){
$id=$_POST['id'];
$jenis=$_POST['jenis'];
$harga=$_POST['harga'];
if(empty($jenis)){
echo "<script>alert('jenis paket tidak boleh kosong');location.href='tambah_paket.php';</script>";
} elseif(empty($harga)){
echo "<script>alert('harga tidak boleh kosong');location.href='tambah_paket.php';</script>";
} else {
include "koneksi.php";
$update=mysqli_query($conn,"update paket set jenis='".$jenis."',
harga='".$harga."' where id = '".$id."'")
or die(mysqli_error($conn));
if($update){
echo "<script>alert('Sukses update paket');location.href='tampil_paket.php';</script>";
} else {
echo "<script>alert('Gagal update paket');location.href='ubah_paket.php?id="
.$id."';</script>";
}
}
}
?>