-
Notifications
You must be signed in to change notification settings - Fork 1
/
o-changestatus.php
138 lines (131 loc) · 5.46 KB
/
o-changestatus.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
<?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');
</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>
<?php
require_once('config/config.php');
$userid = $_SESSION['O_UserID'];
$sql = mysqli_query($db_link, "SELECT OrgID FROM tp_user_org WHERE UserID = '$userid'");
$result = mysqli_fetch_assoc($sql);
$orgid = $result['OrgID'];
$sql = mysqli_query($db_link, "SELECT Status FROM tp_org WHERE OrgID = '$orgid'");
$result2 = mysqli_fetch_assoc($sql);
$status = $result2['Status'];
?>
<form action="o-changestatusdo.php" method="POST">
<input type="hidden" name="orgid" value="<?php print($result['OrgID']); ?>" />
<p><b>現在のステータス</b>:
<?php
if($status == 0) {
print("空いている");
} elseif ($status == 1) {
print("少し混んでいる");
} elseif ($status == 2) {
print("結構混んでいる");
} elseif ($status == 3) {
print("超混んでいる");
}
?><br>
<div class="input-field col s12">
<select name="statuschangeto">
<option disabled>選択してください。</option>
<option value="0">空いている</option>
<option value="1">少し混んでいる</option>
<option value="2">結構混んでいる</option>
<option value="3">超混んでいる</option>
</select>
</div>
<input type="submit" value="送信" class="btn">
</form>
<script>
$(document).ready(function(){
$('select').formSelect();
});
</script>
</div>
</div>
</div>
</body>
</html>