MDIS/src/report_management.php

41 lines
815 B
PHP
Raw Normal View History

2020-06-18 12:24:13 +02:00
<?php
include'database.php';
function reportCreation(){
$data = $_POST;
$pdo = connectDatabase();
createReport($pdo, $data);
closeDatabase($pdo);
header('location: report.php');
}
function reportModification(){
$data = $_POST;
$id = $_POST["id"];
$pdo = connectDatabase();
editReport($pdo, $data, $id);
closeDatabase($pdo);
header('location: report.php');
}
function reportDeletion(){
$id = $_GET["delete"];
$pdo = connectDatabase();
deleteReport($pdo, $id);
closeDatabase($pdo);
header('location: report.php');
}
if (isset($_POST["create"])) {
reportCreation();
}
if (isset($_POST["edit"])) {
reportModification();
}
if (isset($_GET["delete"])) {
reportDeletion();
}