Send doctor ID as hidden input in appointments

This commit is contained in:
2020-07-08 14:10:14 +02:00
parent 1ee89ef1f5
commit 9858920b11
4 changed files with 49 additions and 32 deletions

View File

@@ -18,28 +18,29 @@
<body>
<?php include 'navbar.php'; ?>
<?php
include 'database.php';
include 'appointment_management.php';
$pdo = connectDatabase();
$list = listPatients($pdo);
$patients = listPatients($pdo);
$calendar_settings = fetchCalendarSettings($pdo, $doctor);
$holidays = listHolidays($pdo);
?>
<?php if($_SESSION["user_type"] == 1): ?>
<form name="select_doctor" method="post" action="appointment_management.php">
<?php if($_SESSION["user_type"] == 1 and !isset($_GET["medico"])): ?>
<form name="select_doctor" method="get" action="appointment.php">
<?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>
<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>
</form>
<?php endif; ?>
<?php closeDatabase($pdo); ?>
<div id="dialog-form" title="Añadir cita" style="display:none;">
<form>
<form name="add_appointment" method="post" action="appointment_management.php">
<div class="input-group">
<label for="hora">Hora</label>
<input type="time" name="hora" value="">
@@ -60,8 +61,11 @@
<?php endforeach ?>
</select>
</div>
<button class="create_btn" type="submit" name="crear" >Añadir cita</button>
<button class="create_btn" type="submit" name="create" >Añadir cita</button>
<?php $doctor = fetchDoctor($pdo); ?>
<input type="hidden" name="doctor" value="<?php echo $doctor; ?>">
</form>
<?php closeDatabase($pdo); ?>
</div>
<div class="response"></div>
<div id="calendar"></div>