<?php

require_once '../../config.php';
require_once '../../db_functions.php';
require_once '../../db_queries.php';
$name = format($_POST["name"]);
$specialty_id = $_POST["specialty"];
if (insert_doctor($name)) {
    $doctor_id = get_id_doctor($name);
    if (insert_doctor_specialty($doctor_id, $specialty_id)) {
        header('Location: ../confirmation/doctor_created.php?name=' . $name . '&specialty=' . get_specialty($specialty_id));
    } else {
        header('Location: ../../error.php?error=' . mysql_error());
    }
} else {
    header('Location: ../../error.php?error=' . mysql_error());
}
<?php

require_once '../../config.php';
require_once '../../db_functions.php';
require_once '../../db_queries.php';
$patient = $_POST['patient'];
$specialty = $_POST['specialty'];
$doctor = $_POST['doctor'];
if (delete_IsPatientOf($patient, $specialty, $doctor)) {
    header('Location: ../confirmation/patient_doctor_deleted.php?patient=' . get_patient($patient) . '&specialty=' . get_specialty($specialty) . '&doctor=' . get_doctor_name($doctor));
} else {
    header('Location: ../../error.php?error=' . mysql_error());
}
<?php

require '../../config.php';
require '../../db_functions.php';
require '../../db_queries.php';
$doctor = $_POST['doctor'];
$specialty = $_POST['specialty'];
if (delete_doctor_specialty($doctor, $specialty)) {
    header('Location: ../confirmation/doctor_specialty_deleted.php?name=' . get_doctor_name($doctor) . '&specialty=' . get_specialty($specialty));
} else {
    header('Location: ../../error.php?error=' . mysql_error());
}
<?php

require '../../config.php';
require '../../db_functions.php';
require '../../db_queries.php';
$doctor_id = $_POST["doctor"];
$specialty_id = $_POST["specialty"];
if (insert_doctor_specialty($doctor_id, $specialty_id)) {
    header('Location: ../confirmation/doctor_specialty_added.php?name=' . get_doctor_name($doctor_id) . '&specialty=' . get_specialty($specialty_id));
} else {
    header('Location: ../../error.php?error=' . mysql_error());
}