# Conflicts: # project/src/config/Validation.php # project/src/config/config.php # project/src/model/gateways/ScientifiqueGateway.php # project/src/model/mdl/MdlScientifique.phppull/7/head
commit
5e376620e6
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
class UtilisateurConnecteGateway extends JoueurGateway {
|
||||
|
||||
function __construct(Connection $con) {
|
||||
$this->con = $con;
|
||||
}
|
||||
|
||||
public function login(string $email, string $password): bool
|
||||
{
|
||||
$sql = "SELECT * FROM Utilisateur WHERE email=:email";
|
||||
$this->con->executeQuery($sql, array(
|
||||
':email' => array($email, \PDO::PARAM_STR)
|
||||
));
|
||||
|
||||
$result = $this->con->getOneResult();
|
||||
|
||||
if (!empty($result)) {
|
||||
return password_verify($password,$result['password']);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="css/bootstrap.min.css">
|
||||
<style>
|
||||
body {
|
||||
margin: 10px;
|
||||
}
|
||||
</style>
|
||||
<title>Liste des scientifiques</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Voici la liste des scientifiques dans la base de données :</h1>
|
||||
<p align="right"><a href="logout">{{dVue.pseudo}}</a></p>
|
||||
|
||||
<br><br><br><br>
|
||||
|
||||
<center>
|
||||
<a href="../ajouterScientifiques">Ajouter un(e) scientifique</a>
|
||||
{% for scientifique in dVue.listeScientifiques %}
|
||||
<div>
|
||||
<h2>{{ scientifique.getNom() }} {{ scientifique.getPrenom() }}</h2>
|
||||
<p>Sexe : {{ scientifique.getSexe() }}</p>
|
||||
<p>Né(e) le {{ scientifique.getDateNess() }}</p>
|
||||
<p>Thematique : {{ scientifique.getThematique() }}</p>
|
||||
<p>Difficulté à trouver : {{ scientifique.getDifficulte() }}</p>
|
||||
<a href='../ajouterScientifiques?id={{scientifique.getId()}}'>Modifier</a>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
{% endfor %}
|
||||
<div>
|
||||
<a href="{{ dVue.pagePrec }}"><</a>
|
||||
<a href="1">1</a>
|
||||
<p>{{ dVue.page }}</p>
|
||||
<a href="{{ dVue.pageMax }}">1</a>
|
||||
<a href="{{ dVue.pageSuiv }}">></a>
|
||||
</div>
|
||||
</center>
|
||||
|
||||
<script src="js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue