Restrict calendar setup to the own doctor

This commit is contained in:
coolneng 2020-06-22 02:18:45 +02:00
parent 35d2b70ab6
commit ea9f92d2df
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 10 additions and 0 deletions

View File

@ -14,8 +14,17 @@
$pdo = connectDatabase(); $pdo = connectDatabase();
$doctors = listDoctors($pdo); $doctors = listDoctors($pdo);
closeDatabase($pdo);
?> ?>
<form name="create_form" method="post" action="calendar_management.php"> <form name="create_form" method="post" action="calendar_management.php">
<?php
if($_SESSION["user_type"] == 2):
$pdo = connectDatabase();
$user = finduser($pdo, $_SESSION["user"]);
closeDatabase($pdo);
?>
<input type="hidden" id="medico" name="medico" value="<?php echo $user[0][4]; ?>">
<?php else: ?>
<div class="input-group"> <div class="input-group">
<select id="medico" name="medico"> <select id="medico" name="medico">
<option>Seleccione un médico</option> <option>Seleccione un médico</option>
@ -24,6 +33,7 @@
<?php endforeach ?> <?php endforeach ?>
</select> </select>
</div> </div>
<?php endif; ?>
<div class="input-group"> <div class="input-group">
<label>Hora inicio mañana</label> <label>Hora inicio mañana</label>
<input type="time" name="hora_inicio_mañana" value=""> <input type="time" name="hora_inicio_mañana" value="">