/
price2.php
executable file
·150 lines (133 loc) · 3.97 KB
/
price2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
header("Content-Type:text/html;charset=UTF-8");
?>
<?php
function lister($data){
$foodlist = 0;
$link = mysql_connect('localhost','Reciplan','reciplan');
if(!$link){
die("connection faild".mysql_error());
}
//print("connection suceed</br>");
/*insert data into private data*/
$db_selected = mysql_select_db('Foodstuff',$link);
if(!$db_selected){
die("select faild".mysql_error());
}
mysql_query('SET NAMES utf8',$link);
$query = sprintf("SELECT * FROM Foodstuff.Foodstuff_List WHERE Foodstuff_ID LIKE '%s%%'",$data);
//echo $query;
$result = mysql_query($query);
while( ($data = mysql_fetch_array($result)) != 0){
printf("<option value=\"%s\"> %s</option>\n",$data['Foodstuff_ID'], $data['Foodstuff_Name']);
$Foodlist = array( $data['Foodstuff_Name'], $data['Foodstuff_ID']);
}
mysql_close($link);
return $Foodlist;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-env="Content-Type" conten="text/html;charset=UTF-8">
<link rel="stylesheet"type="text/css"href="price2.css">
<title>Reciprice</title>
</head>
<body>
<!--ヘッダとサイド-->
<div class="side">
</div>
<div class="header">
<a href="/top/main.php"><img src = "/Reciprice.png"width="350.7"height="92.4"></a>
</div>
<a href="/user/user.php">
<input class="button_1"type="button"value="ユーザ管理">
</a>
<a href="/menu/menu.php">
<input class="button_2"type="button"value="献立表示">
</a>
<a href="price.php">
<input class="button_3"type="button"value="価格予測">
</a>
<a href="price.php">
<input class="button_4"type="button"value="野菜・果物類">
</a>
<a href="price2.php">
<input class="button_5"type="button"value="肉類">
</a>
<a href="price3.php">
<input class="button_6"type="button"value="魚類">
</a>
<a href="price4.php">
<input class="button_7"type="button"value="乳製品">
</a>
<a href="price5.php">
<input class="button_8"type="button"value="炭水化物">
</a>
<!--ヘッダとサイドおわり-->
<!--ページごとに週を送る→-日付を得る→日付ごとのメニューを表示→-それぞれのボタンにメニューIDを→遷移先にメニューID送る→IDをもとに材料表示-->
<div class="menu_table">
<form method="POST"action="Forecast.php">
<p>牛:
<select name="1"class="sel"required>
<option value=""></option>
<?php
lister('21');
?>
</select>
<input type="submit"value="予測を見る"class="Forecast">
</form>
</div>
<div class="menu_table2">
<form method="POST"action="Forecast.php">
<p>豚:
<select name="1"class="sel"required>
<option value=""></option>
<?php
lister('22');
?>
</select>
<input type="submit"value="予測を見る"class="Forecast">
</form>
</div>
<div class="menu_table3">
<form method="POST"action="Forecast.php">
<p>鶏:
<select name="1"class="sel"required>
<option value=""></option>
<?php
lister('23');
?>
</select>
<input type="submit"value="予測を見る"class="Forecast">
</form>
</div>
<div class="menu_table4">
<form method="POST"action="Forecast.php">
<p>卵:
<select name="1"class="sel"required>
<option value=""></option>
<?php
lister('41');
?>
</select>
<input type="submit"value="予測を見る"class="Forecast">
</form>
</div>
<div class="menu_table5">
<form method="POST"action="Forecast.php">
<p>その他:
<select name="1"class="sel"required>
<option value=""></option>
<?php
lister('39');
?>
</select>
<input type="submit"value="予測を見る"class="Forecast">
</form>
</div>
\
</body>
</html>
<?php
?>