diff --git a/add_event.php b/add_event.php new file mode 100644 index 0000000..29d5825 --- /dev/null +++ b/add_event.php @@ -0,0 +1,76 @@ +Brak uprawnien!'; + header('Location: index.php'); + exit(); + } + +?> + + + + + + + Event Manager + + + + + + + + + + + + + +
+ DODAJ SWOJE WYDARZENIE !

+ +
+ + Tytul:

+ Opis:

+ Data rozp.:

+ Data zako.:

+ Godzina rozp.:

+ Godzina zako.:

+ Lokalizacja:

+ Ilość miejsc max:

+ Ilość miejsc min:


+ +

+ +
+ +".$_SESSION['add_log'].""; + unset($_SESSION['add_log']); + } + echo '

Powrót

'; +unset($_SESSION['controller']); +?> +
+ + + + + + + + \ No newline at end of file diff --git a/calendar.php b/calendar.php new file mode 100644 index 0000000..b78b916 --- /dev/null +++ b/calendar.php @@ -0,0 +1,41 @@ + +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//hacksw/handcal//NONSGML v1.0//EN +CALSCALE:GREGORIAN +BEGIN:VEVENT +DTEND;TZID="Central European Standard Time": +UID: +DTSTAMP:20181031T105919Z +LOCATION: +DESCRIPTION: +URL;VALUE=URI:http://127.0.0.1/event/events.php +SUMMARY: +DTSTART;TZID="Central European Standard Time": +END:VEVENT +END:VCALENDAR \ No newline at end of file diff --git a/controller.php b/controller.php new file mode 100644 index 0000000..7af2230 --- /dev/null +++ b/controller.php @@ -0,0 +1,60 @@ +connect_errno!=0) + { + echo "Error: ".$polaczenie->connect_errno; + } + else + { + #$login = $_SESSION['employeeID']; + + $login = htmlentities($login, ENT_QUOTES, "UTF-8"); + + if ($rezultat = @$polaczenie->query( + sprintf("SELECT events.id_events, events.quantity FROM manager, events WHERE events.id_events = manager.id_events AND manager.id_events = '".$_SESSION['numevent']."' AND manager.employeeID='".$_SESSION['login']."'", + mysqli_real_escape_string($polaczenie,$login)))) + { + $ilu_userow = $rezultat->num_rows; + if($ilu_userow>0) + { + $wiersz = $rezultat->fetch_assoc(); + $_SESSION['controller'] = "true"; + $rezultat->free_result(); + + header('Location: join_page_style.php'); + + } + else + { + $_SESSION['controller'] = "false"; + //Osoby które nie sa w wydarzeniu + header('Location: join_page_style.php'); + } + } + $polaczenie->close(); + } + +?> \ No newline at end of file diff --git a/dbconnect.php b/dbconnect.php new file mode 100644 index 0000000..d8de527 --- /dev/null +++ b/dbconnect.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/edit.php b/edit.php new file mode 100644 index 0000000..fdf784f --- /dev/null +++ b/edit.php @@ -0,0 +1,103 @@ +Brak uprawnien!'; + header('Location: index.php'); + exit(); + } + + ini_set("display_errors", 0); + require_once "dbconnect.php"; + $polaczenie = mysqli_connect($host, $db_user, $db_password); + mysqli_query($polaczenie, "SET CHARSET utf8"); + mysqli_query($polaczenie, "SET NAMES 'utf8' COLLATE 'utf8_polish_ci'"); + mysqli_select_db($polaczenie, $db_name); + $controller = $_SESSION['quantity_controller']; + $stopdate = $_SESSION['e_dtstp']; + + if($_POST['title2'] == NULL ) + { + $g1 = $_SESSION['e_title']; + } + else + { + $g1 = $_POST['title2']; + } + if($_POST['description2'] == NULL) + { + $g2 = $_SESSION['e_descr']; + } + else + { + $g2 = $_POST['description2']; + + } + if($_POST['date_start2'] == NULL || ($_POST['date_start2'] >= $stopdate)) + { + $g3 = $_SESSION['e_dtstr']; //domyślna poprzednia + } + elseif(($_POST['date_start2'] < $stopdate)) + { + $g3 = $_POST['date_start2']; //nowa data + } + if($_POST['date_stop2'] == NULL || ($_POST['date_start2'] >= $_POST['date_stop2'])) + { + $g4 = $_SESSION['e_dtstp']; + } + elseif(($_POST['date_start2'] < $_POST['date_stop2'])) + { + $g4 = $_POST['date_stop2']; + } + if($_POST['time_start2'] == NULL || ($_POST['time_start2'] >= $_POST['time_stop2'])) + { + $g5 = $_SESSION['e_tmstr']; + } + elseif(($_POST['time_start2'] < $_POST['time_stop2'])) + { + $g5 = $_POST['time_start2']; + } + if($_POST['time_stop2'] == NULL || ($_POST['time_start2'] >= $_POST['time_stop2'])) + { + $g6 = $_SESSION['e_tmstp']; + } + elseif(($_POST['time_start2'] < $_POST['time_stop2'])) + { + $g6 = $_POST['time_stop2']; + } + if($_POST['location2'] == NULL) + { + $g7 = $_SESSION['e_loc']; + } + else + { + $g7 = $_POST['location2']; + } + if($_POST['quantity2'] == NULL || $controller > $_POST['quantity2']) + { + $g8 = $_SESSION['e_slots']; + } + elseif($controller <= $_POST['quantity2']) + { + $g8 = $_POST['quantity2']; + } + if($_POST['quantity_min2'] == NULL) + { + $g9 = $_SESSION['e_slots']; + } + else + { + $g9 = $_POST['quantity2_min']; + } + + $zapytanietxt = "UPDATE `events` SET `title` = '".$g1."', `description` = '".$g2."', `date_start` = '".$g3."', `date_stop` = '".$g4."', `time_start` = '".$g5."', `time_stop` = '".$g6."', `location` = '".$g7."', `quantity` = '".$g8."', `quantity_min` = '".$g9."' WHERE `events`.`id_events` =".$_SESSION['id_eve']; + $rezultat = mysqli_query($polaczenie, $zapytanietxt); + $ile = mysqli_num_rows($rezultat); + + + header('Location: events.php'); + +unset($_SESSION['controller']); +?> \ No newline at end of file