forked from Mahmoudb7/faculty_meeting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeeting_status.php
71 lines (62 loc) · 2.26 KB
/
meeting_status.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
<?php
require_once "db.php";
require_once "functions.php";
if(session_status() === PHP_SESSION_NONE)
{
session_start();
}
foreach ($_POST as $key=>$value)
{
switch ($key)
{
case "confirm_btn":
$confirm_stmt = $conn->prepare("UPDATE p39_meeting SET status = ? WHERE meeting_id = ?");
$status = "confirmed";
$confirm_stmt->bind_param("si", $status, $_POST["meeting_id"]);
$confirm_stmt->execute();
header("location: meetings.php", true, 303);
break;
case "pending_btn":
$pending_stmt = $conn->prepare("UPDATE p39_meeting SET status = ? WHERE meeting_id = ?");
$status = "pending";
$pending_stmt->bind_param("si", $status, $_POST["meeting_id"]);
$pending_stmt->execute();
header("location: meetings.php", true, 303);
break;
case "finished_btn":
$finished_stmt = $conn->prepare("UPDATE p39_meeting SET status = ? WHERE meeting_id = ?");
$status = "finished";
$finished_stmt->bind_param("si", $status, $_POST["meeting_id"]);
$finished_stmt->execute();
header("location: meetings.php", true, 303);
break;
case "past_btn":
$finished_stmt = $conn->prepare("UPDATE p39_meeting SET is_current = ? WHERE meeting_id = ?");
$is_current = 0;
$finished_stmt->bind_param("si", $is_current, $_POST["meeting_id"]);
$finished_stmt->execute();
header("location: meetings.php", true, 303);
break;
case "past_formation_btn":
$is_current = 0;
$past_formation_stmt = $conn->prepare("UPDATE p39_formation SET is_current = ? WHERE formation_id = ?");
$past_formation_stmt->bind_param("ii", $is_current, $_POST["formation_id"]);
$past_formation_stmt->execute();
header("location: formation.php", true, 303);
break;
case "show_btn":
$is_showed = 1;
$show_meeting_stmt = $conn->prepare("UPDATE p39_meeting SET is_showed = ? WHERE meeting_id = ?");
$show_meeting_stmt->bind_param("ii", $is_showed, $_POST["meeting_id"]);
$show_meeting_stmt->execute();
header("location: meetings.php", true, 303);
break;
case "hide_btn":
$is_showed = 0;
$hide_meeting_stmt = $conn->prepare("UPDATE p39_meeting SET is_showed = ? WHERE meeting_id = ?");
$hide_meeting_stmt->bind_param("ii", $is_showed, $_POST["meeting_id"]);
$hide_meeting_stmt->execute();
header("location: meetings.php", true, 303);
break;
}
}