Commit 6edb775a by Visgha Olivia

Upload New File

parent 8e0a713d
<?php
require_once 'common/database.php';
if(!isset($_SESSION['logged_in'])){
header('location: index.php');
}
$id_paket = $_GET['id'];
$id_akun = $_GET['id_akun'];
$email = getEmail($id_akun);
$subject = "Pemesanan Paket";
$message = "Terima kasih sudah memesan tiket dari kami. Have a nice holiday!!";
$kuota = GetKuota($id_paket);
$tiket_terpakai = jumlahTiketTerpakai($id_paket);
$data = cekTiket($id_paket,$id_akun);
if(mail($email,$subject,$message)){
if($kuota == $tiket_terpakai){
echo "<script>alert('Maaf Paket Sudah Habis!');
window.location = 'detailpaket1.php?id=$id_paket'; </script>";
}
else{
if($data < 1){
$buat_tiket = CreateTiket($id_paket,$id_akun);
if($_SESSION['role'] == 2){
if($buat_tiket > 0){
echo "<script>alert('Tiket berhasil dibuat');
window.location = 'detailpaket1.php?id=$id_paket'; </script>";
}
else{
echo "<script>alert('Tiket gagal dibuat');
window.location = 'detailpaket1.php?id=$id_paket'; </script>";
}
}
}
else{
echo "<script>alert('Tiket sudah pernah dibuat');
window.location = 'detailpaket1.php?id=$id_paket'; </script>";
}
}
}
else{
echo "<script>alert('Email tidak terkirim ke email anda');
window.location = 'detailpaket1.php?id=$id_paket'</script>";
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment