Allow admins to select a doctor's appointments
This commit is contained in:
@@ -20,14 +20,31 @@
|
||||
include 'database.php';
|
||||
|
||||
$pdo = connectDatabase();
|
||||
$events = fetchCalendarEvents($pdo);
|
||||
if($_SESSION["user_type"] == 2){
|
||||
$user = finduser($pdo, $_SESSION["user"]);
|
||||
}
|
||||
$holidays = fetchDoctorHolidays($pdo, $user[0][4]);
|
||||
$calendar_settings = fetchCalendarSettings($pdo, $user[0][4]);
|
||||
closeDatabase($pdo);
|
||||
?>
|
||||
<?php if($_SESSION["user_type"] == 2): ?>
|
||||
$user = finduser($pdo, $_SESSION["user"]);
|
||||
$events = fetchCalendarEvents($pdo, $user[0][4]);
|
||||
$holidays = fetchDoctorHolidays($pdo, $user[0][4]);
|
||||
$calendar_settings = fetchCalendarSettings($pdo, $user[0][4]);
|
||||
<?php else: ?>
|
||||
<form name="select_doctor" method="get">
|
||||
<?php $doctors = listDoctors($pdo); ?>
|
||||
<div class="input-group">
|
||||
<select id="medico" name="medico">
|
||||
<option>Seleccione un médico</option>
|
||||
<?php foreach ($doctors as $row) : ?>
|
||||
<option value="<?php echo $row[0]; ?>"><?php echo $row[1]; ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<button class="create_btn" type="submit" name="select">Seleccionar</button>
|
||||
</div>
|
||||
<?php
|
||||
$events = fetchCalendarEvents($pdo, $_GET["medico"]);
|
||||
$holidays = fetchDoctorHolidays($pdo, $_GET["medico"]);
|
||||
$calendar_settings = fetchCalendarSettings($pdo, $_GET["medico"]);
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<?php closeDatabase($pdo); ?>
|
||||
<div class="response"></div>
|
||||
<div id="calendar"></div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user