MDIS/src/patient_management.php

54 lines
1.1 KiB
PHP
Raw Normal View History

2020-06-17 08:42:53 +02:00
<?php
include'database.php';
function patientCreation(){
$data = $_POST;
$pdo = connectDatabase();
createPatient($pdo, $data);
closeDatabase($pdo);
header('location: patient.php');
}
function patientModification(){
$data = $_POST;
$id = $_POST["id"];
$pdo = connectDatabase();
editPatient($pdo, $data, $id);
closeDatabase($pdo);
header('location: patient.php');
}
function patientDeletion(){
$id = $_GET["delete"];
$pdo = connectDatabase();
deletePatient($pdo, $id);
closeDatabase($pdo);
header('location: patient.php');
}
function patientFind(){
$data = $_POST;
$pdo = connectDatabase();
findPatient($pdo, $data);
closeDatabase($pdo);
$search = $data["search_box"];
header("location: patient.php?search=$search");
}
if (isset($_POST["create"])) {
patientCreation();
}
if (isset($_POST["edit"])) {
patientModification();
}
if (isset($_GET["delete"])) {
patientDeletion();
}
if (isset($_POST["search"])) {
patientFind();
}