mirror of
https://github.com/BreizhHardware/ProjetS4COMWEB.git
synced 2026-01-18 16:47:35 +01:00
@@ -1,90 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title> Oui....Stiti </title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Just+Me+Again+Down+Here&family=Open+Sans&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="src/css/styles.css">
|
||||
<link rel="icon" href="src/img/favicon.png" type="image/x-icon"/>
|
||||
<?php
|
||||
require('src/php/db/dbconnect.php');
|
||||
require('src/php/constants.php');
|
||||
require('src/php/components/token.php');
|
||||
require('src/php/components/check.php');
|
||||
require('src/php/components/user-login.php');
|
||||
require('src/php/db/Patient.php');
|
||||
require('src/php/db/Medecin.php');
|
||||
require('src/php/db/Calendrier.php');
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
$pdo = dbConnect();
|
||||
session_start();
|
||||
checkPatient();
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="topbar" class="d-flex justify-content-between flex-row">
|
||||
<div>
|
||||
<a href="index.php">
|
||||
<p id="DoctISEN" class="top-0">
|
||||
Doct'ISEN
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
<div class="d-flex flex-row align-items-center gap-3 me-2">
|
||||
<div class="d-flex flex-row align-items-center gap-3 me-2">
|
||||
<?php
|
||||
loginUI($pdo);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="searchbar">
|
||||
<form action="search.php" class="input-group p-5" method="post">
|
||||
<input type="text" aria-label="First name" class="form-control" id="nom" name="nom" placeholder="Nom, spécialité, établissement ...">
|
||||
<input type="text" aria-label="Last name" class="form-control" id="postal" name="postal" placeholder="Où ?">
|
||||
<button class="btn btn-danger" type="submit" id="button-addon2">Rechercher</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="h-100">
|
||||
<div class="row">
|
||||
<div class="col h-100 border-dark border-3 justify-content-center text-center ms-3 ">
|
||||
<div class="d-flex flex-column justify-content-center gap-6">
|
||||
<div>
|
||||
<form class="mt-3" method="post">
|
||||
<label for="date">Choisissez une date :</label>
|
||||
<br>
|
||||
<?php
|
||||
echo '<input type="hidden" name="id" id="id" value="' . $_POST['id'] . '">';
|
||||
echo '<input type="date" name="start" id="date" class="mt-2 form-control" value="' . $_POST['start'] . '">';
|
||||
?>
|
||||
<br>
|
||||
<input type="submit" value="Valider" class="mt-2 btn btn-outline-danger">
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<?php
|
||||
DisplayMedecinCard($pdo, $_POST['id']);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 h-100 border-start border-dark border-3 me-3">
|
||||
<div class="mt-3 d-flex flex-column gap-3">
|
||||
<?php
|
||||
if(!isset($_POST['start']) || $_POST['start'] == null){
|
||||
echo '<p class="ms-5 mt-2 fw-bold">Veuillez choisir une date</p>';
|
||||
}
|
||||
else{
|
||||
displayRDVForDate($pdo, $_POST['start'], $_POST['id']);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -36,8 +36,15 @@
|
||||
</a>
|
||||
<div class="d-flex position-fixed end-0 flex-row align-items-center gap-3 mt-2 top-0">
|
||||
<?php
|
||||
loginUI($pdo);
|
||||
//loginUI($pdo);
|
||||
?>
|
||||
<div class="d-flex flex-row align-items-center gap-3 me-2">
|
||||
<img src="https://1.gravatar.com/avatar/4d43af207280d1d23e2a2905577c7b6167723fec2d33f946cc86f114c1a85b8d?size=64" alt="avatar" id="avatar" style="width: 14.3%; height: auto; border-radius: 50%">
|
||||
<div>
|
||||
<a href="src/php/db/scripts/deconnexion.php" class="text-white fw-bold mt-3 link-underline-opacity-75-hover link-underline link-underline-opacity-0 link-offset-3-hover link-underline-light">Test Test</a>
|
||||
</div>
|
||||
<a class="text-white fw-bold link-underline-opacity-75-hover link-underline link-underline-opacity-0 link-offset-3-hover link-underline-light" id="praticien-calendar">Mon calendrier</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="searchbar"></div>
|
||||
|
||||
65
search.php
65
search.php
@@ -1,65 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title> Recherche </title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Just+Me+Again+Down+Here&family=Open+Sans&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="src/css/styles.css">
|
||||
<script src="src/js/AJAX/utils.js" defer></script>
|
||||
<script src="src/js/AJAX/index.js" defer></script>
|
||||
<link rel="icon" href="src/img/favicon.png" type="image/x-icon"/>
|
||||
<?php
|
||||
require('src/php/db/dbconnect.php');
|
||||
require('src/php/constants.php');
|
||||
require('src/php/components/token.php');
|
||||
require('src/php/components/check.php');
|
||||
require('src/php/components/user-login.php');
|
||||
require('src/php/db/Patient.php');
|
||||
require('src/php/db/Medecin.php');
|
||||
require ('src/php/db/Search.php');
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
$pdo = dbConnect();
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="searchtopbar">
|
||||
<div id="topbar" class="d-flex justify-content-between flex-row">
|
||||
<div>
|
||||
<a href="index.php">
|
||||
<p id="DoctISEN">
|
||||
Doct'ISEN
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
<div class="d-flex flex-row align-items-center gap-3 me-2">
|
||||
<div class="d-flex flex-row align-items-center gap-3 me-2">
|
||||
<?php
|
||||
loginUI($pdo);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="searchbar">
|
||||
<form class="input-group p-5" action="search.php" method="post">
|
||||
<input type="text" aria-label="First name" class="form-control" id="nom" name="nom" placeholder="Nom, spécialité">
|
||||
<input type="text" aria-label="Last name" class="form-control" id="postal" name="postal" placeholder="Où ?">
|
||||
<button class="btn btn-danger" type="submit" id="button-addon2">Rechercher</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<!--
|
||||
<?php
|
||||
//search($pdo, $_POST['nom'], $_POST['postal']);
|
||||
// Old native PHP code
|
||||
?>
|
||||
Switch to AJAX with APIREST
|
||||
--->
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -61,59 +61,4 @@ function takeRDV($pdo, $rdv_id, $patient_id): void
|
||||
$query->execute();
|
||||
Response::HTTP200(['success' => 'RDV taken']);
|
||||
}
|
||||
|
||||
/*
|
||||
function displayRDVForDate($pdo, $date, $medecin){
|
||||
$availableHours = selectRDVForDate($pdo, $date, $medecin);
|
||||
if(!$availableHours){
|
||||
echo '<p class="ms-5 mt-2 fw-bold">Aucun rendez-vous disponible</p>';
|
||||
}
|
||||
else{
|
||||
echo '<p class="ms-5 mt-2 fw-bold">Rendez-vous disponible :</p>';
|
||||
foreach ($availableHours as $hour){
|
||||
$hourValue = selectRDVTimeByID($pdo, $hour);
|
||||
$hourValue = substr($hourValue, 0, 5);
|
||||
$token = tokenDecode();
|
||||
$patient = $token[1];
|
||||
echo '<a href="./src/php/db/scripts/addRDVToDB.php?id='.$hour.'&patient='.$patient.'" class="btn btn-danger w-100">'.$hourValue.'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function DisplayMedecinCard($pdo, $medecin){
|
||||
$query = $pdo->prepare("SELECT * FROM medecin WHERE m_id = :id");
|
||||
$query->bindParam(':id', $medecin);
|
||||
$query->execute();
|
||||
$result = $query->fetchAll();
|
||||
foreach ($result as $row){
|
||||
echo '<div class="card mb-3">';
|
||||
echo '<div class="row g-0">';
|
||||
echo '<div class="col-md-4">';
|
||||
$imageUrl = 'https://thispersondoesnotexist.com';
|
||||
echo '<img src="' . $imageUrl . '" alt="doctor" class="img-fluid rounded-start" width="300" height="300">';
|
||||
echo '</div>';
|
||||
echo '<div class="col-md-8">';
|
||||
echo '<div class="card-body">';
|
||||
echo '<h5 class="card-title">'.$row['m_name'].' '.$row['m_surname'].'</h5>';
|
||||
echo '<h6 class="card-subtitle mb-2 text-body-secondary">'.$row['m_specialty'].'</h6>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
function addRDVToDBThenRedirect($pdo, $rdv, $patient){
|
||||
$query = $pdo->prepare("UPDATE rendez_vous SET p_id = :p_id WHERE rdv_id = :rdv_id");
|
||||
$query->bindParam(':p_id', $patient);
|
||||
$query->bindParam(':rdv_id', $rdv);
|
||||
$query->execute();
|
||||
//Redirect to the rdv.php page
|
||||
echo '<meta http-equiv="refresh" content="0;URL=../../../rdv.php">';
|
||||
}
|
||||
*/
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user