Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
RestoranPondokEdo
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
Mei Romauli Sagala
RestoranPondokEdo
Commits
f4f36df1
Commit
f4f36df1
authored
May 22, 2017
by
Roy Junedi Simamora
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Penambahan fungsi memesan
parent
424a1f0d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
18 deletions
+52
-18
header.php
common/header.php
+2
-1
detail.php
detail.php
+32
-9
form_login.php
form_login.php
+7
-1
member_menu.php
member_menu.php
+4
-1
pesan_proses.php
pesan_proses.php
+7
-6
No files found.
common/header.php
View file @
f4f36df1
...
...
@@ -25,6 +25,7 @@
}
elseif
(
isset
(
$_SESSION
[
'user'
])){
echo
' <li><a href="member_menu.php" ><span class="glyphicon glyphicon-th-list"></span>List Menu</a></li>'
;
$username
=
$_SESSION
[
'username'
];
}
?>
...
...
@@ -44,7 +45,7 @@
<?php
if
(
isset
(
$_SESSION
[
'user'
])
||
isset
(
$_SESSION
[
'admin'
])){
echo
"<li><a href='form_login.php?logout'><span class='glyphicon glyphicon-log-out'></span>
Logout
</a></li>"
;
echo
"<li><a href='form_login.php?logout'><span class='glyphicon glyphicon-log-out'></span>
$username
</a></li>"
;
}
else
{
echo
'<li><a href="form_login.php"><span class="glyphicon glyphicon-log-in"></span> login</a></li>'
;
...
...
detail.php
View file @
f4f36df1
...
...
@@ -4,25 +4,48 @@ require 'koneksi.php';
?>
<br/>
<a
class=
"btn btn-primary"
href=
"member_menu.php"
><span
class=
"glyphicon glyphicon-chevron-left"
></span>
Kembali
</a>
<hr/>
<h3><span
class=
"glyphicon glyphicon-eye-open"
></span>
Menu Detail
</h3>
<div
class=
"row"
>
<?php
$id
=
$_GET
[
'id'
];
$id_user
=
$_GET
[
'id_member'
];
$query
=
mysqli_query
(
$koneksi
,
"SELECT * FROM menu WHERE id_menu = '
$id
'"
);
while
(
$q
=
mysqli_fetch_array
(
$query
)){
?>
<div
class=
"col-md-12"
>
<div
class=
"billInfo grid_11 alpha"
>
<form
method=
"post"
action=
"pesan_proses.php?id=
<?php
echo
$id
;
?>
"
id=
"comment_form"
>
<div
class=
"col-md-6"
>
<div
align=
"center"
>
<img
src=
"picture/
<?php
echo
$q
[
'gambar'
]
?>
"
class=
"img img-thumbnail"
width=
"300"
height=
"300"
>
</div>
</div>
<div
class=
"col-md-6"
>
<table
class=
"table table-hover table-condensed"
>
<tr>
<td>
Nama
</td>
<td>
<?php
echo
$q
[
'nama'
]
?>
</td>
</tr>
<tr>
<td>
Harga
</td>
<td>
Rp.
<?php
echo
number_format
(
$q
[
'harga'
])
?>
,-
</td>
</tr>
<tr>
<td>
<form
action=
"pesan_proses.php?id=
<?php
echo
$id
?>
"
method=
"post"
>
<fieldset>
<label
for=
"Jumlah"
>
Jumlah:
</label>
<input
type=
"text"
tabindex=
"1"
size=
"22"
value=
""
name=
"jumlah"
class=
"text"
/>
<input
type=
"submit"
value=
"Pesan"
/>
<label
for=
"jumlah"
>
Jumlah
</label>
<input
type=
"text"
tabindex=
"1"
size=
"22"
value=
"1"
name=
"jumlah"
>
<input
type=
"submit"
value=
"Masukkan Ke Cart"
class=
"btn btn-success"
>
</fieldset>
</form>
</td>
</tr>
</table>
<a
class=
"btn btn-primary"
href=
"member_menu.php"
><span
class=
"glyphicon glyphicon-chevron-left"
></span>
Pesan Lagi
</a>
<a
class=
"btn btn-warning"
href=
"bayar.php?id=
<?php
echo
$id
?>
"
>
Checkout
<span
class=
"glyphicon glyphicon-chevron-right"
></span></a>
</div>
</div>
<?php
}
?>
</div>
<br/>
...
...
form_login.php
View file @
f4f36df1
...
...
@@ -2,6 +2,7 @@
require_once
(
dirname
(
__FILE__
)
.
'/common/header.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/cek_login.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/fungsi/session.php'
);
if
(
isset
(
$_GET
[
'do_login'
])){
$login
=
getUser
(
$_POST
[
'username'
],
$_POST
[
'password'
]);
...
...
@@ -9,14 +10,19 @@ if(isset($_GET['do_login'])){
$_SESSION
[
'login_error'
]
=
TRUE
;
}
else
{
$_SESSION
[
'user'
]
=
TRUE
;
$row
=
mysqli_fetch_assoc
(
$resUsr
);
$row
=
mysqli_fetch_assoc
(
$login
);
$_SESSION
[
'username'
]
=
$row
[
'username'
];
$_SESSION
[
'id_member'
]
=
$row
[
'id_member'
];
$_SESSION
[
'user'
]
=
TRUE
;
header
(
"location:index.php"
);
}
$log
=
getAdmin
(
$_POST
[
'username'
],
$_POST
[
'password'
]);
if
(
$log
==
false
){
$_SESSION
[
'login_error'
]
=
TRUE
;
}
else
{
$resAdm
=
mysqli_fetch_array
(
$log
);
set_session
(
'id'
,
$resAdm
[
'id_admin'
]);
set_session
(
'nama'
,
$resAdm
[
'nama'
]);
$_SESSION
[
'admin'
]
=
TRUE
;
header
(
"location:admin_menu.php"
);
}
...
...
member_menu.php
View file @
f4f36df1
...
...
@@ -17,12 +17,15 @@ $start = ($page - 1) * $per_hal;
?>
<br/>
<?php
if
(
isset
(
$_SESSION
[
'username'
])){
$id_member
=
$_SESSION
[
'id_member'
];
}
$menu
=
mysqli_query
(
$GLOBALS
[
"___mysqli_ston"
],
"select * from menu limit
$start
,
$per_hal
"
);
while
(
$b
=
mysqli_fetch_array
(
$menu
))
{
?>
<div
class=
"col-md-3"
>
<a
href=
"detail.php?id=
<?php
echo
$b
[
'id_menu'
];
?>
"
class=
"btn btn-lg btn-buy"
>
<a
href=
"detail.php?id=
<?php
echo
$b
[
'id_menu'
];
?>
&id_member=
<?php
echo
$id_member
;
?>
"
class=
"btn btn-lg btn-buy"
>
<img
src=
"picture/
<?php
echo
$b
[
'gambar'
]
?>
"
class=
"img-rounded"
width=
"250"
height=
"250"
>
<div
class=
"caption"
>
<h4
style=
"color: #3c3c3c;"
>
<?php
echo
$b
[
'nama'
];
?>
</h4>
...
...
pesan_proses.php
View file @
f4f36df1
<?php
session_start
();
include
'koneksi.php'
;
include
'fungsi/fungsi.php'
;
include
'fungsi/session.php'
;
$id
=
$_GET
[
'id'
];
$id_member
=
get_session
(
'id'
)
;
$id_menu
=
$id
;
$member_id
=
$_SESSION
[
'id_member'
]
;
$menu_id
=
$id
;
$tanggal
=
date
(
'Y-m-d'
);
$jumlah
=
$_POST
[
'jumlah'
];
mysqli_query
(
$koneksi
,
"INSERT INTO pemesanan(member_id, menu_id, tanggal, jumlah,id_pemesanan) VALUES('
$id_member
','
$id_menu
','
$tanggal
','
$jumlah
','')"
);
mysqli_query
(
$koneksi
,
"INSERT INTO pemesanan VALUES('', '
$member_id
', '
$menu_id
', '
$tanggal
',
$jumlah
)"
);
header
(
'Location: detail.php?id='
.
$id
.
'&id_member='
.
$member_id
);
?>
\ No newline at end of file
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