Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PondokEdo
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
Roy Junedi Simamora
PondokEdo
Commits
2d401448
Commit
2d401448
authored
May 14, 2017
by
Roy Junedi Simamora
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fungsi mengolah data menu makanan
parent
e3f5d90a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
0 deletions
+76
-0
delete.php
delete.php
+8
-0
edit.php
edit.php
+53
-0
edit_proses.php
edit_proses.php
+15
-0
No files found.
delete.php
0 → 100644
View file @
2d401448
<?php
require
'koneksi.php'
;
$id
=
$_GET
[
'id'
];
mysql_query
(
"delete from menu where id_menu = '
$id
'"
);
header
(
'Location: list_menu.php'
);
?>
edit.php
0 → 100644
View file @
2d401448
<?php
require
'koneksi.php'
;
include
'common/header.php'
;
?>
<h3><span
class=
"glyphicon glyphicon-edit"
></span>
Edit Menu
</h3>
<a
class=
"btn"
href=
"list_menu.php"
><span
class=
"glyphicon glyphicon-chevron-left"
></span>
Kembali
</a>
<?php
$id
=
mysql_real_escape_string
(
$_GET
[
'id'
]);
$det
=
mysql_query
(
"select * from menu where id_menu ='
$id
'"
)
or
die
(
mysql_error
());
while
(
$d
=
mysql_fetch_array
(
$det
)){
?>
<form
action=
"edit_proses.php"
method=
"post"
enctype=
"multipart/form-data"
>
<table
class=
"table"
>
<tr>
<td></td>
<td><input
type=
"hidden"
name=
"id"
value=
"
<?php
echo
$d
[
'id_menu'
]
?>
"
></td>
</tr>
<tr>
<td>
Gambar
</td>
<td>
<input
type=
"file"
name=
"gambar"
class=
"form-control"
>
</td>
</tr>
<tr>
<td>
Nama
</td>
<td><input
type=
"text"
class=
"form-control"
name=
"nama"
value=
"
<?php
echo
$d
[
'nama'
]
?>
"
></td>
</tr>
<tr>
<td>
Harga
</td>
<td><input
type=
"text"
class=
"form-control"
name=
"harga"
value=
"
<?php
echo
$d
[
'harga'
]
?>
"
></td>
</tr>
<tr>
<td>
Kategori
</td>
<td>
<input
type=
"radio"
name=
"kategori"
value=
"1"
>
Makanan
<br/>
<input
type=
"radio"
name=
"kategori"
value=
"3"
>
Minuman
</td>
</tr>
<tr>
<td></td>
<td><input
type=
"submit"
class=
"btn btn-info"
value=
"Simpan"
></td>
</tr>
</table>
</form>
<?php
}
?>
<?php
include
'common/footer.php'
;
?>
\ No newline at end of file
edit_proses.php
0 → 100644
View file @
2d401448
<?php
require
'koneksi.php'
;
$id
=
$_POST
[
'id'
];
$nama
=
$_POST
[
'nama'
];
$gambar
=
$_FILES
[
'gambar'
][
'name'
];
$harga
=
$_POST
[
'harga'
];
$kategori
=
$_POST
[
'kategori'
];
move_uploaded_file
(
$_FILES
[
'gambar'
][
'tmp_name'
],
'picture/'
.
$gambar
);
mysql_query
(
"update menu set nama = '
$nama
', harga = '
$harga
', gambar = '
$gambar
', kategori_id = '
$kategori
' where id_menu='
$id
'"
);
header
(
'Location: list_menu.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