Compare commits
2 Commits
f591cb5f2f
...
b93df4005b
Author | SHA1 | Date | |
---|---|---|---|
b93df4005b | |||
63b1b72e88 |
@ -21,13 +21,8 @@
|
|||||||
|
|
||||||
$pdo = connectDatabase();
|
$pdo = connectDatabase();
|
||||||
?>
|
?>
|
||||||
<?php if($_SESSION["user_type"] == 2): ?>
|
<?php if($_SESSION["user_type"] == 1): ?>
|
||||||
$user = finduser($pdo, $_SESSION["user"]);
|
<form name="select_doctor" method="post" action="appointment_management.php">
|
||||||
$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); ?>
|
<?php $doctors = listDoctors($pdo); ?>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<select id="medico" name="medico">
|
<select id="medico" name="medico">
|
||||||
@ -38,11 +33,6 @@
|
|||||||
</select>
|
</select>
|
||||||
<button class="create_btn" type="submit" name="select">Seleccionar</button>
|
<button class="create_btn" type="submit" name="select">Seleccionar</button>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
|
||||||
$events = fetchCalendarEvents($pdo, $_GET["medico"]);
|
|
||||||
$holidays = fetchDoctorHolidays($pdo, $_GET["medico"]);
|
|
||||||
$calendar_settings = fetchCalendarSettings($pdo, $_GET["medico"]);
|
|
||||||
?>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php closeDatabase($pdo); ?>
|
<?php closeDatabase($pdo); ?>
|
||||||
<div class="response"></div>
|
<div class="response"></div>
|
||||||
|
48
src/appointment_management.php
Normal file
48
src/appointment_management.php
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
include'database.php';
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
function fetchDoctor($pdo){
|
||||||
|
if($_SESSION["user_type"] == 2){
|
||||||
|
$user = finduser($pdo, $_SESSION["user"]);
|
||||||
|
return $user[0][4];
|
||||||
|
}
|
||||||
|
$data = $_POST;
|
||||||
|
return $_POST["medico"];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function listEvents(){
|
||||||
|
$pdo = connectDatabase();
|
||||||
|
$doctor = fetchDoctor($pdo);
|
||||||
|
$events = fetchCalendarEvents($pdo, $doctor);
|
||||||
|
closeDatabase($pdo);
|
||||||
|
return json_encode($events);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function listHolidays(){
|
||||||
|
$pdo = connectDatabase();
|
||||||
|
$doctor = fetchDoctor($pdo);
|
||||||
|
$holidays = fetchDoctorHolidays($pdo, $doctor);
|
||||||
|
closeDatabase($pdo);
|
||||||
|
return json_encode($holidays);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function listCalendarSettings(){
|
||||||
|
$pdo = connectDatabase();
|
||||||
|
$doctor = fetchDoctor($pdo);
|
||||||
|
$calendar_settings = fetchCalendarSettings($pdo, $doctor);
|
||||||
|
closeDatabase($pdo);
|
||||||
|
return json_encode($events);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($_GET["list"])) {
|
||||||
|
listEvents();
|
||||||
|
listHolidays();
|
||||||
|
listCalendarSettings();
|
||||||
|
header('location: appointment.php');
|
||||||
|
}
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
header: {
|
header: {
|
||||||
|
|
||||||
left: 'prev,next today',
|
left: 'prev,next,today',
|
||||||
|
|
||||||
center: 'title',
|
center: 'title',
|
||||||
|
|
||||||
@ -24,7 +24,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
events: "events.php",
|
events: "appointment_management.php?list=1",
|
||||||
|
|
||||||
|
|
||||||
eventRender: function(event, element, view) {
|
eventRender: function(event, element, view) {
|
||||||
@ -47,10 +47,9 @@
|
|||||||
|
|
||||||
select: function(start, end, allDay) {
|
select: function(start, end, allDay) {
|
||||||
|
|
||||||
var title = prompt('Event Title:');
|
var title = prompt('Título: ');
|
||||||
|
|
||||||
|
var duration = prompt('Duración: ');
|
||||||
if (title) {
|
|
||||||
|
|
||||||
var start = $.fullCalendar.formatDate(start, "Y-MM-DD HH:mm:ss");
|
var start = $.fullCalendar.formatDate(start, "Y-MM-DD HH:mm:ss");
|
||||||
|
|
||||||
@ -58,7 +57,7 @@
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
||||||
url: 'add_events.php',
|
url: 'appointment_management.php',
|
||||||
|
|
||||||
data: 'title='+ title+'&start='+ start +'&end='+ end,
|
data: 'title='+ title+'&start='+ start +'&end='+ end,
|
||||||
|
|
||||||
@ -86,11 +85,9 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
true
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
calendar.fullCalendar('unselect');
|
calendar.fullCalendar('unselect');
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
$pdo = connectDatabase();
|
$pdo = connectDatabase();
|
||||||
|
|
||||||
$list = listHolidays($pdo);
|
$list = fetchHolidays($pdo);
|
||||||
|
|
||||||
foreach ($list as $row) :
|
foreach ($list as $row) :
|
||||||
?>
|
?>
|
||||||
|
@ -187,7 +187,7 @@ function fetchRegions($pdo)
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
function listHolidays($pdo)
|
function fetchHolidays($pdo)
|
||||||
{
|
{
|
||||||
$query = "SELECT * FROM festivo";
|
$query = "SELECT * FROM festivo";
|
||||||
$result = $pdo->prepare($query);
|
$result = $pdo->prepare($query);
|
||||||
|
BIN
src/static/cover.jpg
Normal file
BIN
src/static/cover.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 155 KiB |
@ -134,7 +134,7 @@ main {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
background-image: linear-gradient(rgba(0, 0, 0, 0.5),rgba(0, 0, 0, 0.5)), url('https://www.pepperconstruction.com/sites/default/files/images/pmc1.jpg');
|
background-image: linear-gradient(rgba(0, 0, 0, 0.5),rgba(0, 0, 0, 0.5)), url('cover.jpg');
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center center;
|
background-position: center center;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
@ -155,7 +155,7 @@ main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#calendar {
|
#calendar {
|
||||||
max-width: 700px;
|
max-width: 600px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
margin-top: 60px;
|
margin-top: 60px;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user