-
Notifications
You must be signed in to change notification settings - Fork 1
/
cook.php
120 lines (114 loc) · 5.26 KB
/
cook.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
<?php
session_start();
if(isset($_SESSION['O_UserID']) == '') {
print("<script>location.href = 'index.php';</script>");
exit();
}
?>
<!DOCTYPE HTML>
<html lang="ja">
<head>
<!-- エンコード設定 -->
<meta charset="UTF-8" />
<!-- 検索エンジンに掲載させない -->
<meta name="robots" content="noindex,nofollow" />
<!-- レスポンシブデザイン -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- ページタイトル -->
<title>メニュー - Ticper</title>
<!-- jQuery(フレームワーク)導入 -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Materialize(フレームワーク)導入 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-alpha.4/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-alpha.4/js/materialize.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Googleアナリティクス -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-113412923-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-113412923-2');
setTimeout("location.href = 'cook.php'",30000);
</script>
</head>
<body>
<ul id="o-menu" class="dropdown-content">
<li><a href="changelist.php">食券受付</a></li>
<li><a href="s-check.php">食券情報表示</a></li>
</ul>
<ul id="slide-out" class="sidenav">
<li>
<div class="user-view">
<div class="background">
<img width="100%" src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a1/Yamabuki_High_School.JPG/1200px-Yamabuki_High_School.JPG">
</div>
<a href="#!user"><img class="circle" src="img/icon.jpg"></a>
<a href="#!name" style="color: white;">
<?php
$UserID = $_SESSION['O_UserID'];
require_once('config/config.php');
$sql = mysqli_query($db_link, "SELECT UserName, OrgID FROM tp_user_org WHERE UserID = '$UserID'");
$result = mysqli_fetch_assoc($sql);
print($result['UserName']);
$OrgID = $result['OrgID'];
?>
</a>
</div>
</li>
<li><a href="#!" class="dropdown-trigger" data-target="o-menu">食券管理メニュー<i class="material-icons right">arrow_drop_down</i></a></li>
<li class="divider"></li>
<li><a href="o-changestatus.php">混雑度管理メニュー</a></li>
<li class="divider"></li>
<li><a href="cook.php">調理管理メニュー</a></li>
<li class="divider"></li>
<li><a href="logout.php">ログアウト</a></li>
</ul>
<nav class="light-blue darken-4">
<div class="container">
<div class="nav-wrapper">
<a href="home.php" class="brand-logo">Ticper</a>
<div class="right hide-on-med-and-down">
<a href="#!" onClick="var elem = document.querySelector('.sidenav');var instance = M.Sidenav.getInstance(elem);instance.open();" class="btn">メニューを開く</a>
</div>
<a href="#" data-target="slide-out" class="sidenav-trigger"><i class="material-icons">menu</i></a>
</div>
</div>
</nav>
<script>
$(".dropdown-trigger").dropdown();
$(document).ready(function(){
$('.sidenav').sidenav();
});
</script>
<div class="container">
<div class="row">
<div class="row s12">
<h3>調理依頼</h3>
<table>
<tr><th>団体名</th><th>食品名</th><th>残生産数</th><th>送信</th></tr>
<?php
$userid = $_SESSION['O_UserID'];
$sql0 = mysqli_query($db_link,"SELECT OrgID FROM tp_user_org WHERE UserID = '$userid'");
$result0 = mysqli_fetch_assoc($sql0);
$o_id = $result0['OrgID'];
$sql = mysqli_query($db_link,"SELECT FoodID,cooked,FoodName,OrgID FROM tp_food WHERE cook = 1 AND OrgID = '$o_id' ORDER BY OrgID DESC");
while($result = mysqli_fetch_assoc($sql)) {
$foodid= $result['FoodID'];
$sql2 = mysqli_query($db_link, "SELECT SUM(Sheets) AS num FROM tp_ticket WHERE FoodID = '$foodid' AND Used =1");
$cook = mysqli_fetch_assoc($sql2);
$cooking = $cook['num'] - $result['cooked'];
$orgid = $result['OrgID'];
$sql3 = mysqli_query($db_link,"SELECT OrgName FROM tp_org WHERE OrgID = '$orgid'");
$result3 = mysqli_fetch_assoc($sql3);
$cook_do = $cook['num'];
if($cooking > 0){
print('<tr><td>'.$result3['OrgName'].'</td><td>'.$result['FoodName'].'</td><td>'.$cooking.'</td><td><form action="cook_do.php" method="POST"><input type="hidden" name="FoodID" value="'.$result['FoodID'].'"><input required style="width: 100px;" placeholder="枚数を入力" type="number" name="maisu" min="1" max="'.$cooking.'"><input class="btn" type="submit" value="送信"></form></td></tr>');
}
}
?>
</div>
</div>
</div>
</body>
</html>