01.
<!doctype html>
02.
<html>
03.
<head>
04.
<meta charset=
"utf-8"
>
05.
<title>searthmenu</title>
06.
<meta name=
"viewport"
content=
"width=device-width,initial-scale=1,maximum-scale=1"
>
07.
<link rel=
"stylesheet"
href=
"jquerymobile/jquery.mobile-1.4.5.min.css"
>
08.
<script src=
"jquerymobile/jquery-2.2.0.js"
></script>
09.
<script src=
"jquerymobile/jquery.mobile-1.4.5.min.js"
></script>
10.
</head>
11.
12.
<body>
13.
14.
<?php
15.
require
(
'connect/connect.php'
);
16.
17.
if
( isset(
$_POST
[
'search'
]) )
18.
{
19.
20.
$sql
=
"SELECT * FROM menu WHERE menu_name LIKE ('"
.
$_POST
[
"search"
].
"')%"
;
21.
22.
$sql
=
"SELECT * FROM menu "
;
23.
24.
$query
= mysqli_query(
$connect
,
$sql
);
25.
26.
or
die
( mysqli_error(
$conn
) .
"<br>$sql"
);
27.
28.
29.
30.
31.
32.
}
33.
34.
35.
36.
37.
?>
38.
39.
40.
41.
42.
<style type=
"text/css"
>
43.
.ui-page {
44.
background: transparent url(picture/ja.jpg);
45.
}
46.
47.
</style>
48.
<!--การสร้างฟอร์มส่วนหัวของเว็บแอพ-->
49.
<section id=
"home"
data-role=
"page"
data-title=
"Home"
>
50.
<header data-role=
"header"
><h1>Healthy Cooking Recipes</h1></header>
51.
<div
class
=
"content"
data-role=
"content"
>
52.
53.
<h2>เมนูอาหาร</h2>
54.
<form name=
"search"
class
=
"form"
method=
"POST"
action=
"<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"
>
55.
56.
<label
for
=
"search"
>ค้นหาเมนูอาหาร</label>
57.
<input type=
"search"
name=
"search"
value=
""
data-mini=
"true"
/>
58.
<ul data-role=
"listview"
data-inset=
"true"
>
59.
<?php
60.
61.
62.
while
(
$row
= mysqli_fetch_assoc(
$query
) ) { ?>
63.
64.
<li>
65.
<a href=
"editmenu.php"
>
66.
<img src=
"gluten-free.jpg"
>
67.
<h2><?php
echo
$row
[
"menu_name"
];?></h2>
68.
<p>ชือเมนูอาหาร</p></a>
69.
<a href=
"menudelete.php"
class
=
"ui-btn ui-icon-delete ui-btn-icon-notext"
></a>
70.
71.
</li>
72.
73.
74.
<?php } ?>
75.
76.
</div>
77.
78.
</section>
79.
80.
</div>
81.
<!--การสร้างฟอร์มส่วนท้ายของเว็บแอพ-->
82.
<footer data-role=
"footer"
><h1>healthycooking@2018</h1></footer>
83.
</section>
84.
</body>
85.
</html>