MDIS/src/appointment.php

73 lines
3.3 KiB
PHP
Raw Normal View History

2020-06-18 14:48:12 +02:00
<?php session_start(); ?>
<html class="no-js" lang="es">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Gestión de citas</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
2020-06-23 01:04:59 +02:00
<link rel="stylesheet" href="static/style.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="static/fullcalendar.css" type="text/css" media="screen"/>
2020-06-26 12:19:51 +02:00
<link rel="stylesheet" href="static/jquery-ui.css" type="text/css" media="screen"/>
<script src="static/jquery-3.5.1.min.js"></script>
2020-06-23 01:04:59 +02:00
<script src="static/jquery-ui.min.js"></script>
<script src="static/moment.min.js"></script>
<script src="static/fullcalendar.min.js"></script>
<script src="calendar.js"></script>
</head>
<body>
2020-06-21 21:40:25 +02:00
<?php include 'navbar.php'; ?>
2020-06-21 20:38:22 +02:00
<?php
include 'appointment_management.php';
2020-06-21 20:38:22 +02:00
2020-06-25 17:59:56 +02:00
$pdo = connectDatabase();
$patients = listPatients($pdo);
2020-06-26 12:19:51 +02:00
$calendar_settings = fetchCalendarSettings($pdo, $doctor);
2020-06-21 20:38:22 +02:00
?>
<?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>
</form>
<?php endif; ?>
<div id="dialog-form" title="Añadir cita" style="display:none;">
<form name="add_appointment" method="post" action="appointment_management.php">
2020-06-26 12:19:51 +02:00
<div class="input-group">
<label for="hora">Hora</label>
<input type="time" name="hora" value="">
</div>
<div class="input-group">
<label for="duracion">Duración</label>
<input type="number" name="duracion" value="<?php echo $calendar_settings[8]; ?>" step="30">
</div>
<div class="input-group">
<label for="observaciones">Observaciones</label>
<input type="text" name="observaciones" value="">
</div>
<div class="input-group">
<select id="paciente" name="paciente">
<option>Seleccione un paciente</option>
<?php foreach ($patients as $row) : ?>
2020-07-08 21:23:13 +02:00
<option value="<?php echo $row[0]; ?>"><?php echo $row[2]; ?></option>
2020-06-26 12:19:51 +02:00
<?php endforeach ?>
</select>
</div>
<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; ?>">
2020-06-26 12:19:51 +02:00
</form>
<?php closeDatabase($pdo); ?>
2020-06-26 12:19:51 +02:00
</div>
<div class="response"></div>
2020-06-23 01:04:59 +02:00
<div id="calendar"></div>
</body>
</html>