if ($login->login == 0) {
    header("Location: login.php");
}
require "models/Contact.php";
ob_start();
require "phoneEmailAddress.php";
$phoneEmailAddress = ob_get_contents();
ob_end_clean();
require "controllers/PersonController.php";
$updateForm = null;
// http://localhost/contact_v1.1/newcontact.php?id=1&action=update
if (isset($_GET['action']) && $_GET['action'] === 'update') {
    $action = "update";
    $id = (int) $_GET['id'];
    $contact = new PersonPDO();
    $updateForm = $contact->getPersonById($id);
} else {
    $action = "create";
}
$error = NULL;
if (isset($_GET['validate']) && $_GET['validate'] == "error") {
    $error = 1;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="css/bootstrap.min.css">