-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmanagement.php
More file actions
145 lines (131 loc) · 5.65 KB
/
Copy pathmanagement.php
File metadata and controls
145 lines (131 loc) · 5.65 KB
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
<?php
require_once 'vendor/autoload.php'; // Composer のオートロードファイルを読み込む
use Dotenv\Dotenv;
// .env ファイルを読み込む
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();
require_once('./database.php');
$db = new Database();
//recordsテーブルのデータを全取得&recordsテーブルのchild_idからchildrenテーブルのnameカラムの値を取得する
//出席者を取得
$records_pre = $db-> all_records_present($_GET['class']);
//recordsテーブルのデータを全取得&recordsテーブルのchild_idからchildrenテーブルのnameカラムの値を取得する
//欠席者を取得
$records_ab = $db -> all_records_absent($_GET['class']);
/* 未提出者を取得 */
$records_yet = $db -> all_records_yet($_GET['class']);
// 遅刻者を取得
$records_late = $db->all_records_late($_GET['class']);
if (!empty($_POST)) {
$db->check($_POST);
header("Location: management.php?class=" . $_GET['class']);
exit();
}
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>出欠れんらくん</title>
<link rel="stylesheet" href="css/management.css">
</head>
<body>
<div class="button">
<div class="back_button">
<div class="a_back_button">
<a href="./management_class.php" style="text-decoration:none">クラス選択に戻る</a>
</div>
</div>
<div class="login_button">
<div class="a_login_button">
<a href="#" style="text-decoration:none">保育士ログイン中</a>
</div>
</div>
</div>
<h3>園児出欠一覧</h3>
<h3>本日の日付: <tr> <td><?= date('Y/m/d'); ?></td></tr></h3>
<h3><?= $_GET['class'] ?>組</h3>
<div class="table-content">
<div class="submited">
<div class="attendance">
<table>
<tr>
<th>出席</th>
</tr>
<?php if(empty($records_pre)): ?>
<tr>
<td>データなし</td>
</tr>
<?php else: ?>
<?php foreach($records_pre as $records_pre2): ?>
<tr>
<td>
<a href="response.php?id=<?php print($records_pre2['child_id']) ?>&class=<?= $_GET['class']?>" name="sentaku"><?php print($records_pre2['child_name']) ?></a>
<form method="POST" action="" id="attendanceForm" onsubmit="disableButton()">
<input type="hidden" name="check_message" value="出席確認済みです。">
<input type="hidden" name="record_id" value="<?=$records_pre2['id']?>">
<input type="hidden" name="minder_id" value="1">
<?php if($records_pre2['check_message'] != '出席確認済みです。'): ?>
<button type="submit" id="submitButton">確認</button>
<?php else: ?>
<div>確認済み</div>
<?php endif ?>
</form>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</table>
</div>
<div class="absence">
<table>
<tr>
<th>欠席</th>
</tr>
<?php if(empty($records_ab)): ?>
<tr>
<td>データなし</td>
</tr>
<?php else: ?>
<?php foreach($records_ab as $records_ab2): ?>
<tr>
<td><a href="response.php?id=<?php print($records_ab2['child_id']) ?>&class=<?= $_GET['class']?>" name="sentaku"><?php print($records_ab2['child_name']) ?></a></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</table>
</div>
</div>
<div class="table-yet-late">
<div class="yet">
<table>
<th>未提出</th>
<?php foreach($records_yet as $records_yet2): ?>
<tr>
<td><a href="response.php?id=<?php print($records_yet2['child_id']) ?>&class=<?= $_GET['class']?>" name="sentaku"><?php print($records_yet2['child_name']) ?></a></td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div class="late">
<table>
<tr>
<th>遅刻</th>
</tr>
<?php if(empty($records_late)): ?>
<tr>
<td>データなし</td>
</tr>
<?php else: ?>
<?php foreach($records_late as $record_late): ?>
<tr>
<td><a href="response.php?id=<?php print($record_late['child_id']) ?>&class=<?= $_GET['class']?>" name="sentaku"><?php print($record_late['child_name']) ?></a></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</table>
</div>
</div>
</div>
</body>
</html>