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
c50146b4
Commit
c50146b4
authored
Jun 06, 2020
by
11319009_Pratiwi Sibarani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
6ebd7f11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
117 additions
and
0 deletions
+117
-0
p_tiket_user.php
transportasi/user/p_tiket_user.php
+117
-0
No files found.
transportasi/user/p_tiket_user.php
0 → 100644
View file @
c50146b4
<?php
session_start
();
include
(
'../config.php'
);
include
(
"template/header.php"
);
include
(
"../common/function.php"
);
include
(
"functions.php"
);
// include("../common/dbconfig.php");
open_page
(
"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"
];
$data
=
query
(
"SELECT pmt_tiket.id_pemesanan, destinasi.nama_destinasi, pt_trans.nama_transp, t_tiketsdia.harga, t_tiketsdia.kode_tiket, pmt_tiket.via_pembayaran, pmt_tiket.akun_id, pmt_tiket.j_pemesanan
FROM ((pt_kategori INNER JOIN pt_trans ON pt_kategori.id_kategori = pt_trans.kategori_id) INNER JOIN (destinasi INNER JOIN t_tiketsdia ON destinasi.id_destinasi = t_tiketsdia.t_destinasi) ON pt_trans.id_transp = t_tiketsdia.t_kendaraan) INNER JOIN (log_akun INNER JOIN pmt_tiket ON log_akun.id_akun = pmt_tiket.akun_id) ON t_tiketsdia.ID = pmt_tiket.tiket_id
WHERE akun_id =
$id_akun
;
"
);
if
(
isset
(
$_POST
[
"bayar"
]))
{
if
(
bayar
(
$_POST
)
>
0
)
{
echo
"
<script>
alert('Berhasil dibayar');
document.location.href = 'bayar_tiket_user.php';
</script>
"
;
}
else
{
echo
"
<script>
alert('Gagal dibayar');
document.location.href = 'p_tiket_user.php';
</script>
"
;
}
}
?>
<!-- ======= Breadcrumbs ======= -->
<section
id=
"breadcrumbs"
class=
"breadcrumbs"
>
<div
class=
"container"
>
<div
class=
"d-flex justify-content-between align-items-center"
>
<h2>
Daftar Tiket Pesan
</h2>
</div>
</div>
</section>
<!-- End Breadcrumbs -->
<!-- Start form search -->
<div
class=
"container mt-2 ml-2"
>
<form
action=
""
method=
"post"
>
<table
class=
"table table-bordered mt-3 mb-2"
>
<thead
class=
"thead-dark"
>
<tr
align=
"center"
>
<th
scope=
"col"
>
Kode Tiket
</th>
<th
scope=
"col"
>
Tujuan Destinasi
</th>
<th
scope=
"col"
>
Harga Tiket
</th>
<th
scope=
"col"
>
Jumlah Tiket
</th>
<th
scope=
"col"
>
Via Pembayaran
</th>
<th
scope=
"col"
colspan=
"2"
>
Tindakan
</th>
</tr>
</thead>
<?php
foreach
(
$data
as
$list_tiket
)
{
?>
<tr>
<td>
<input
type=
"hidden"
name=
"id_ptiket"
value=
"
<?=
$list_tiket
[
'id_pemesanan'
]
?>
"
>
<?=
$list_tiket
[
'kode_tiket'
]
?>
</td>
<td>
<?=
$list_tiket
[
'nama_destinasi'
]
?>
</td>
<td>
<?=
$list_tiket
[
'harga'
]
?>
</td>
<td>
<?=
$list_tiket
[
'j_pemesanan'
]
?>
</td>
<td>
<?=
$list_tiket
[
'via_pembayaran'
]
?>
</td>
<td>
<button
class=
"btn btn-primary mb-3"
type=
"submit"
name=
"bayar"
>
Bayar
</button>
</td>
<td>
<a
href=
"hapuspemesanan.php?id_pemesanan=
<?=
$list_tiket
[
'id_pemesanan'
];
?>
"
onclick=
"return confirm('Apakah Anda sudah yakin ?');"
class=
"btn btn-danger"
>
Batalkan
</a>
</td>
</tr>
<?php
}
?>
</table>
</form>
</div>
<!-- End form search -->
<?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