forked from COP-4710/Event_Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateEventRSO.php
More file actions
59 lines (55 loc) · 1.68 KB
/
createEventRSO.php
File metadata and controls
59 lines (55 loc) · 1.68 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
<?php
session_start();
include ("config.php");
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$userid = $_SESSION['userid'];
//$userid = 3 ;
//echo $userid ." if this prints without userif there is something wrong";
//$RSOe = $_POST['RSOe'];
//$RSOe = 3 ;
$RSO = $_SESSION['RSO'];
//$RSO = 3;
$date = $_POST['date'];
//$date =" 2019-11-15";
$description = $_POST['description'];
//$description = "owhfowhfpiwf";
$event_name = $_POST['event_name'];
//$event_name = "woihfiqwehf";
$start = $_POST['start'];
//$start = "22:30:00";
$end = $_POST['end'];
//$end = "22:30:00";
$location_name = $_POST["location_name"];
$longitude = 1;
$latitude = 1;
$sql4 = "INSERT INTO `location` (event_name, start, end, date, location_name,longitude, latitude) VALUES ('$event_name','$start','$end','$date','$location_name', '$longitude', '$latitude')";
$result4=$db->query($sql4);
$sql3 = "SELECT event_name, start, end, date, location_name FROM location WHERE event_name ='$event_name'";
$result3 = $db->query($sql3);
if($result3->num_rows == 1)
{
$sql = "INSERT INTO `RSO_events` (userid, RSO, date , description, event_name, start, end) VALUES ('$userid','$RSO','$date', '$description', '$event_name', '$start','$end' )";
if($result= $db->query($sql)=== TRUE)
{
echo "insert work successfully";
}
//$result= $db->query($sql);
$sql2 = "SELECT event_name FROM RSO_events WHERE userid ='$userid' ";
$result2= $db->query($sql2);
if($result2->num_rows > 0)
{
echo "you add the event successfully";
header("Location: http://157.245.128.154/RSOdetails.php");
}
else
{
echo "sorry event was not added";
}
}
else
{
echo "conflicting time with another event";
}
}
?>