-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathreply_edit.php
More file actions
98 lines (85 loc) · 3.45 KB
/
Copy pathreply_edit.php
File metadata and controls
98 lines (85 loc) · 3.45 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
<?php
require_once 'vendor/autoload.php'; // Composer のオートロードファイルを読み込む
use Dotenv\Dotenv;
// .env ファイルを読み込む
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();
require_once('./database.php');
$database = new Database();
$record = $database -> find_record((int)$_GET['id']);
if(!empty($_POST)){
if(empty($_POST['reply_content'])){
exit('<p>返信内容が入力されていません</p>'.'<br>'.'<a href="./management.php">管理画面に戻る</a>');
}
// var_dump($_POST);
$database = new Database();
$records = $database->update_reply($_POST);
$redirectUrl = "./response.php?id=" . $record["child_id"]. "&class=". $record["child_class"];
header("Location: $redirectUrl");
exit;
}
// var_dump($record);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>出欠れんらくん</title>
<link rel="stylesheet" href="css/reply_edit.css">
<link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet">
</head>
<body>
<div class="all">
<h3><?= $record['child_name'] ?>さんへの返信の編集</h3>
<table>
<tr>
<th>園児名</th>
<th>日付</th>
<th>出欠</th>
<th>理由</th>
</tr>
<tr>
<th><?= $record['child_name'] ?></th>
<th><?= $record['date'] ?></th>
<th>
<?php
if ($record['status'] == 2) {
echo '<i class="fas fa-times fa-2x" style="color: #ff4d4d;"></i>';
} else {
echo '<i class="fas fa-square fa-2x" style="color: #fcff2e;"></i>';
}
?>
</th>
<th><?= $record['absence_reason'] ?></th>
</tr>
</table>
<div class="reply_all">
<form method="POST" action="">
<div class="reply_childminders">
<label class="reply_people">返信者</label>
<select name="minder">
<!-- <option value="<?= $record['minder_id'] ?>"></option> -->
<option value="1">鈴木 たけし</option>
<option value="2">田村 えりこ</option>
<option value="3">中野 ゆかり</option>
<option value="4">山田 みさき</option>
</select>
</div>
<div class="reply_content">
<input type="hidden" name="child_id" value="<?= $record['child_id']; ?>">
<input type="hidden" name="record_id" value="<?= $record['id']; ?>">
<input type="hidden" name="id" value="<?= $record['reply_id'] ?>">
<textarea name="reply_content" rows="2" cols="60" placeholder=""><?= $record['reply_content'] ?></textarea>
</div>
<div class="button_position">
<input type="submit" value="更新" class="button">
</div>
</form>
</div>
<div class="return_managrment">
<a href="./response.php?id=<?= $record['child_id']; ?>&class=<?=$record['child_class'];?>" class="link">戻る</a>
</div>
</div>
</body>
</html>