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
e3f5d90a
Commit
e3f5d90a
authored
May 14, 2017
by
Roy Junedi Simamora
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fungsi menampilkan data menu makanan
parent
b7bf92e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
138 additions
and
0 deletions
+138
-0
list_menu.php
list_menu.php
+138
-0
No files found.
list_menu.php
0 → 100644
View file @
e3f5d90a
<?php
include
'koneksi.php'
;
?>
<?php
include
'common/header.php'
;
?>
<h3><span
class=
"glyphicon glyphicon-shopping-cart"
></span>
Daftar Menu
</h3>
<button
style=
"margin-bottom:20px"
data-toggle=
"modal"
data-target=
"#myModal"
class=
"btn btn-warning col-md-2"
><span
class=
"glyphicon glyphicon-plus"
></span>
Tambah Menu
</button>
<br/>
<br/>
<?php
$per_hal
=
10
;
$jumlah_record
=
mysql_query
(
"SELECT COUNT(*) from menu"
);
$jum
=
mysql_result
(
$jumlah_record
,
0
);
$halaman
=
ceil
(
$jum
/
$per_hal
);
$page
=
(
isset
(
$_GET
[
'page'
]))
?
(
int
)
$_GET
[
'page'
]
:
1
;
$start
=
(
$page
-
1
)
*
$per_hal
;
?>
<div
class=
"col-md-12"
>
<table
class=
"col-md-2"
>
<tr>
<td>
Jumlah Record
</td>
<td>
<?php
echo
$jum
;
?>
</td>
</tr>
<tr>
<td>
Jumlah Halaman
</td>
<td>
<?php
echo
$halaman
;
?>
</td>
</tr>
</table>
</div>
<form
action=
"cari.php"
method=
"get"
>
<div
class=
"input-group col-md-5 col-md-offset-7"
>
<span
class=
"input-group-addon"
id=
"basic-addon1"
><span
class=
"glyphicon glyphicon-search"
></span></span>
<input
type=
"text"
class=
"form-control"
placeholder=
"Cari menu di sini .."
aria-describedby=
"basic-addon1"
name=
"cari"
>
</div>
</form>
<br/>
<table
class=
"table table-hover"
>
<tr>
<th
class=
"col-md-1"
>
No
</th>
<th
class=
"col-md-3"
>
Gambar
</th>
<th
class=
"col-md-2"
>
Nama Barang
</th>
<th
class=
"col-md-2"
>
Harga
</th>
<th
class=
"col-md-2"
>
Kategori
</th>
<!-- <th class="col-md-1">Sisa</th> -->
<th
class=
"col-md-3"
>
Opsi
</th>
</tr>
<?php
if
(
isset
(
$_GET
[
'cari'
]))
{
$cari
=
mysql_real_escape_string
(
$_GET
[
'cari'
]);
$menu
=
mysql_query
(
"select * from menu where nama like '
$cari
' or kategori_id like '
$cari
'"
);
}
else
{
$menu
=
mysql_query
(
"select * from menu limit
$start
,
$per_hal
"
);
}
$no
=
1
;
while
(
$b
=
mysql_fetch_array
(
$menu
))
{
?>
<tr>
<td>
<?php
echo
$no
++
?>
</td>
<td>
<img
class=
"img-responsive"
src=
"picture/
<?php
echo
$b
[
'gambar'
];
?>
"
width=
"150"
height=
"100"
>
</td>
<td>
<?php
echo
$b
[
'nama'
]
?>
</td>
<td>
Rp.
<?php
echo
number_format
(
$b
[
'harga'
])
?>
,-
</td>
<td>
<?php
if
(
$b
[
'kategori_id'
]
==
1
)
{
echo
'Makanan'
;
}
else
if
(
$b
[
'kategori_id'
]
==
2
)
{
echo
'Minuman'
;
}
?>
</td>
<td>
<a
href=
"detail.php?id=
<?php
echo
$b
[
'id_menu'
];
?>
"
class=
"btn btn-success"
><span
class=
"glyphicon glyphicon-eye-open"
>
</span></a>
<a
href=
"edit.php?id=
<?php
echo
$b
[
'id_menu'
];
?>
"
class=
"btn btn-info"
><span
class=
"glyphicon glyphicon-edit"
></span></a>
<a
onclick=
"if (confirm('Apakah anda yakin ingin menghapus data ini ??')) {
location.href = 'delete.php?id=
<?php
echo
$b
[
'id_menu'
];
?>
'
}"
class=
"btn btn-danger"
><span
class=
"glyphicon glyphicon-remove"
></span></a>
</td>
</tr>
<?php
}
?>
</table>
<ul
class=
"pagination"
>
<?php
for
(
$x
=
1
;
$x
<=
$halaman
;
$x
++
)
{
?>
<li><a
href=
"?page=
<?php
echo
$x
?>
"
>
<?php
echo
$x
?>
</a></li>
<?php
}
?>
</ul>
<!-- modal input -->
<div
id=
"myModal"
class=
"modal fade"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
>
Tambah Menu
</h4>
</div>
<div
class=
"modal-body"
>
<form
action=
"tambah_proses.php"
method=
"post"
enctype=
"multipart/form-data"
>
<div
class=
"form-group"
>
<label>
Gambar
</label>
<input
type=
"file"
name=
"gambar"
class=
"form-control"
>
</div>
<div
class=
"form-group"
>
<label>
Nama
</label>
<input
name=
"nama"
type=
"text"
class=
"form-control"
placeholder=
"Nama Menu .."
/>
</div>
<div
class=
"form-group"
>
<label>
Harga
</label>
<input
name=
"harga"
type=
"text"
class=
"form-control"
placeholder=
"Harga Jual per porsi"
/>
</div>
<div
class=
"form-groups"
>
<label>
Kategori
</label>
<input
name=
"kategori"
type=
"radio"
value=
"1"
>
Makanan
<input
name=
"kategori"
type=
"radio"
value=
"2"
>
Minuman
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Batal
</button>
<input
type=
"submit"
class=
"btn btn-primary"
value=
"Simpan"
>
</div>
</form>
</div>
</div>
</div>
<?php
include
'common/footer.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