mirror of
https://github.com/BreizhHardware/ProjetS4COMWEB.git
synced 2026-01-18 16:47:35 +01:00
taillage dans le gras
This commit is contained in:
@@ -1,23 +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 href="https://getbootstrap.com/docs/5.3/assets/css/docs.css" rel="stylesheet">
|
||||
<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="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<link rel="icon" href="src/img/favicon.png" type="image/x-icon"/>
|
||||
</head>
|
||||
<body style="background-color: #EEF2F7">
|
||||
<div id="topbar">
|
||||
<p id="DoctISEN" class="w-100" style="position: fixed; top: 0px; left: 0px; font-size: 36px">
|
||||
Doct'ISEN
|
||||
</p>
|
||||
</div>
|
||||
<div class="text-center align-content-center">
|
||||
<h1>ERROR </h1>
|
||||
<h2>Veuillez vous connecter</h2>
|
||||
</div>
|
||||
@@ -1,77 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title> Forgot Password </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 href="https://getbootstrap.com/docs/5.3/assets/css/docs.css" rel="stylesheet">
|
||||
<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="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<link rel="icon" href="src/img/favicon.png" type="image/x-icon"/>
|
||||
</head>
|
||||
<?php
|
||||
require('src/php/db/dbconnect.php');
|
||||
require('src/php/constants.php');
|
||||
require('src/php/db/ResetPassword.php');
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
$pdo = dbConnect();
|
||||
?>
|
||||
<body style="background-color: #EEF2F7">
|
||||
<div id="topbar">
|
||||
<a href="index.html">
|
||||
<p id="DoctISEN" class="top-0">
|
||||
Doct'ISEN
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="h-100 d-flex flex-column gap-0 justify-content-center text-center w-50 mx-6">
|
||||
<div class="p-3 m-0 border-0 bd-example m-0 border-0">
|
||||
<div class="loginInsideCard dropdown-menu">
|
||||
<h5 class="text-center fw-bold">J'ai oublié mon mot de passe praticien</h5>
|
||||
<form class="px-4 py-3" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
|
||||
<div>
|
||||
<div class="mb-3">
|
||||
<label for="exampleDropdownFormEmail1" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="exampleDropdownFormEmail1" placeholder="email@example.com" name="mail">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Nouveau mot de passe</label>
|
||||
<input type="password" class="form-control" id="password" placeholder="Password" name="password">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="passwordConfirmation" class="form-label">Confirmation du nouveau mot de passe</label>
|
||||
<input type="password" class="form-control" id="passwordConfirmation" placeholder="Password" name="passwordConfirmation">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center justify-content-center">
|
||||
<button type="submit" class="btn btn-danger logButton">Réinitialiser le mot de passe</button>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
if(!empty($_POST['mail']) && !empty($_POST['password']) && !empty($_POST['passwordConfirmation'])){
|
||||
$mail = ($_POST["mail"]);
|
||||
$password = ($_POST["password"]);
|
||||
$passwordConfirmation = ($_POST["passwordConfirmation"]);
|
||||
if($password == $passwordConfirmation){
|
||||
if(ResetPraticien::Reset($pdo,$mail,$password)){
|
||||
error_log("Reset success");
|
||||
echo '<meta http-equiv="refresh" content="0;url=login-praticien.php">';
|
||||
} else {
|
||||
error_log("Reset failed");
|
||||
echo "<p class='text-center justify-content-center text-danger'>Erreur lors de la réinitialisation du mot de passe</p>";
|
||||
}
|
||||
} else {
|
||||
error_log("Reset failed");
|
||||
echo "<p class='text-center justify-content-center text-danger'>Les mots de passe ne correspondent pas</p>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,77 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title> Forgot Password </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 href="https://getbootstrap.com/docs/5.3/assets/css/docs.css" rel="stylesheet">
|
||||
<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="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<link rel="icon" href="src/img/favicon.png" type="image/x-icon"/>
|
||||
</head>
|
||||
<?php
|
||||
require('src/php/db/dbconnect.php');
|
||||
require('src/php/constants.php');
|
||||
require('src/php/db/ResetPassword.php');
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
$pdo = dbConnect();
|
||||
?>
|
||||
<body style="background-color: #EEF2F7">
|
||||
<div id="topbar">
|
||||
<a href="index.html">
|
||||
<p id="DoctISEN" class="top-0">
|
||||
Doct'ISEN
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="h-100 d-flex flex-column gap-0 justify-content-center text-center w-50 mx-6">
|
||||
<div class="p-3 m-0 border-0 bd-example m-0 border-0">
|
||||
<div class="loginInsideCard dropdown-menu">
|
||||
<h5 class="text-center fw-bold">J'ai oublié mon mot de passe</h5>
|
||||
<form class="px-4 py-3" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
|
||||
<div>
|
||||
<div class="mb-3">
|
||||
<label for="exampleDropdownFormEmail1" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="exampleDropdownFormEmail1" placeholder="email@example.com" name="mail">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Nouveau mot de passe</label>
|
||||
<input type="password" class="form-control" id="password" placeholder="Password" name="password">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="passwordConfirmation" class="form-label">Confirmation du nouveau mot de passe</label>
|
||||
<input type="password" class="form-control" id="passwordConfirmation" placeholder="Password" name="passwordConfirmation">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center justify-content-center">
|
||||
<button type="submit" class="btn btn-danger logButton" id="resetBtn">Réinitialiser le mot de passe</button>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
if(!empty($_POST['mail']) && !empty($_POST['password']) && !empty($_POST['passwordConfirmation'])){
|
||||
$mail = ($_POST["mail"]);
|
||||
$password = ($_POST["password"]);
|
||||
$passwordConfirmation = ($_POST["passwordConfirmation"]);
|
||||
if($password == $passwordConfirmation){
|
||||
if(ResetPatient::Reset($pdo,$mail,$password)){
|
||||
error_log("Reset success");
|
||||
echo '<meta http-equiv="refresh" content="0;url=login.php">';
|
||||
} else {
|
||||
error_log("Reset failed");
|
||||
echo "<p class='text-center justify-content-center text-danger'>Erreur lors de la réinitialisation du mot de passe</p>";
|
||||
}
|
||||
} else {
|
||||
error_log("Reset failed");
|
||||
echo "<p class='text-center justify-content-center text-danger'>Les mots de passe ne correspondent pas</p>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,81 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title> Login </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 href="https://getbootstrap.com/docs/5.3/assets/css/docs.css" rel="stylesheet">
|
||||
<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="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<link rel="icon" href="src/img/favicon.png" type="image/x-icon"/>
|
||||
</head>
|
||||
<?php
|
||||
require('src/php/db/dbconnect.php');
|
||||
require('src/php/constants.php');
|
||||
require('src/php/db/Login.php');
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
$pdo = dbConnect();
|
||||
session_start();
|
||||
?>
|
||||
<body style="background-color: #EEF2F7">
|
||||
<div id="topbar">
|
||||
<a href="index.html">
|
||||
<p id="DoctISEN" class="top-0">
|
||||
Doct'ISEN
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="h-100 d-flex flex-column gap-0 justify-content-center text-center w-50 mx-6">
|
||||
<div class="p-3 m-0 border-0 bd-example m-0 border-0">
|
||||
<div class="loginInsideCard dropdown-menu">
|
||||
<h5 class="text-center fw-bold">J'ai déjà un compte praticen Doct'ISEN</h5>
|
||||
<form class="px-4 py-3" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
|
||||
<div>
|
||||
<div class="mb-3">
|
||||
<label for="exampleDropdownFormEmail1" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="exampleDropdownFormEmail1" placeholder="email@example.com" name="mail">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="exampleDropdownFormPassword1" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="exampleDropdownFormPassword1" placeholder="Password" name="password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center justify-content-center">
|
||||
<button type="submit" class="btn btn-danger logButton">Se connecter</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="text-center justify-content-center">
|
||||
<a href="forgotPassword-praticien.php" class="text-center justify-content-center">
|
||||
<p class="text-center justify-content-center text-danger">Mot de passe oublié ?</p>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
if(!empty($_POST['mail']) && !empty($_POST['password'])){
|
||||
$login = LoginMedecin::Login($pdo,$_POST["mail"],$_POST["password"]);
|
||||
if($login != false){
|
||||
error_log("Login success");
|
||||
$_SESSION['token'] = base64_encode("medecin:".strval($login));
|
||||
echo '<meta http-equiv="refresh" content="0;url=rdv-praticien.php">';
|
||||
} else {
|
||||
error_log('Erreur de connexion');
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-3 m-0 border-0 bd-example m-0 border-0 text-center justify-content-center mt-5">
|
||||
<div class="dropdown-menu text-center align-content-center">
|
||||
<h5 class="fw-bold">Nouveau sur praticien Doct'ISEN?</h5>
|
||||
<a href="signup-praticien.php" class="">
|
||||
<button class="btn btn-danger logButton">S'inscrire</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
81
login.php
81
login.php
@@ -1,81 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title> Login </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 href="https://getbootstrap.com/docs/5.3/assets/css/docs.css" rel="stylesheet">
|
||||
<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="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<link rel="icon" href="src/img/favicon.png" type="image/x-icon"/>
|
||||
</head>
|
||||
<?php
|
||||
require('src/php/db/dbconnect.php');
|
||||
require('src/php/constants.php');
|
||||
require('src/php/db/Login.php');
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
session_start();
|
||||
$pdo = dbConnect();
|
||||
?>
|
||||
<body style="background-color: #EEF2F7">
|
||||
<div id="topbar">
|
||||
|
||||
<a href="index.html">
|
||||
<p id="DoctISEN" class="top-0">
|
||||
Doct'ISEN
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="h-100 d-flex flex-column gap-0 justify-content-center text-center w-50 mx-6">
|
||||
<div class="p-3 m-0 border-0 bd-example m-0 border-0">
|
||||
<div class="loginInsideCard dropdown-menu">
|
||||
<h5 class="text-center fw-bold">J'ai déjà un compte Doct'ISEN</h5>
|
||||
<form class="px-4 py-3" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
|
||||
<div>
|
||||
<div class="mb-3">
|
||||
<label for="exampleDropdownFormEmail1" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="exampleDropdownFormEmail1" placeholder="email@example.com" name="mail">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="exampleDropdownFormPassword1" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="exampleDropdownFormPassword1" placeholder="Password" name="password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center justify-content-center">
|
||||
<button type="submit" class="btn btn-danger logButton">Se connecter</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="text-center justify-content-center">
|
||||
<a href="forgotPassword.php" class="text-center justify-content-center">
|
||||
<p class="text-center justify-content-center">Mot de passe oublié ?</p>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
if(!empty($_POST['mail']) && !empty($_POST['password'])){
|
||||
$login = LoginPatient::Login($pdo,$_POST["mail"],$_POST["password"]);
|
||||
if($login != false){
|
||||
error_log("Login success");
|
||||
$_SESSION['token'] = base64_encode("patient:".strval($login));
|
||||
echo '<meta http-equiv="refresh" content="0;url=index.html">';
|
||||
} else {
|
||||
error_log('Erreur de connexion');
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-3 m-0 border-0 bd-example m-0 border-0 text-center justify-content-center mt-5">
|
||||
<div class="dropdown-menu text-center align-content-center">
|
||||
<h5 class="fw-bold">Nouveau sur Doct'ISEN?</h5>
|
||||
<a href="signup.php" class="">
|
||||
<button class="btn btn-danger logButton">S'inscrire</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,89 +0,0 @@
|
||||
<body>
|
||||
<div class="h-100">
|
||||
<div class="d-flex flex-row flex-wrap my-5 mx-5 gap-5 justify-content-center text-center">
|
||||
|
||||
<?php try {
|
||||
$token = tokenDecode();
|
||||
$rdv = getAllNiche($pdo, $token[1]);
|
||||
if ($rdv != null && count($rdv) > 0){
|
||||
foreach ($rdv as $row) {
|
||||
$dateStr = $row["rdv_date"];
|
||||
$dateString = new DateTime($dateStr);
|
||||
$date = $dateString->format('d F Y');
|
||||
$uglyTime = $row["rdv_time"];
|
||||
$dateTime = new DateTime($uglyTime);
|
||||
$time = $dateTime->format('H:i');
|
||||
$patient = $row["patient"];
|
||||
$mail = $row["p_mail"];
|
||||
$phone = $row["p_phone"];
|
||||
if ($mail != null){
|
||||
echo '<div class="card rounded-4 mx-2 pointer">';
|
||||
echo '<div class="card-header bg-danger">';
|
||||
echo '<div class="d-flex flex-row justify-content-between text-white">';
|
||||
echo "<p>$date</p>";
|
||||
echo "<p>$time</p>";
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '<div class="card-body">';
|
||||
echo "<h5 class='card-title'>$patient</h5>";
|
||||
echo "<a href='mailto:" . $mail . "' class='card-subtitle mb-2 text-body-secondary'>$mail</a>";
|
||||
echo '<br>';
|
||||
echo "<a href='tel:" . "0" . $phone . "' class='card-subtitle mb-2 text-body-secondary'>$phone</a>";
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
} else {
|
||||
echo '<div class="card rounded-4 mx-2 pointer">';
|
||||
echo '<div class="card-header bg-danger">';
|
||||
echo '<div class="d-flex flex-row justify-content-between text-white">';
|
||||
echo "<p>$date</p>";
|
||||
echo "<p>$time</p>";
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '<div class="card-body">';
|
||||
echo "<h5 class='card-title'>Vous n'avez pas de" . "<br>" . "patient pour ce créneau</h5>";
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo 'error';
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
error_log('Database query error: ' . $e->getMessage());
|
||||
echo "Error fetching data from the database";
|
||||
} ?>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-row flex-wrap my-5 mx-5 gap-5 justify-content-center text-center">
|
||||
<?php
|
||||
$token = tokenDecode();
|
||||
$medID = $token[1];
|
||||
$lieux = getAllLieux($pdo);
|
||||
echo "<form action='src/php/db/scripts/createRDVToDB.php' method='post'>";
|
||||
echo "<input type='hidden' name='medID' value='$medID'>";
|
||||
echo "<input class='form-control' type='date' name='date'>";
|
||||
echo "<input class='form-control' type='time' name='time'>";
|
||||
echo "<select class='form-select' name='lieu' id='lieu'>";
|
||||
echo "<option value=''>Choisissez un lieu</option>";
|
||||
if ($lieux != null && count($lieux) > 0){
|
||||
foreach ($lieux as $row){
|
||||
$adress = $row["l_adress"];
|
||||
$postal = $row["l_postal"];
|
||||
$city = $row["l_city"];
|
||||
$lieu = $adress . ', ' . $postal . ', ' . $city;
|
||||
echo "<option value='$lieu'>$adress, $postal, $city</option>";
|
||||
}
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<br><br>";
|
||||
echo "<button type='submit' name='createRDV' class='btn btn-danger'>Créer un rendez-vous</button>";
|
||||
echo "</form>";
|
||||
?>
|
||||
</div>
|
||||
</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>
|
||||
@@ -1,115 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title> Connexion </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 href="https://getbootstrap.com/docs/5.3/assets/css/docs.css" rel="stylesheet">
|
||||
<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="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<script src="src/js/signup.js" defer></script>
|
||||
<link rel="icon" href="src/img/favicon.png" type="image/x-icon"/>
|
||||
</head>
|
||||
<?php
|
||||
require('src/php/db/dbconnect.php');
|
||||
require('src/php/constants.php');
|
||||
require('src/php/db/Signup.php');
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
$pdo = dbConnect();
|
||||
session_start();
|
||||
?>
|
||||
<body style="background-color: #EEF2F7">
|
||||
<div id="topbar">
|
||||
<a href="index.html">
|
||||
<p id="DoctISEN" class="top-0">
|
||||
Doct'ISEN
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="signInSecondaryCard p-3 border-0 bd-example text-center justify-content-center">
|
||||
<div class="dropdown-menu text-center align-content-center">
|
||||
<h5 class="fw-bold">J'ai déjà un compte praticien Doct'ISEN?</h5>
|
||||
<a href="login-praticien.php" class="">
|
||||
<button class="btn btn-danger logButton">Se connecter</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="SignInPrimaryCard p-3 border-0 bd-example border-0 text-center justify-content-center">
|
||||
<div class="loginInsideCard dropdown-menu">
|
||||
<h5 class="text-center fw-bold">Nouveau praticien sur Doct'ISEN ?</h5>
|
||||
<form class="px-4 py-3" method="post">
|
||||
<div class="align-content-center">
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label align-baseline">Nom</label>
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="Veuillez mettre votre nom">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="surname" class="form-label">Prénom</label>
|
||||
<input type="text" class="form-control" id="surname" name="surname" placeholder="Veuillez mettre votre prénom">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="phone" class="form-label">Numéro de téléphone</label>
|
||||
<input type="tel" pattern="[0-9]{10}" class="form-control" id="phone" name="phone" placeholder="Numéro de téléphone">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="mail" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="mail" name="mail" placeholder="email@example.com">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="mailConfirmation" class="form-label">Email address confirmation</label>
|
||||
<input type="email" class="form-control" id="mailConfirmation" name="mailConfirmation" placeholder="email@example.com">
|
||||
<p class="text-danger fw-bold" id="mail-error"></p>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" placeholder="Password">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="passwordConfirmation" class="form-label">Password Confirmation</label>
|
||||
<input type="password" class="form-control" id="passwordConfirmation" name="passwordConfirmation" placeholder="Password">
|
||||
<p class="text-danger fw-bold" id="password-error"></p>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="codePostal" class="form-label">Code Postal</label>
|
||||
<input type="text" pattern="[0-9]{5}" class="form-control" id="codePostal" name="codePostal" placeholder="Code Postal">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="specialite" class="form-label">Spécialité</label>
|
||||
<input type="text" class="form-control" id="specialite" name="specialite" placeholder="Spécialité">
|
||||
</div>
|
||||
<div class="align-content-center text-center ">
|
||||
<button type="submit" class="btn btn-danger logButton disabled" id="signupButton">Se connecter</button>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
if(!empty($_POST['mail']) && !empty($_POST['password']) && !empty($_POST['name']) && !empty($_POST['surname']) && !empty($_POST['phone']) && !empty($_POST['password']) && !empty($_POST['passwordConfirmation']) && !empty($_POST['mailConfirmation']) && !empty($_POST['codePostal']) && !empty($_POST['specialite'])){
|
||||
$mail = ($_POST["mail"]);
|
||||
$password = ($_POST["password"]);
|
||||
$name = ($_POST["name"]);
|
||||
$surname = ($_POST["surname"]);
|
||||
$phone = ($_POST["phone"]);
|
||||
$codePostal = ($_POST["codePostal"]);
|
||||
$specialite = ($_POST["specialite"]);
|
||||
if(SignupMedecin::insertMedecin($pdo,$name,$surname,$mail, $password,$specialite,$phone,$codePostal)){
|
||||
error_log("Signup success");
|
||||
$_SESSION['id'] = $mail;
|
||||
echo '<meta http-equiv="refresh" content="0;url=index.html">';
|
||||
} else {
|
||||
error_log("Erreur d'inscription");
|
||||
}
|
||||
}
|
||||
else{
|
||||
error_log("Un champ n'est pas rempli");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
105
signup.php
105
signup.php
@@ -1,105 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title> Connexion </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 href="https://getbootstrap.com/docs/5.3/assets/css/docs.css" rel="stylesheet">
|
||||
<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="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<script src="src/js/signup.js" defer></script>
|
||||
<link rel="icon" href="src/img/favicon.png" type="image/x-icon"/>
|
||||
</head>
|
||||
<?php
|
||||
require('src/php/db/dbconnect.php');
|
||||
require('src/php/constants.php');
|
||||
require('src/php/db/Signup.php');
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
$pdo = dbConnect();
|
||||
session_start();
|
||||
?>
|
||||
<body style="background-color: #EEF2F7">
|
||||
<div id="topbar">
|
||||
<a href="index.html">
|
||||
<p id="DoctISEN" class="top-0">
|
||||
Doct'ISEN
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="signInSecondaryCard p-3 m-0 border-0 bd-example m-0 border-0 text-center justify-content-center mt-5">
|
||||
<div class="dropdown-menu text-center align-content-center">
|
||||
<h5 class="fw-bold">J'ai déjà un compte Doct'ISEN?</h5>
|
||||
<a href="login.php" class="">
|
||||
<button class="btn btn-danger logButton">Se connecter</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="SignInPrimaryCard p-3 m-0 border-0 bd-example m-0 border-0 text-center justify-content-center">
|
||||
<div class="loginInsideCard dropdown-menu">
|
||||
<h5 class="text-center fw-bold">Nouveau sur Doct'ISEN ?</h5>
|
||||
<form class="px-4 py-3" method="post">
|
||||
<div class="align-content-center">
|
||||
<div class="mb-3">
|
||||
<label for="Name" class="form-label align-baseline">Nom</label>
|
||||
<input type="text" class="form-control" id="Name" name="name" placeholder="Veuillez mettre votre nom">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="FirstName" class="form-label">Prénom</label>
|
||||
<input type="text" class="form-control" id="FirstName" name="surname" placeholder="Veuillez mettre votre prénom">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="Num" class="form-label">Numéro de téléphone</label>
|
||||
<input type="tel" pattern="[0-9]{10}" class="form-control" id="Num" name="phone" placeholder="Numéro de téléphone">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="mail" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="mail" name="mail" placeholder="email@example.com">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="mailConfirmation" class="form-label">Email address confirmation</label>
|
||||
<input type="email" class="form-control" id="mailConfirmation" name="mailConfirmation" placeholder="email@example.com">
|
||||
<p class="text-danger fw-bold" id="mail-error"></p>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" placeholder="Password">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="passwordConfirmation" class="form-label">Password Confirmation</label>
|
||||
<input type="password" class="form-control" id="passwordConfirmation" name="passwordConfirmation" placeholder="Password">
|
||||
<p class="text-danger fw-bold" id="password-error"></p>
|
||||
</div>
|
||||
<div class="align-content-center text-center ">
|
||||
<button type="submit" class="btn btn-danger logButton disabled" id="signupButton">Se connecter</button>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
if(!empty($_POST['mail']) && !empty($_POST['password']) && !empty($_POST['name']) && !empty($_POST['surname']) && !empty($_POST['phone']) && !empty($_POST['password']) && !empty($_POST['passwordConfirmation']) && !empty($_POST['mailConfirmation'])){
|
||||
$mail = ($_POST["mail"]);
|
||||
$password = ($_POST["password"]);
|
||||
$name = ($_POST["name"]);
|
||||
$surname = ($_POST["surname"]);
|
||||
$phone = ($_POST["phone"]);
|
||||
if(SignupPatient::Insert($pdo,$name,$surname,$mail,$password,$phone)){
|
||||
error_log("Signup success");
|
||||
$_SESSION['id'] = $mail;
|
||||
echo '<meta http-equiv="refresh" content="0;url=index.html">';
|
||||
} else {
|
||||
error_log('Erreur de connexion');
|
||||
}
|
||||
}
|
||||
else{
|
||||
error_log('Erreur de connexion');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -140,6 +140,11 @@ $router->DELETE('/api/cancel-empty-rdv', ["id"], function($id){
|
||||
CancelEmptyRDV($pdo, $id);
|
||||
});
|
||||
|
||||
$router->DELETE('/api/cancel-rdv', ["id"], function($id){
|
||||
global $pdo;
|
||||
CancelRDV($pdo, $id);
|
||||
});
|
||||
|
||||
$router->POST('/api/create-rdv', ["medID", "date", "time", "lieu"], function($medID, $date, $time, $lieu){
|
||||
global $pdo;
|
||||
CreateRDV($pdo, $medID, $date, $time, $lieu);
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
function checklogin(){
|
||||
if(isset($_SESSION['token'])){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function checkMedecin(){
|
||||
if(isset($_SESSION['token'])){
|
||||
$token = tokenDecode();
|
||||
if($token[0] == "medecin"){
|
||||
return true;
|
||||
} else {
|
||||
if($token[0] == "patient"){
|
||||
echo '<meta http-equiv="refresh" content="0;url=index.html">';
|
||||
return false;
|
||||
} else {
|
||||
echo '<meta http-equiv="refresh" content="0;url=login-praticien.php">';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<meta http-equiv="refresh" content="0;url=index.html">';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function checkPatient(){
|
||||
if(isset($_SESSION['token'])){
|
||||
$token = tokenDecode();
|
||||
if($token[0] == "patient"){
|
||||
return true;
|
||||
} else {
|
||||
if($token[0] == "medecin"){
|
||||
echo '<meta http-equiv="refresh" content="0;url=index.html">';
|
||||
return false;
|
||||
} else {
|
||||
echo '<meta http-equiv="refresh" content="0;url=login.php">';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<meta http-equiv="refresh" content="0;url=index.html">';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
function tokenDecode(){
|
||||
$token = base64_decode($_SESSION['token']);
|
||||
$token = explode(":",$token);
|
||||
return $token;
|
||||
};
|
||||
?>
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
function loginUI($pdo){
|
||||
if (checklogin()){
|
||||
$token = tokenDecode();
|
||||
if ($token[0] == "patient" ){
|
||||
$user = Patient::getPatientFromId($pdo, $token[1]);
|
||||
$mail = $user['p_mail'];
|
||||
$surname = $user['p_surname'];
|
||||
$name = $user['p_name'];
|
||||
} else {
|
||||
$user = Medecin::getMedecinFromId($pdo, $token[1]);
|
||||
$mail = $user['m_mail'];
|
||||
$surname = $user['m_surname'];
|
||||
$name = $user['m_name'];
|
||||
}
|
||||
echo '<div class="d-flex flex-row align-items-center gap-3 me-2">
|
||||
<img src="https://www.gravatar.com/avatar/' . md5($mail) . '?s=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">'.$surname." ".$name.'</a>
|
||||
</div>';
|
||||
if($token[0] == "patient"){
|
||||
echo '<a href="rdv.php" class="text-white fw-bold link-underline-opacity-75-hover link-underline link-underline-opacity-0 link-offset-3-hover link-underline-light">Mes rendez-vous</a></div>';
|
||||
} else {
|
||||
echo '<a href="rdv-praticien.php" class="text-white fw-bold link-underline-opacity-75-hover link-underline link-underline-opacity-0 link-offset-3-hover link-underline-light">Mon calendrier</a></div>';
|
||||
}
|
||||
} else {
|
||||
echo '<a href="login-praticien.php"> <button type="button" class="btn btn-danger" style="top: 0.4375em;" id="login-praticien">Vous êtes praticien ?</button> </a><a href="login.php"> <button type="button" class="btn btn-danger" style="top: 0.4375em;" id="login-user">Se connecter</button></a><p> </p>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,88 +1,5 @@
|
||||
<?php
|
||||
|
||||
//require_once '../../API/src/response.php';
|
||||
/*
|
||||
class LoginPatient {
|
||||
|
||||
public static function checkMail($pdo, $mail) {
|
||||
$query = $pdo->prepare("SELECT COUNT(*) as count FROM patient WHERE p_mail = :mail");
|
||||
$query->bindParam(':mail', $mail);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($result['count'] == 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static function Login($pdo,$mail,$password) {
|
||||
|
||||
if(LoginPatient::checkMail($pdo,$mail)){
|
||||
$query = $pdo->prepare("SELECT p_id,p_password FROM patient where p_mail = :mail");
|
||||
$query->bindParam(':mail', $mail);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if(password_verify($password,$result['p_password'])){
|
||||
echo "Login success";
|
||||
return $result['p_id'];
|
||||
} else {
|
||||
echo "Login failed";
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "Mail not found";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class LoginMedecin {
|
||||
|
||||
|
||||
public static function checkMail($pdo, $mail) {
|
||||
$query = $pdo->prepare("SELECT COUNT(*) as count FROM medecin WHERE m_mail = :mail");
|
||||
$query->bindParam(':mail', $mail);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($result['count'] == 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static function Login($pdo,$mail,$password) {
|
||||
|
||||
if(LoginMedecin::checkMail($pdo,$mail)){
|
||||
$query = $pdo->prepare("SELECT m_id, m_password FROM medecin where m_mail = :mail");
|
||||
$query->bindParam(':mail', $mail);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if(password_verify($password,$result['m_password'])){
|
||||
echo "Login success";
|
||||
return $result['m_id'];
|
||||
} else {
|
||||
echo "Login failed";
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "Mail not found";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
class LoginPatient {
|
||||
public static function checkMail($pdo, $mail) : bool
|
||||
{
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Medecin
|
||||
{
|
||||
public static function getMedecinFromId($pdo,$id) {
|
||||
$query = $pdo->prepare("SELECT * FROM medecin WHERE m_id = :id");
|
||||
$query->bindParam(':id', $id);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function getMedecin($pdo,$mail) {
|
||||
$query = $pdo->prepare("SELECT * FROM medecin WHERE m_mail = :mail");
|
||||
$query->bindParam(':mail', $mail);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function getMedecinByNom($pdo,$nom) {
|
||||
$query = $pdo->prepare("SELECT * FROM medecin WHERE m_name = :nom");
|
||||
$query->bindParam(':nom', $nom);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function getMedecinBySpecialite($pdo,$specialite) {
|
||||
$query = $pdo->prepare("SELECT * FROM medecin WHERE m_specialty = :specialite");
|
||||
$query->bindParam(':specialite', $specialite);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function getMedecinByNameAndSpecialite($pdo,$nom,$specialite) {
|
||||
$query = $pdo->prepare("SELECT * FROM medecin WHERE m_name = :nom AND m_specialty = :specialite");
|
||||
$query->bindParam(':nom', $nom);
|
||||
$query->bindParam(':specialite', $specialite);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,30 +1,6 @@
|
||||
<?php
|
||||
|
||||
class Patient {
|
||||
public static function getPatientFromId($pdo,$id) {
|
||||
$query = $pdo->prepare("SELECT * FROM patient WHERE p_id = :id");
|
||||
$query->bindParam(':id', $id);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function getPatient($pdo,$mail) {
|
||||
$query = $pdo->prepare("SELECT * FROM patient WHERE p_mail = :mail");
|
||||
$query->bindParam(':mail', $mail);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function GetRDV($pdo,$mail){
|
||||
$query = $pdo->prepare("SELECT * FROM rendez_vous WHERE p_mail = :mail");
|
||||
$query->bindParam(':mail', $mail);
|
||||
$query->execute();
|
||||
$result = $query->fetchAll(PDO::FETCH_ASSOC);
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
public static function updatePassword($pdo, $id, $currentpassword, $newpassword): void
|
||||
{
|
||||
|
||||
@@ -1,28 +1,5 @@
|
||||
<?php
|
||||
|
||||
function getAllNiche($pdo, $id){
|
||||
$statement = $pdo->prepare("SELECT rdv_date, rdv_time, concat(p_name,' ', p_surname) as patient, p_mail, p_phone
|
||||
FROM rendez_vous
|
||||
LEFT JOIN patient ON rendez_vous.p_id = patient.p_id
|
||||
INNER JOIN propose ON rendez_vous.rdv_id = propose.rdv_id
|
||||
INNER JOIN medecin ON propose.m_id = medecin.m_id
|
||||
INNER JOIN lieu ON lieu.l_id = rendez_vous.l_id
|
||||
|
||||
WHERE CURRENT_DATE = rdv_date AND medecin.m_id = :id
|
||||
ORDER BY rdv_date, rdv_time ASC");
|
||||
|
||||
$statement->bindParam(':id', $id);
|
||||
$statement->execute();
|
||||
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if (!empty($result)) {
|
||||
return $result;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getLieuID($pdo, $adress, $postal, $city){
|
||||
$statement = $pdo->prepare("SELECT l_id FROM lieu WHERE l_adress = :adress AND l_city = :city AND l_postal = :postal");
|
||||
$statement->bindParam(':adress', $adress);
|
||||
|
||||
@@ -1,24 +1,4 @@
|
||||
<?php
|
||||
function getRdvByPatient($pdo, $id){
|
||||
$statement = $pdo->prepare("SELECT rdv_date, rdv_time, concat(m_name, ' ', m_surname) as medecin, medecin.m_specialty, medecin.m_id, concat(p_name, ' ', p_surname) as patient, l_adress as adresse, concat(l_postal, ' ', l_city) as ville
|
||||
FROM rendez_vous
|
||||
INNER JOIN patient ON rendez_vous.p_id = patient.p_id
|
||||
INNER JOIN propose ON rendez_vous.rdv_id = propose.rdv_id
|
||||
INNER JOIN medecin ON propose.m_id = medecin.m_id
|
||||
INNER JOIN lieu on lieu.l_id = rendez_vous.l_id
|
||||
|
||||
WHERE NOW() <= (rdv_date + rdv_time) AND patient.p_id = :id
|
||||
ORDER BY rdv_date, rdv_time ASC");
|
||||
$statement->bindParam(':id', $id);
|
||||
$statement->execute();
|
||||
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if (!empty($result)) {
|
||||
return $result;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function getPastRdvByPatient($pdo, $id){
|
||||
$statement = $pdo->prepare("SELECT rdv_date, rdv_time, concat(m_name, ' ', m_surname) as medecin, medecin.m_specialty, medecin.m_id, concat(p_name, ' ', p_surname) as patient, l_adress as adresse, concat(l_postal, ' ', l_city) as ville
|
||||
@@ -41,26 +21,6 @@ function getPastRdvByPatient($pdo, $id){
|
||||
}
|
||||
}
|
||||
|
||||
function getNextRdvByPatient($pdo, $id){
|
||||
$statement = $pdo->prepare("SELECT rdv_date, rdv_time, rendez_vous.rdv_id, concat(m_name, ' ', m_surname) as medecin, medecin.m_specialty, medecin.m_id, concat(p_name, ' ', p_surname) as patient, l_adress as adresse, concat(l_postal, ' ', l_city) as ville
|
||||
FROM rendez_vous
|
||||
INNER JOIN patient ON rendez_vous.p_id = patient.p_id
|
||||
INNER JOIN propose ON rendez_vous.rdv_id = propose.rdv_id
|
||||
INNER JOIN medecin ON propose.m_id = medecin.m_id
|
||||
INNER JOIN lieu on lieu.l_id = rendez_vous.l_id
|
||||
|
||||
WHERE NOW() <= (rdv_date + rdv_time) AND patient.p_id = :id
|
||||
ORDER BY rdv_date, rdv_time ASC");
|
||||
$statement->bindParam(':id', $id);
|
||||
$statement->execute();
|
||||
$result = $statement->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (!empty($result)) {
|
||||
return $result;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function CancelRDV($pdo, $id){
|
||||
$statement = $pdo->prepare("DELETE FROM propose WHERE rdv_id = :id");
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
<?php
|
||||
class ResetPraticien{
|
||||
static function checkMail($pdo, $mail) {
|
||||
$query = $pdo->prepare("SELECT COUNT(*) as count FROM medecin WHERE m_mail = :mail");
|
||||
$query->bindParam(':mail', $mail);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($result['count'] == 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static function getIdFromMail($pdo, $mail) {
|
||||
$query = $pdo->prepare("SELECT m_id FROM medecin WHERE m_mail = :mail");
|
||||
$query->bindParam(':mail', $mail);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
return $result['m_id'];
|
||||
}
|
||||
|
||||
public static function Reset($pdo,$mail,$password) {
|
||||
if(ResetPraticien::checkMail($pdo,$mail)){
|
||||
$password = password_hash($password, PASSWORD_ARGON2ID);
|
||||
$id = ResetPraticien::getIdFromMail($pdo,$mail);
|
||||
$query = $pdo->prepare("UPDATE medecin SET m_password = :password WHERE m_id = :id");
|
||||
$query->bindParam(':password', $password);
|
||||
$query->bindParam(':id', $id);
|
||||
$query->execute();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ResetPatient{
|
||||
static function checkMail($pdo, $mail) {
|
||||
$query = $pdo->prepare("SELECT COUNT(*) as count FROM patient WHERE p_mail = :mail");
|
||||
$query->bindParam(':mail', $mail);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($result['count'] == 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static function getIdFromMail($pdo, $mail) {
|
||||
$query = $pdo->prepare("SELECT p_id FROM patient WHERE p_mail = :mail");
|
||||
$query->bindParam(':mail', $mail);
|
||||
$query->execute();
|
||||
$result = $query->fetch(PDO::FETCH_ASSOC);
|
||||
return $result['p_id'];
|
||||
}
|
||||
|
||||
public static function Reset($pdo,$mail,$password) {
|
||||
if(ResetPatient::checkMail($pdo,$mail)){
|
||||
$password = password_hash($password, PASSWORD_ARGON2ID);
|
||||
$id = ResetPatient::getIdFromMail($pdo,$mail);
|
||||
$query = $pdo->prepare("UPDATE patient SET p_password = :password WHERE p_id = :id");
|
||||
$query->bindParam(':password', $password);
|
||||
$query->bindParam(':id', $id);
|
||||
$query->execute();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
require_once '../API/src/response.php';
|
||||
// searchDoctor search doctor by name or specialty and return the result in JSON format
|
||||
function searchDoctor($pdo, $type): void
|
||||
{
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
require('../dbconnect.php');
|
||||
require('../../constants.php');
|
||||
require('../Login.php');
|
||||
require('../Rdv.php');
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
$pdo = dbConnect();
|
||||
|
||||
|
||||
if (isset($_POST['cancel_button'])) {
|
||||
$rdv_id = $_POST['rdv_id'];
|
||||
CancelRDV($pdo, $rdv_id);
|
||||
header("Location: ../../../../rdv.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if (isset($_POST['move_button'])) {
|
||||
$rdv_id = $_POST['rdv_id'];
|
||||
$MedID = $_POST['medecin_id'];
|
||||
$date = $_POST['date'];
|
||||
CancelRDV($pdo, $rdv_id);
|
||||
echo '<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title> Déplacer RDV </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"/>
|
||||
</head>';
|
||||
echo '<form method="post" action="../../../../calendrier.php">';
|
||||
echo '<input type="hidden" name="id" id="id" value="'.$MedID.'">';
|
||||
echo '<input type="hidden" name="start" id="start" value="'.date("Y-m-d").'">';
|
||||
echo '<div class="d-flex flex-row flex-wrap my-5 mx-5 gap-5 justify-content-center text-center">';
|
||||
echo '<button type="submit" class="btn btn-danger ">Sélectionner un nouveau rendez-vous</button>';
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
require('../dbconnect.php');
|
||||
require('../../constants.php');
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
$pdo = dbConnect();
|
||||
|
||||
$rdv = $_GET['id'];
|
||||
$patient = $_GET['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">';
|
||||
|
||||
?>
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
require('../dbconnect.php');
|
||||
require('../../constants.php');
|
||||
require('../Login.php');
|
||||
require('../Rdv-praticien.php');
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
$pdo = dbConnect();
|
||||
|
||||
if (isset($_POST['createRDV'])) {
|
||||
$medID = $_POST['medID'];
|
||||
$dateUse = $_POST['date'];
|
||||
$dateInter = new DateTime($dateUse);
|
||||
$date = $dateInter->format('Y-m-d');
|
||||
$timeUse = $_POST['time'];
|
||||
$timeInter = new DateTime($timeUse);
|
||||
$time = $timeInter->format('H:i:s');
|
||||
$lieu = $_POST['lieu'];
|
||||
$place = explode(", ", $lieu);
|
||||
$lieuID = getLieuID($pdo, $place[0], $place[1], $place[2]);
|
||||
|
||||
if ($medID != null && $date != null && $time != null && $lieuID != null) {
|
||||
$query = $pdo->prepare("INSERT INTO rendez_vous (rdv_date, rdv_time, l_id) VALUES (:date, :time, :lieuID )");
|
||||
$query->bindParam(':date', $date);
|
||||
$query->bindParam(':time', $time);
|
||||
$query->bindParam(':lieuID', $lieuID);
|
||||
$query->execute();
|
||||
$rdvID = $pdo->lastInsertId();
|
||||
$query = $pdo->prepare("INSERT INTO propose (m_id, rdv_id) VALUES (:medID, :rdvID)");
|
||||
$query->bindParam(':medID', $medID);
|
||||
$query->bindParam(':rdvID', $rdvID);
|
||||
$query->execute();
|
||||
}
|
||||
|
||||
header("Location: ../../../../rdv-praticien.php");
|
||||
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
session_start();
|
||||
unset($_SESSION["token"]);
|
||||
//Redirect to the rdv.php page
|
||||
echo '<meta http-equiv="refresh" content="0;URL=../../../../index.html">';
|
||||
|
||||
?>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_FILES["file"])) {
|
||||
$uploadDir = "src/uploadFiles/";
|
||||
$nameOfFile = "RDV" . $_POST['rdv_id'];
|
||||
$uploadFile = $uploadDir . $nameOfFile . ".pdf";
|
||||
|
||||
echo "Chemin du fichier de destination : " . $uploadFile . "<br>";
|
||||
|
||||
if (move_uploaded_file($_FILES["file"]["tmp_name"], $uploadFile)) {
|
||||
echo "Le fichier a été téléchargé avec succès.";
|
||||
} else {
|
||||
echo "Erreur lors du téléchargement du fichier. Code d'erreur : " . $_FILES["file"]["error"];
|
||||
error_log("Erreur lors du téléchargement du fichier: " . $_FILES["file"]["error"]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user