-
Notifications
You must be signed in to change notification settings - Fork 1
/
acceptTimeslot.php
29 lines (24 loc) · 1009 Bytes
/
acceptTimeslot.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
<?php
include 'includes/session.php';
include 'includes/dbConnect.php';
include 'includes/library.php';
$meeting_id = mysqli_real_escape_string($connection, $_GET['meeting_id']);
$mudt_id = mysqli_real_escape_string($connection, $_GET['mudt_id']);
$query = "SELECT * FROM meeting_users WHERE meeting_id='".$meeting_id."' && user_id='".$user_id."'";
$result = mysqli_query($connection, $query);
if ($result){
$query = "SELECT * FROM mu_date_time WHERE mudt_id=$mudt_id";
$mudt = mysqli_query($connection, $query) OR DIE(mysqli_error($connection));
$mu_date_time = mysqli_fetch_array($mudt);
$date_time = $mu_date_time['date_time'];
$mu = mysqli_fetch_array($result, MYSQLI_ASSOC);
$mu_id = $mu['mu_id'];
$query = "INSERT INTO mu_date_time (mu_id, date_time) VALUES ('$mu_id', '$date_time')";
$result = mysqli_query($connection, $query);
header("Location: meeting.php?meeting_id=$meeting_id");
}
else {
header("Location: error.php?errorCode=authError");
exit;
}
?>