Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PA1-1617-D3TI05
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fredrick Mangampu Theodorus Pardosi
PA1-1617-D3TI05
Commits
d1ea55f1
Commit
d1ea55f1
authored
May 19, 2017
by
Fredrick Mangampu Theodorus Pardosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pesan
parent
26222a88
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
316 additions
and
0 deletions
+316
-0
pesan_barang.php
pesan_barang.php
+122
-0
pesan_barang_process.php
pesan_barang_process.php
+19
-0
pesanan.php
pesanan.php
+175
-0
No files found.
pesan_barang.php
0 → 100644
View file @
d1ea55f1
<?php
session_start
();
include_once
'functions/fungsi.php'
;
include_once
'connection/koneksi.php'
;
if
(
!
isset
(
$_SESSION
[
'admin'
])){
header
(
"location: login.php"
);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
Cafe Bunga Toba
</title>
<link
rel=
"stylesheet"
href=
"css/normalize.css"
>
<link
rel=
"stylesheet"
href=
"css/main.css"
media=
"screen"
type=
"text/css"
>
<link
href=
'http://fonts.googleapis.com/css?family=Pacifico'
rel=
'stylesheet'
type=
'text/css'
>
<link
href=
'http://fonts.googleapis.com/css?family=Playball'
rel=
'stylesheet'
type=
'text/css'
>
<link
rel=
"stylesheet"
href=
"css/bootstrap.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"css/style-portfolio.css"
>
<link
rel=
"stylesheet"
href=
"css/picto-foundry-food.css"
/>
<link
rel=
"stylesheet"
href=
"css/jquery-ui.css"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<link
href=
"css/font-awesome.min.css"
rel=
"stylesheet"
>
<link
rel=
"icon"
href=
"favicon-1.ico"
type=
"image/x-icon"
>
</head>
<body>
<nav
class=
"navbar navbar-default navbar-fixed-top"
role=
"navigation"
>
<div
class=
"container"
>
<div
class=
"row"
>
<!-- Brand and toggle get grouped for better mobile display -->
<div
class=
"navbar-header"
>
<button
type=
"button"
class=
"navbar-toggle collapsed"
data-toggle=
"collapse"
data-target=
"#bs-example-navbar-collapse-1"
>
<span
class=
"sr-only"
>
Toggle navigation
</span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
<a
class=
"navbar-brand"
href=
"index.php"
>
Cafe BUNGA TOBA
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div
class=
"collapse navbar-collapse"
id=
"bs-example-navbar-collapse-1"
>
<ul
class=
"nav navbar-nav main-nav clear navbar-right "
>
<li><a
class=
"navactive color_animation"
href=
"index.php"
>
WELCOME
</a></li>
<?php
if
(
isset
(
$_SESSION
[
'isLogin'
])
&&
(
get_session
(
'role'
)
==
"member"
))
{
echo
(
'<li><a class="color_animation" href="profil.php">PROFIL</a></li>'
);
echo
(
'<li><a class="color_animation" href="index.php #menu">MENU</a></li>'
);
echo
(
'<li><a class="color_animation" href="pesanan.php">PESANAN</a></li>'
);
echo
(
'<li><a class="color_animation" href="upload_bukti.php">PEMBAYARAN</a></li>'
);
echo
(
'<li><a class="color_animation" href="logout.php">LOGOUT ('
.
get_session
(
'first_name'
)
.
')</a></li>'
);
}
if
(
isset
(
$_SESSION
[
'isLogin'
])
&&
(
get_session
(
'role'
)
==
"karyawan"
||
get_session
(
'role'
)
==
"admin"
))
{
echo
(
'<li><a class="color_animation" href="tambah_menu.php">OLAH MENU</a></li>'
);
echo
(
'<li><a class="color_animation" href="daftar_pesanan.php">DAFTAR PESANAN</a></li>'
);
echo
(
'<li><a class="color_animation" href="list_komentar.php">DAFTAR KOMENTAR</a></li>'
);
echo
(
'<li><a class="color_animation" href="logout.php">LOGOUT ('
.
get_session
(
'first_name'
)
.
')</a></li>'
);
}
if
(
!
isset
(
$_SESSION
[
'isLogin'
]))
{
echo
(
'<li><a class="color_animation" href="profil.php">PROFIL</a></li>'
);
echo
(
'<li><a class="color_animation" href="#menu">MENU</a></li>'
);
echo
(
'<li><a class="color_animation" href="login.php">LOGIN</a></li>'
);
echo
(
'<li><a class="color_animation" href="signup.php">SIGN UP</a></li>'
);
}
?>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
</div>
<!-- /.container-fluid -->
</nav>
<body>
<br><br><br><br><br>
<?php
$id_barang
=
$_GET
[
'id'
];
$query
=
"SELECT * FROM menu"
;
$result_set
=
$database
->
query
(
$query
);
$row
=
$result_set
->
fetch_assoc
();
?>
<!-- / header -->
<body>
<div
class=
"col-md-6"
>
<li
class=
"item breakfast"
>
<div
align=
"center"
><img
src=
"foto/
<?php
echo
$row
[
'gambar'
]
?>
"
class=
"img-thumbnail"
width=
"300"
height=
"200"
>
</div>
</div>
</li>
<div
class=
"col-lg-8 col-md-6 col-xs-12"
>
<div
class=
"row"
>
<div
class=
"col-lg-8 col-md-6 col-xs-6"
>
<form
method=
"post"
action=
"pesan_barang_process.php?id=
<?php
echo
$id_barang
;
?>
"
id=
"comment_form"
>
<fieldset>
<div
class=
"row"
>
<div
class=
"col-lg-8 col-md-6 col-xs-6"
>
<label
for=
"Jumlah"
><h2>
Jumlah Pemesanan:
</h2></label>
<input
type=
"text"
tabindex=
"1"
size=
"22"
value=
""
name=
"jumlah"
class=
"form"
/>
<input
type=
"submit"
value=
"Pesan"
/>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
<div
class=
"clear"
></div>
</div>
</body>
<!-- footer -->
pesan_barang_process.php
0 → 100644
View file @
d1ea55f1
<?php
session_start
();
include_once
'functions/fungsi.php'
;
include_once
'connection/koneksi.php'
;
$id_barang
=
$_GET
[
'id'
];
$id_user
=
get_session
(
'id'
);
$jumlah
=
$_POST
[
'jumlah'
];
$query
=
'INSERT INTO pesanan( `id_user`, `id_menu`, `jumlah`) VALUES(?, ?, ?)'
;
//die($id_barang . $id_user . $jumlah);
$statement
=
$database
->
prepare
(
$query
);
$statement
->
bind_param
(
'iii'
,
$id_user
,
$id_barang
,
$jumlah
);
$statement
->
execute
();
redirect
(
'index.php#pesanan'
);
?>
\ No newline at end of file
pesanan.php
0 → 100644
View file @
d1ea55f1
<?php
session_start
();
include_once
'functions/fungsi.php'
;
include_once
'connection/koneksi.php'
;
?>
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
Cafe Bunga Toba
</title>
<link
rel=
"stylesheet"
href=
"css/normalize.css"
>
<link
rel=
"stylesheet"
href=
"css/main.css"
media=
"screen"
type=
"text/css"
>
<link
href=
'http://fonts.googleapis.com/css?family=Pacifico'
rel=
'stylesheet'
type=
'text/css'
>
<link
href=
'http://fonts.googleapis.com/css?family=Playball'
rel=
'stylesheet'
type=
'text/css'
>
<link
rel=
"stylesheet"
href=
"css/bootstrap.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"css/style-portfolio.css"
>
<link
rel=
"stylesheet"
href=
"css/picto-foundry-food.css"
/>
<link
rel=
"stylesheet"
href=
"css/jquery-ui.css"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<link
href=
"css/font-awesome.min.css"
rel=
"stylesheet"
>
<link
rel=
"icon"
href=
"favicon-1.ico"
type=
"image/x-icon"
>
</head>
<body>
<nav
class=
"navbar navbar-default navbar-fixed-top"
role=
"navigation"
>
<div
class=
"container"
>
<div
class=
"row"
>
<!-- Brand and toggle get grouped for better mobile display -->
<div
class=
"navbar-header"
>
<button
type=
"button"
class=
"navbar-toggle collapsed"
data-toggle=
"collapse"
data-target=
"#bs-example-navbar-collapse-1"
>
<span
class=
"sr-only"
>
Toggle navigation
</span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
<a
class=
"navbar-brand"
href=
"index.php"
>
Cafe BUNGA TOBA
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div
class=
"collapse navbar-collapse"
id=
"bs-example-navbar-collapse-1"
>
<ul
class=
"nav navbar-nav main-nav clear navbar-right "
>
<li><a
class=
"navactive color_animation"
href=
"index.php"
>
WELCOME
</a></li>
<?php
if
(
isset
(
$_SESSION
[
'isLogin'
])
&&
(
get_session
(
'role'
)
==
"member"
))
{
echo
(
'<li><a class="color_animation" href="profil.php">PROFIL</a></li>'
);
echo
(
'<li><a class="color_animation" href="index.php #menu">MENU</a></li>'
);
echo
(
'<li><a class="color_animation" href="pesanan.php">PESANAN</a></li>'
);
echo
(
'<li><a class="color_animation" href="upload_bukti.php">PEMBAYARAN</a></li>'
);
echo
(
'<li><a class="color_animation" href="logout.php">LOGOUT ('
.
get_session
(
'first_name'
)
.
')</a></li>'
);
}
if
(
isset
(
$_SESSION
[
'isLogin'
])
&&
(
get_session
(
'role'
)
==
"karyawan"
||
get_session
(
'role'
)
==
"admin"
))
{
echo
(
'<li><a class="color_animation" href="tambah_menu.php">OLAH MENU</a></li>'
);
echo
(
'<li><a class="color_animation" href="daftar_pesanan.php">DAFTAR PESANAN</a></li>'
);
echo
(
'<li><a class="color_animation" href="list_komentar.php">DAFTAR KOMENTAR</a></li>'
);
echo
(
'<li><a class="color_animation" href="logout.php">LOGOUT ('
.
get_session
(
'first_name'
)
.
')</a></li>'
);
}
if
(
!
isset
(
$_SESSION
[
'isLogin'
]))
{
echo
(
'<li><a class="color_animation" href="profil.php">PROFIL</a></li>'
);
echo
(
'<li><a class="color_animation" href="#menu">MENU</a></li>'
);
echo
(
'<li><a class="color_animation" href="login.php">LOGIN</a></li>'
);
echo
(
'<li><a class="color_animation" href="signup.php">SIGN UP</a></li>'
);
}
?>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
</div>
<!-- /.container-fluid -->
</nav>
<!-- ============ Pesanan ============= -->
<section
id=
"pesanan"
class=
"description_content"
>
<div
class=
"text-content container"
>
<div
class=
"inner contact row"
>
<div
class=
"contact-form"
>
<a
href =
"bayar.php?id='.$row['id'] . "
><button
class=
"btn btn-success"
>
Bayar
</button></a><br><br>
<!-- Form -->
<table
class=
"table table-bordered"
>
<thead>
<tr>
<th>
Menu
</th>
<th>
Jumlah
</th>
</tr>
</thead>
<tbody>
<?php
$id
=
get_session
(
'id'
);
$query
=
"SELECT menu.nama as nama, pesanan.jumlah as jumlah FROM pesanan INNER JOIN menu ON pesanan.id_menu = menu.id "
;
$result_set
=
$database
->
query
(
$query
);
if
(
$result_set
!=
NULL
)
{
while
(
$row
=
$result_set
->
fetch_array
())
{
?>
<tr>
<td>
<?=
$row
[
'nama'
]
?>
</td>
<td>
<?=
$row
[
'jumlah'
]
?>
</td>
</tr>
<?php
}
}
else
{
echo
'ada belum memesan pesan sekarang juga<br><a href="menu.php">Pesan</a>'
;
}
?>
</tbody>
</table>
</div>
<!-- End Contact Form Area -->
</div>
<!-- End Inner -->
</div>
</section>
<br><br><br><br><br><br><br><br><br><br><br><br>
<!-- ============ Pembayaran ============= -->
<section
id=
"pembayaran"
class=
"description_content"
>
<div
class=
"text-content container"
>
<div
class=
"inner contact row"
>
<div
class=
"contact-form"
>
<!-- Form -->
<table
class=
"table table-bordered"
>
<thead>
<tr>
<th>
Total Biaya Pembayaran
</th>
<th>
Status Pembayaran
</th>
</tr>
</thead>
<tbody>
<?php
$id
=
get_session
(
'id'
);
$query
=
"SELECT * FROM pembayaran where id_user =
$id
"
;
$result_set
=
$database
->
query
(
$query
);
if
(
$result_set
!=
NULL
)
{
while
(
$row
=
$result_set
->
fetch_array
())
{
?>
<tr>
<td>
<?=
$row
[
'total'
]
?>
</td>
<?php
if
(
$row
[
'status'
]
==
NULL
)
{
echo
'<td><a href="upload_bukti.php?id='
.
$row
[
'id'
]
.
'"><button class="btn btn-success">Upload Bukti</button></td></a>'
;
}
else
{
echo
' <td>'
.
$row
[
'status'
]
.
'</td> '
;
}
?>
</tr>
<?php
}
}
else
{
echo
'ada belum memesan pesan sekarang juga<br><a href="menu.php">Pesan</a>'
;
}
?>
</tbody>
</table>
</div>
<!-- End Contact Form Area -->
</div>
<!-- End Inner -->
</div>
</section>
<br><br><br><br><br><br><br><br><br><br><br><br>
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