Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PSW_II_PARIWISATA_TRANSPORTASI
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Proyek_PSW_II_PARIWISATA
PSW_II_PARIWISATA_TRANSPORTASI
Commits
c6d151d9
Commit
c6d151d9
authored
Jun 06, 2020
by
11319009_Pratiwi Sibarani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
c50146b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
123 additions
and
0 deletions
+123
-0
pesan_tiket.php
transportasi/user/pesan_tiket.php
+123
-0
No files found.
transportasi/user/pesan_tiket.php
0 → 100644
View file @
c6d151d9
<?php
session_start
();
include
(
'../config.php'
);
include
(
"template/header.php"
);
include
(
"../common/function.php"
);
include
(
"functions.php"
);
// include("../common/dbconfig.php");
open_page
(
"Pesan Tiket"
);
if
(
!
isset
(
$_SESSION
[
'is_login'
]))
{
header
(
'location:../index.php'
);
}
if
(
!
isset
(
$_SESSION
[
"username"
])){
// echo "<script>alert('Login terlebih dahulu');window.location='../index.php';</script>";
// exit;
echo
"Anda harus login dulu <br><a href='../index.php'>Klik disini</a>"
;
exit
;
}
$role
=
$_SESSION
[
"role"
];
if
(
$role
!=
"user"
){
echo
"<script>alert('Anda bukan user');window.location='../index.php';</script>"
;
exit
;
}
$id_akun
=
$_SESSION
[
"id_akun"
];
$nama
=
$_SESSION
[
"nama"
];
$username
=
$_SESSION
[
"username"
];
$id
=
$_GET
[
"id"
];
// kita query
$pesan_tiket
=
query
(
"SELECT t_tiketsdia.id, t_tiketsdia.kode_tiket, destinasi.nama_destinasi,destinasi.id_destinasi, pt_trans.nama_transp, t_tiketsdia.harga, pt_kategori.nama_kategori,pt_trans.id_transp
FROM pt_kategori INNER JOIN (pt_trans INNER JOIN (destinasi INNER JOIN t_tiketsdia ON destinasi.id_destinasi = t_tiketsdia.t_destinasi) ON pt_trans.id_transp = t_tiketsdia.t_kendaraan) ON pt_kategori.id_kategori = pt_trans.kategori_id
WHERE id =
$id
"
)[
0
];
if
(
isset
(
$_POST
[
"submit"
]))
{
if
(
beli
(
$_POST
)
>
0
)
{
echo
"
<script>
alert('Berhasil dibeli');
document.location.href = 'tiket_user.php';
</script>
"
;
}
else
{
echo
"
<script>
alert('Gagal dibeli');
document.location.href = 'tiket_user.php';
</script>
"
;
}
}
?>
<!-- ======= Breadcrumbs ======= -->
<section
id=
"breadcrumbs"
class=
"breadcrumbs"
>
<div
class=
"container"
>
<div
class=
"d-flex justify-content-between align-items-center"
>
<h2>
Pesan Tiket
</h2>
</div>
</div>
</section>
<!-- End Breadcrumbs -->
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content border-success"
>
<div
class=
"modal-header border-danger"
>
<h2>
Formulir Pesan Tiket
</h2><br>
</div>
<div
class=
"modal-body"
>
<form
action=
""
method=
"post"
>
<input
type=
"hidden"
name=
"id_tiket"
value=
"
<?=
$pesan_tiket
[
'id'
]
?>
"
>
<input
type=
"hidden"
name=
"id_akun"
value=
"
<?=
$id_akun
?>
"
>
<div
class=
"form-group"
>
<label
for=
"nama_destinasi"
>
Tujuan:
</label>
<label
for=
"nama_destinasi"
>
<?=
$pesan_tiket
[
'nama_destinasi'
]
?>
</label>
<input
type=
"hidden"
name=
"id_destinasi"
value=
"
<?=
$pesan_tiket
[
'id_destinasi'
]
?>
"
>
</div>
<div
class=
"form-group"
>
<label
for=
"nama_transp"
>
Transportasi:
<?=
$pesan_tiket
[
'nama_transp'
]
?>
</label>
<input
type=
"hidden"
name=
"id_transp"
value=
"
<?=
$pesan_tiket
[
'id_transp'
]
?>
"
>
</div>
<div
class=
"form-group"
>
<label
for=
"harga"
>
Harga: Rp.
<?=
$pesan_tiket
[
'harga'
]
?>
</label>
</div>
<div
class=
"form-group"
>
<label
for=
"j_pemesanan"
>
Jumlah tiket
</label>
<input
type=
"number"
name=
"j_pemesanan"
class=
"form-control"
autofocus
>
</div>
<div
class=
"form-group"
>
<label
for=
"via_pembayaran"
>
Via Pembayaran
</label>
<select
class=
"form-control"
name=
"via_pembayaran"
>
<option
value=
"ATM"
>
ATM
</option>
<option
value=
"BANK"
>
BANK
</option>
<option
value=
"Kartu Kredit"
>
Kartu Kredit
</option>
<option
value=
"Indomaret/Alfamart"
>
Indomaret/Alfamart
</option>
</select>
</div>
<button
class=
"btn btn-primary mb-3"
type=
"submit"
name=
"submit"
>
Beli
</button>
<button
class=
"btn btn-warning mb-3"
type=
"reset"
>
Reset
</button>
</form>
</div>
</div>
</div>
<?php
include
(
"template/footer.php"
)
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment