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
951bceb9
Commit
951bceb9
authored
May 16, 2017
by
DESKTOP-4R50ASQ\DELL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update menu
parent
afa14d10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
139 additions
and
0 deletions
+139
-0
update_menu.php
update_menu.php
+98
-0
update_menu_process.php
update_menu_process.php
+41
-0
No files found.
update_menu.php
0 → 100644
View file @
951bceb9
<?php
session_start
();
include_once
'functions/fungsi.php'
;
include_once
'connection/koneksi.php'
;
$id
=
$_GET
[
'id'
];
//die($id);
$id_brg
=
mysql_real_escape_string
(
$_GET
[
'id'
]);
$det
=
mysql_query
(
"select * from menu where id='
$id_brg
'"
)
or
die
(
mysql_error
());
while
(
$d
=
mysql_fetch_array
(
$det
))
{
?>
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
Restaurant
</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>
<!-- ============ Tambah Menu ============= -->
<section
id=
"tambahmenu"
class=
"description_content"
>
<div
class=
"text-content container"
>
<div
class=
"inner contact"
>
<!-- Form Area -->
<div
class=
"contact-form"
>
<form
id=
"contact-us"
method=
"post"
action=
"update_menu_process.php?id=
<?=
$d
[
'id'
]
?>
"
enctype=
"multipart/form-data"
>
<!-- Left Inputs -->
<div
class=
"container"
>
<div
class=
"row"
>
<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"
>
<!-- Name -->
<input
type=
"text"
name=
"nama"
id=
"first_name"
required=
"required"
class=
"form"
placeholder=
"Nama Menu"
value=
"
<?php
echo
$d
[
'nama'
]
?>
"
/>
<input
type=
"text"
name=
"harga"
id=
"last_name"
required=
"required"
class=
"form"
placeholder=
"Harga"
value=
"
<?php
echo
$d
[
'harga'
]
?>
"
/>
<input
name=
"deskripsi"
id=
"message"
class=
"form textarea"
placeholder=
"Deskripsi"
value=
"
<?php
echo
$d
[
'deskripsi'
]
?>
"
></input>
<input
type=
"file"
name=
"uploaded_file"
class=
"form"
value=
"
<?php
echo
$d
[
'gambar'
]
?>
"
/></input>
</div>
<div
class=
"col-xs-6 "
>
<!-- Send Button -->
<button
type=
"submit"
id=
"submit"
name=
"submit"
class=
"text-center form-btn form-btn"
>
Update
</button>
</div>
<div
class=
"col-xs-6 "
>
<a
href=
"index.php#olahmenu"
class=
"text-center form-btn btn-danger"
>
Cancel
</a>
</div>
</div>
</div>
</div>
</div>
<!-- Clear -->
<div
class=
"clear"
></div>
</form>
</div>
<!-- End Contact Form Area -->
</div>
<!-- End Inner -->
</div>
</section>
<script
type=
"text/javascript"
src=
"js/jquery-1.10.2.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/bootstrap.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/jquery-1.10.2.js"
></script>
<script
type=
"text/javascript"
src=
"js/jquery.mixitup.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/main.js"
></script>
</body>
</html>
<?php
}
?>
\ No newline at end of file
update_menu_process.php
0 → 100644
View file @
951bceb9
<?php
session_start
();
include_once
'functions/fungsi.php'
;
include_once
'connection/koneksi.php'
;
if
(
!
empty
(
$_FILES
[
'uploaded_file'
]))
{
$path
=
"foto/"
;
$path
=
$path
.
basename
(
$_FILES
[
'uploaded_file'
][
'name'
]);
if
(
move_uploaded_file
(
$_FILES
[
'uploaded_file'
][
'tmp_name'
],
$path
))
{
echo
"The file "
.
basename
(
$_FILES
[
'uploaded_file'
][
'name'
])
.
" has been uploaded"
;
}
else
{
echo
"There was an error uploading the file, please try again!"
;
}
}
$id
=
$_GET
[
'id'
];
//die($id);
$nama
=
$_POST
[
'nama'
];
$harga
=
$_POST
[
'harga'
];
$deskripsi
=
$_POST
[
'deskripsi'
];
$id_karyawan
=
get_session
(
'id'
);
$gambar
=
basename
(
$_FILES
[
'uploaded_file'
][
'name'
]);
$sql
=
"UPDATE menu SET nama='
$nama
', harga='
$harga
', deskripsi='
$deskripsi
', id_karyawan=
$id_karyawan
, gambar='
$gambar
' WHERE id=
$id
"
;
if
(
$database
->
query
(
$sql
)
===
TRUE
)
{
echo
"Record updated successfully"
;
}
else
{
echo
"Error updating record: "
.
$database
->
error
;
}
redirect
(
'index.php'
);
?>
\ 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