Sie sind auf Seite 1von 4

<?

php
require_once __DIR__ . '/classes/Autoloader.php';
$loader = new Autoloader();
$loader->addNamespaceMapping("\\Database", 'classes/Database');
$loader->addNamespaceMapping("\\Objects", "classes/Objects");
session_start(); //Keep track of current broswer session.
use Database\DbObject;
use Objects\Person;
$db = new DbObject();
//redirect the user if they are not logged in
//because they shouldn't be on this page
if (!isset($_SESSION["person"]))
{
header('Location:index.php');
exit;
}
if ($_SESSION["person"]->accessLevel === null)
{
header('Location:index.php');
exit;
}
//if the $_GET['blockEmail'] is set, that means Mechele wants to block a patient
if(isset($_GET['blockEmail']))
{
// var_dump($_SESSION["person"]);
// var_dump($_GET['email']);
$person = new Person();
$person->blockPatient($_GET['blockEmail'], TRUE);
unset($_GET['blockEmail']);
}
//Mechele wants to unblock a patient when she unchecks the blocked checkbox
else if (isset ($_GET['unblockEmail']))
{
$person = new Person();
$pid = $db->getPrimaryKeyViaEmail($_GET['unblockEmail']);
$person->blockPatient($_GET['unblockEmail'], FALSE);
unset($_GET['unblockEmail']);
}
?>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Patient</title>
<!-- links to google font for header banner -->
<link href="//fonts.googleapis.com/css?family=Alex+Brush&amp;subset=latin,latin-ext"
rel="stylesheet" type="text/css">
<!-Latest compiled and minified CSS
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"
integrity="sha512dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVy
Q=="
crossorigin="anonymous">

<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"
integrity="sha384aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX"
crossorigin="anonymous">-->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"
integrity="sha512K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/
pQ=="
crossorigin="anonymous"></script>
<!-- makes the fancy social media buttons. Located in public folder-->
<link href="Styles/bootstrap-social/assets/css/bootstrap.css" rel="stylesheet">
<link href="Styles/bootstrap-social/assets/css/font-awesome.css" rel="stylesheet">
<link href="Styles/bootstrap-social/assets/css/docs.css" rel="stylesheet" >
<link href="Styles/bootstrap-social/bootstrap-social.css" rel="stylesheet" >
<link href="Styles/Bootstrap/css/bootstrap.min.css" rel="stylesheet" >
<link href="Styles/calendar.css" rel="stylesheet" type="text/css" />
<link href="Styles/personProfile.css" rel="stylesheet" type="text/css" />
</head>
<body>
<img src="images/purple-flower-wallpaper.jpg" style="z-index:-1;position:fixed;">
<div class="container" style="position:relative;background-color:white;">
<!-- We don't need a nav bar for our website so we create our own header -->
<h1 class="img" style="text-align:center; font-family: Alex Brush; font-size: 60px; background:
#9932CD; color:white;">
Soul Body Massage & Holistic Therapy</h1>
<?php
$admin = $_SESSION['person'];
//only display navbar for the therapist
if ($admin->accessLevel === 1)
{
?>
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">Soul Body Message</a>
</div>
<ul class="nav navbar-nav">
<li><a href="index.php">Home</a></li>
<li class="active"><a href="adminPatientsList.php">View Patients</a></li>
<li><a href="promotionPage.php">Add Promotion</a></li>
</ul>
</div>
</nav>
<?php
}
?>
<h1 class="aptitle">Patient List</h1>
<?php
//if the person is logged in

if (isset($_SESSION["person"]))
{
//create the object
$person = $_SESSION["person"];
//display the appointments for that person
echo $person->viewAllPatients();
}
?>
<!-- Modal -->
<div id="areYouSure" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h3 class="modal-title">Cancel Appointment</h3>
</div>
<div class="modal-body">
<h4>Are you sure you want to cancel this appointment?</h4>
<h4>If you cancel within 4 hours of the appointment you must call
Mechele Player at (306) 203-4967 or email her at mplayerrmt@gmail.com</h4>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">No</button>
<button type="button" id="yes" class="btn btn-default" data-dismiss="modal"
data-toggle='modal' data-target='#rebook'>Yes</button>
</div>
</div>
</div>
</div>
</body>
</html>
<script>
var buttonID;
//gets the appointmentID of the corresponding cancel button
$('.cancel').click(function () {
buttonID = $(this).attr('id')
});
//does an ajax call to cancel an appointment when the "Yes" button in the modal
//is clicked
$('#yes').click(function () {
$.post("/MassageBooking/cancel.php", {appointmentID: buttonID}, cancelAppointment)
});
//if there was an error with the ajax call, this function is called.
function cancelAppointment(data)
{
if (data.hasOwnProperty("error"))
{
alert(data.error);
}
}
$('.harassment').change(function(){
var val = this.value;

//Gets the email of the patient that Mechele selected and unselected, and post it back to the page
this.checked ? document.location="adminPatientsList.php?blockEmail=" + val :
document.location="adminPatientsList.php?unblockEmail=" + val;
});
</script>

Das könnte Ihnen auch gefallen