2020-06-18 09:04:44 +02:00
|
|
|
<?php
|
|
|
|
include'database.php';
|
|
|
|
|
|
|
|
function holidayCreation(){
|
|
|
|
$data = $_POST;
|
|
|
|
$pdo = connectDatabase();
|
|
|
|
createHoliday($pdo, $data);
|
|
|
|
closeDatabase($pdo);
|
|
|
|
header('location: calendar.php');
|
|
|
|
}
|
|
|
|
|
|
|
|
function holidayModification(){
|
|
|
|
$data = $_POST;
|
|
|
|
$id = $_POST["id"];
|
|
|
|
$pdo = connectDatabase();
|
|
|
|
editHoliday($pdo, $data, $id);
|
|
|
|
closeDatabase($pdo);
|
|
|
|
header('location: calendar.php');
|
|
|
|
}
|
|
|
|
|
|
|
|
function holidayDeletion(){
|
|
|
|
$id = $_GET["delete"];
|
|
|
|
$pdo = connectDatabase();
|
|
|
|
deleteHoliday($pdo, $id);
|
|
|
|
closeDatabase($pdo);
|
|
|
|
header('location: calendar.php');
|
|
|
|
}
|
|
|
|
|
2020-06-22 01:49:49 +02:00
|
|
|
|
|
|
|
function calendarConfig(){
|
|
|
|
$data = $_POST;
|
|
|
|
$pdo = connectDatabase();
|
|
|
|
configureCalendar($pdo, $data);
|
|
|
|
closeDatabase($pdo);
|
|
|
|
header('location: calendar.php');
|
|
|
|
}
|
|
|
|
|
2020-06-18 09:04:44 +02:00
|
|
|
if (isset($_POST["create"])) {
|
|
|
|
holidayCreation();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($_POST["edit"])) {
|
|
|
|
holidayModification();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($_GET["delete"])) {
|
|
|
|
holidayDeletion();
|
|
|
|
}
|
2020-06-22 01:49:49 +02:00
|
|
|
|
|
|
|
if (isset($_POST["configure"])) {
|
|
|
|
calendarConfig();
|
|
|
|
}
|