Ajout de gateways #37

Open
raphael.lacote wants to merge 1 commits from gateway into master

@ -7,6 +7,6 @@ $rep = __DIR__ . '/../';
$dConfig['includes']= array('controleur/Validation.php'); $dConfig['includes']= array('controleur/Validation.php');
//BD //BD
$base = ''; $base = 'mysql:host=localhost;dbname=sae_test';
$login = ''; $login = 'root';
$mdp = ''; $mdp = '';

@ -1,8 +1,12 @@
<?php <?php
namespace controleur; namespace controleur;
use config\Validation; use config\Validation;
class FrontControleur class FrontControleur
{ {
public function __construct() public function __construct()
@ -25,6 +29,9 @@ class FrontControleur
] ]
); );
include 'modeles/TestGateway.php';
$action = Validation::nettoyerString($_GET["action"] ?? ""); $action = Validation::nettoyerString($_GET["action"] ?? "");
if(in_array($action,$actions['Admin'])) { if(in_array($action,$actions['Admin'])) {
if (!isset($_SESSION["role"]) || $_SESSION["role"]!="admin") { if (!isset($_SESSION["role"]) || $_SESSION["role"]!="admin") {

@ -0,0 +1,140 @@
@import url(https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Share+Tech+Mono&display=swap);
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
a{
text-decoration: none;
}
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #2f363e;
}
.container{
position: relative;
width: 350px;
min-height: 500px;
display: flex;
justify-content: center;
align-items: center;
background: #2f363e;
box-shadow: 25px 25px 75px rgba(0,0,0,0.25),
10px 10px 70px rgba(0,0,0,0.25),
inset 5px 5px 10px rgba(0, 0, 0, 0.5),
inset 5px 5px 10px rgba(255, 255, 255, 0.2),
inset -5px -5px 15px rgba(0, 0, 0, 0.75);
border-radius: 30px;
padding: 50px;
}
form{
position: relative;
width: 100%;
}
.container h3{
color: #fff;
font-weight: 600;
font-size: 2em;
width: 100%;
text-align: center;
margin-bottom: 30px;
letter-spacing: 2px;
text-transform: uppercase;
}
.container a:link {
color: #fff;
}
.container a:visited {
color: #fff;
}
.container a:hover {
color: #fff;
}
.container a:active {
color: #fff;
}
.CadreInput
{
position: relative;
width: 100%;
margin-bottom: 20px;
}
.CadreInput span{
display: inline-block;
color: #fff;
margin-bottom: 10px;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 0.75em;
border-left: 4px solid #fff;
padding-left: 4px;
line-height: 1em;
}
.CadreInput .box{
display: flex;
}
.CadreInput .box .icon{
position: relative;
min-width: 40px;
height: 40px;
background-color: #a50b12;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
margin-right: 10px;
color: #fff;
font-size: 1.15em;
box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25),
inset 2px 2px 5px rgba(255, 255, 255, 0.25),
inset -3px -3px 5px rgba(0, 0, 0, 0.5);
}
.CadreInput .box input{
position: relative;
width: 100%;
border: none;
outline: none;
padding: 10px 20px;
border-radius: 30px;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 0.85em;
box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25),
inset 2px 2px 5px rgba(255, 255, 255, 0.25),
inset -3px -3px 5px rgba(0, 0, 0, 0.5);
}
.CadreInput .box input[type="submit"]{
background-color: #04070a;
box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25),
inset 2px 2px 5px rgba(255, 255, 255, 0.25),
inset -3px -3px 5px rgba(0, 0, 0, 0.5);
color: #fff;
cursor: pointer;
text-transform: uppercase;
letter-spacing: 2px;
font-weight: 600;
margin-top: 10px;
}
label{
color: #fff;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 0.85em;
display: flex;
align-items: center;
}
label input{
margin-right: 5px;
}
.forgot{
color: #fff;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 0.85em;
}

@ -0,0 +1,124 @@
@import url(https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Share+Tech+Mono&display=swap);
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #2f363e;
}
.container{
position: relative;
width: 350px;
min-height: 500px;
display: flex;
justify-content: center;
align-items: center;
background: #2f363e;
box-shadow: 25px 25px 75px rgba(0,0,0,0.25),
10px 10px 70px rgba(0,0,0,0.25),
inset 5px 5px 10px rgba(0, 0, 0, 0.5),
inset 5px 5px 10px rgba(255, 255, 255, 0.2),
inset -5px -5px 15px rgba(0, 0, 0, 0.75);
border-radius: 30px;
padding: 50px;
}
form{
position: relative;
width: 100%;
}
.container h3{
color: #fff;
font-weight: 600;
font-size: 2em;
width: 100%;
text-align: center;
margin-bottom: 30px;
letter-spacing: 2px;
text-transform: uppercase;
}
.CadreInput
{
position: relative;
width: 100%;
margin-bottom: 20px;
}
.CadreInput span{
display: inline-block;
color: #fff;
margin-bottom: 10px;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 0.75em;
border-left: 4px solid #fff;
padding-left: 4px;
line-height: 1em;
}
.CadreInput .box{
display: flex;
}
.CadreInput .box .icon{
position: relative;
min-width: 40px;
height: 40px;
background-color: #a50b12;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
margin-right: 10px;
color: #fff;
font-size: 1.15em;
box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25),
inset 2px 2px 5px rgba(255, 255, 255, 0.25),
inset -3px -3px 5px rgba(0, 0, 0, 0.5);
}
.CadreInput .box input{
position: relative;
width: 100%;
border: none;
outline: none;
padding: 10px 20px;
border-radius: 30px;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 0.85em;
box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25),
inset 2px 2px 5px rgba(255, 255, 255, 0.25),
inset -3px -3px 5px rgba(0, 0, 0, 0.5);
}
.CadreInput .box input[type="submit"]{
background-color: #04070a;
box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25),
inset 2px 2px 5px rgba(255, 255, 255, 0.25),
inset -3px -3px 5px rgba(0, 0, 0, 0.5);
color: #fff;
cursor: pointer;
text-transform: uppercase;
letter-spacing: 2px;
font-weight: 600;
margin-top: 10px;
}
label{
color: #fff;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 0.85em;
display: flex;
align-items: center;
}
label input{
margin-right: 5px;
}
.forgot{
color: #fff;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 0.85em;
}

@ -1,83 +1,93 @@
<?php <?php
class AlumniGateway include 'dal/Gateway/GatewayAbstrait.php';
{
private Connection $con; include 'metier/Alumni.php';
class AlumniGateway extends GatewayAbstrait{
/**
* @param $con
*/
public function __construct(Connection $con){ public function __construct(Connection $con){
$this->con = $con; parent::__construct($con);
} }
public function insert(string $email, int $id, string $motDePasse, Role $role){ public function insertAlumni(string $mail, string $mdp, string $role){
$query='INSERT INTO Alumni VALUES (:i, :e, :m, :r)'; try{
$query='INSERT INTO Alumni(mail,mdp,role) VALUES (:mail, :mdp, :role)';
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
':i' => array($id, PDO::PARAM_INT), ':mail' => array($mail, PDO::PARAM_STR),
':e' => array($email, PDO::PARAM_STR), ':mdp' => array($mdp, PDO::PARAM_STR),
':m' => array($motDePasse, PDO::PARAM_STR), ':role' => array($role, PDO::PARAM_STR)
':r' => array($role, PDO::PARAM_STR)
)); ));
} catch(PDOException $Exception){
require 'vues/erreur.html';
} catch (Exception $Exception){
require 'vues/erreur.html';
} }
public function updateEmail(int $id, string $newEmail){
$query='UPDATE Alumni SET email=:new WHERE id=:i';
$this->con->executeQuery($query, array(
':i' => array($id, PDO::PARAM_INT),
':new' => array($newEmail, PDO::PARAM_STR)
));
} }
public function updateMotDePasse(int $id, string $password){ public function supprimeAlumni(string $id){
$query='UPDATE Alumni SET motDePasse=:new WHERE id=:i'; try{
$query='DELETE FROM Alumni WHERE id = (:id)';
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
':i' => array($id, PDO::PARAM_INT), ':id' => array($id, PDO::PARAM_STR),
':new' => array($password, PDO::PARAM_STR)
)); ));
} catch(PDOException $Exception){
require 'vues/erreur.html';
} catch (Exception $Exception){
require 'vues/erreur.html';
} }
public function updateRole(int $id, Role $newRole){
$query='UPDATE Alumni SET role=:new WHERE id=:i';
$this->con->executeQuery($query, array(
':i' => array($id, PDO::PARAM_INT),
':new' => array($newRole, PDO::PARAM_STR)
));
} }
public function delete(int $id){ public function modifieMdp(string $id,string $newMdp){
$query='DELETE FROM Alumni WHERE id=:i'; try{
$query='UPDATE ALumni SET mdp=(:mdp) WHERE id=(:id)';
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
':i' => array($id, PDO::PARAM_INT) ':id' => array($id, PDO::PARAM_STR),
':mdp' => array($newMdp, PDO::PARAM_STR),
)); ));
} catch(PDOException $Exception){
require 'vues/erreur.html';
} catch (Exception $Exception){
require 'vues/erreur.html';
} }
public function findById(int $id){
$query = 'SELECT * FROM Alumni WHERE id=:i';
$this->con->executeQuery($query, array(
':i' => array($id, PDO::PARAM_INT)
));
$res=$this->con->getResults();
return new Alumni($res[0]['mail'],$res[0]['id'],$res[0]['mdp'],$res[0]['role']);
} }
public function findByEmail(string $email){ public function recupereAlumni(string $id){
$query='SELECT * FROM Alumni WHERE email=:e'; try{
$query='SELECT * FROM Alumni WHERE id=(:id)';
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
':e' => array($email, PDO::PARAM_STR), ':id' => array($id, PDO::PARAM_STR),
)); ));
$res=$this->con->getResults(); $res = $this->con->getResults();
return new Alumni($res[0]['mail'],$res[0]['id'],$res[0]['mdp'],$res[0]['role']); $a=new Alumni($res['id'],$res['mail'],$res['mdp'],$res['role']);
return $a;
} catch(PDOException $Exception){
require 'vues/erreur.html';
} catch (Exception $Exception){
require 'vues/erreur.html';
}
} }
public function getAll(){ public function recupereDataAlumni(){
try{
$query='SELECT * FROM Alumni'; $query='SELECT * FROM Alumni';
$this->con->executeQuery($query); $this->con->executeQuery($query);
$res=$this->con->getResults(); $res = $this->con->getResults();
$array=[]; $AlumniArray = array();
foreach($res as $r){ foreach($res as $v){
$array[]=new Alumni($r['mail'],$r['id'],$r['mdp'],$r['role']); $a=new Alumni($v['id'],$v['mail'],$v['mdp'],$v['role']);
array_push($AlumniArray,$a);
} }
return $array; return $AlumniArray;
} catch(PDOException $Exception){
require 'vues/erreur.html';
} catch (Exception $Exception){
require 'vues/erreur.html';
} }
}
} }
?>

@ -0,0 +1,82 @@
<?php
class CompteGateway
{
private Connection $con;
/**
* @param $con
*/
public function __construct(Connection $con){
$this->con = $con;
}
public function insert(string $email, string $pseudo, string $motDePasse){
$query='INSERT INTO Compte VALUES (:e, :p, :m)';
$this->con->executeQuery($query, array(
':e' => array($email, PDO::PARAM_STR),
':p' => array($pseudo, PDO::PARAM_STR),
':m' => array($motDePasse, PDO::PARAM_STR)
));
}
public function updateEmail(string $email, string $newEmail){
$query='UPDATE Compte SET email=:new WHERE email=:e';
$this->con->executeQuery($query, array(
':e' => array($email, PDO::PARAM_STR),
':new' => array($newEmail, PDO::PARAM_STR)
));
}
public function updatePseudo(string $email, string $pseudo){
$query='UPDATE Compte SET pseudo=:new WHERE email=:e';
$this->con->executeQuery($query, array(
':e' => array($email, PDO::PARAM_STR),
':new' => array($pseudo, PDO::PARAM_STR)
));
}
public function updateMotDePasse(string $email, string $password){
$query='UPDATE Compte SET motDePasse=:new WHERE email=:e';
$this->con->executeQuery($query, array(
':e' => array($email, PDO::PARAM_STR),
':new' => array($password, PDO::PARAM_STR)
));
}
public function delete(string $email){
$query='DELETE FROM Compte WHERE email=:e';
$this->con->executeQuery($query, array(
':e' => array($email, PDO::PARAM_STR)
));
}
public function findByPseudo(string $pseudo){
$query = 'SELECT * FROM Compte WHERE pseudo=:p';
$this->con->executeQuery($query, array(
':p' => array($pseudo, PDO::PARAM_STR)
));
$res=$this->con->getResults();
return new Compte($res[0]['email'],$res[0]['pseudo'],$res[0]['motDePasse']);
}
public function findByEmail(string $email){
$query='SELECT * FROM Compte WHERE email=:e';
$this->con->executeQuery($query, array(
':e' => array($email, PDO::PARAM_STR),
));
$res=$this->con->getResults();
return new Compte($res[0]['email'],$res[0]['pseudo'],$res[0]['motDePasse']);
}
public function getAll(){
$query='SELECT * FROM Compte';
$this->con->executeQuery($query);
$res=$this->con->getResults();
$array=[];
foreach($res as $r){
$array[]=new Compte($r['email'],$r['pseudo'],$r['motDePasse']);
}
return $array;
}
}

@ -0,0 +1,12 @@
<?php
abstract class GatewayAbstrait{
protected Connection $con;
public function __construct(Connection $con){
$this->con = $con;
}
}
?>

@ -0,0 +1,92 @@
<?php
include 'dal/Gateway/GatewayAbstrait.php';
class ProfilGateway extends GatewayAbstrait{
public function __construct(Connection $con){
$this->con = $con;
}
public function insererProfil(string $email,string $alumni,string $cv, string $nom,string $prenom,string $linkedin,string $github,string $portfolio){
try{
$query='INSERT INTO Profil(id,alumni,email,cv,nom,prenom,linkedin_url,github_url,portfolio_url) VALUES (:id,:alumni,:email,:cv,:nom,:prenom,:linkedin_url,github_url,portfolio_url)';
$this->con->executeQuery($query, array(
':id' => array($id, PDO::PARAM_STR),
':alumni' => array($alumni, PDO::PARAM_STR),
':cv' => array($cv, PDO::PARAM_STR),
':nom' => array($nom, PDO::PARAM_STR),
':prenom' => array($prenom, PDO::PARAM_STR),
':linkedin_url' => array($linkedin, PDO::PARAM_STR),
':github_url' => array($github, PDO::PARAM_STR),
':portfolio_url' => array($portfolio, PDO::PARAM_STR),
':email' => array($email, PDO::PARAM_STR)
));
} catch(PDOException $Exception){
require 'vues/erreur.html';
} catch (Exception $Exception){
require 'vues/erreur.html';
}
}
public function supprimeAlumni(string $id){
try{
$query='DELETE FROM Profil WHERE id = (:id)';
$this->con->executeQuery($query, array(
':id' => array($id, PDO::PARAM_STR),
));
} catch(PDOException $Exception){
require 'vues/erreur.html';
} catch (Exception $Exception){
require 'vues/erreur.html';
}
}
public function editAlumni(string $id,string $email,string $alumni,string $cv, string $nom,string $prenom,string $linkedin,string $github,string $portfolio){
try{
supprimeAlumni($id);
insererProfil($email,$alumni,$cv,$nom,$prenom,$linkedin,$github,$portfolio);
} catch(PDOException $Exception){
require 'vues/erreur.html';
} catch (Exception $Exception){
require 'vues/erreur.html';
}
}
public function recupereProfil(string $id){
try{
$query='SELECT * FROM Profil WHERE id=(:id)';
$this->con->executeQuery($query, array(
':id' => array($id, PDO::PARAM_STR),
));
$res = $this->con->getResults();
return new Profil($res['id'],$res['alumni'],$res['email'],$res['cv'],$res['nom'],$res['prenom'],$res['linkedin_url'],$res['github_url'],$res['portfolio_url']);
} catch(PDOException $Exception){
require 'vues/erreur.html';
} catch (Exception $Exception){
require 'vues/erreur.html';
}
}
public function recupereDataProfil(){
try{
$query='SELECT * FROM Alumni';
$this->con->executeQuery($query);
$res = $this->con->getResults();
$AlumniArray = array();
foreach($res as $v){
$a=new Profil($v['id'],$v['alumni'],$v['email'],$v['cv'],$v['nom'],$v['prenom'],$v['linkedin_url'],$v['github_url'],$v['portfolio_url']);
array_push($AlumniArray,$a);
}
return $AlumniArray;
} catch(PDOException $Exception){
require 'vues/erreur.html';
} catch (Exception $Exception){
require 'vues/erreur.html';
}
}
}
?>

@ -1,74 +1,19 @@
<?php <?php
enum Role
{
case Admin;
case Moderateur;
case Utilisateur;
}
class Alumni{ class Alumni{
/** private string $id;
* @var int Identifiant private string $mail;
*/ private string $mdp;
private int $id; private string $role;
/**
* @var string Email
*/
private string $email;
/**
* @var string Mot de passe
*/
private string $motDePasse;
/**
* @var Role Role
*/
private Role $role;
/**
* @param int $id
* @param string $email
* @param string $motDePasse
* @param Role $role
*/
public function __construct(int $id, string $email, string $motDePasse, Role $role)
{
$this->id = $id;
$this->email = $email;
$this->motDePasse = $motDePasse;
$this->role = $role;
}
/** public function __construct($id,$mail,$mdp,$role){
* @return string $this->id=$id;
*/ $this->mail=$mail;
public function getId() : string $this->mdp=$mdp;
{ $this->role=$role;
return $this->id;
}
/**
* @return string
*/
public function getEmail() : string
{
return $this->email;
} }
}
/**
* @return string
*/
public function getMotDePasse(): string
{
return $this->motDePasse;
}
public function getRole(): Role ?>
{
return $this->role;
}
}

@ -1,58 +0,0 @@
<?php
class Article
{
/**
* @var int Identifiant
*/
private int $id;
/**
* @var Alumni Auteur
*/
private Alumni $auteur;
/**
* @var string Sous titre de l'article
*/
private string $sousTitre;
/**
* @var string Description de l'article
*/
private string $description;
/**
* @param int $id
* @param Alumni $auteur
* @param string $sousTitre
* @param string $description
*/
public function __construct(int $id, Alumni $auteur, string $sousTitre, string $description)
{
$this->id = $id;
$this->auteur = $auteur;
$this->sousTitre = $sousTitre;
$this->description = $description;
}
public function getId(): int
{
return $this->id;
}
public function getAuteur(): Alumni
{
return $this->auteur;
}
public function getSousTitre(): string
{
return $this->sousTitre;
}
public function getDescription(): string
{
return $this->description;
}
}

@ -0,0 +1,53 @@
<?php
class Compte{
/**
* @var string Pseudo
*/
private string $pseudo;
/**
* @var string Email
*/
private string $email;
/**
* @var string Mot de passe
*/
private string $motDePasse;
/**
* @param string $pseudo
* @param string $email
* @param string $motDePasse
*/
public function __construct(string $pseudo, string $email, string $motDePasse)
{
$this->pseudo = $pseudo;
$this->email = $email;
$this->motDePasse = $motDePasse;
}
/**
* @return string
*/
public function getPseudonyme() : string
{
return $this->pseudo;
}
/**
* @return string
*/
public function getEmail() : string
{
return $this->email;
}
/**
* @return string
*/
public function getMotDePasse(): string
{
return $this->motDePasse;
}
}

@ -3,24 +3,19 @@
class Evenement class Evenement
{ {
/** /**
* @var int Identifiant * @var string Nom Evènement
*/ */
private int $id; private string $nameEvent;
/** /**
* @var string Nom Evenement * @var string date Evenement
*/
private string $nom;
/**
* @var string Date de l'evenement
*/ */
private string $date; private string $date;
/** /**
* @var Alumni Organisateur * @var Compte Organisateur
*/ */
private Alumni $organisateur; private Compte $organisator;
/** /**
* @var array Liste des Participants * @var array Liste des Participants
@ -28,46 +23,26 @@ class Evenement
private array $participants; private array $participants;
/** /**
* @var int Nombre maximal d'inscrits * @param string $nameEvent
*/
private int $nbInscriptionMax;
/**
* @var string Url de l'image
*/
private string $imageUrl;
/**
* @param int $id
* @param string $nom
* @param string $date * @param string $date
* @param Alumni $organisateur * @param Compte $organisator
* @param array $participants * @param array $participants
* @param int $nbInscriptionMax
* @param string $imageUrl
*/ */
public function __construct(int $id, string $nom, string $date, Alumni $organisateur, array $participants, int $nbInscriptionMax, string $imageUrl) public function __construct(string $nameEvent,string $date,Compte $organisator,
array $participants)
{ {
$this->id = $id; $this->nameEvent = $nameEvent;
$this->nom = $nom;
$this->date = $date; $this->date = $date;
$this->organisateur = $organisateur; $this->organisator = $organisator;
$this->participants = $participants; $this->participants = $participants;
$this->nbInscriptionMax = $nbInscriptionMax;
$this->imageUrl = $imageUrl;
} }
public function getId(): int public function getNameEvent() : string
{ {
return $this->id; return $this->nameEvent;
} }
public function getNom() : string public function getDateEvent() : string
{
return $this->nom;
}
public function getDate() : string
{ {
return $this->date; return $this->date;
} }
@ -77,18 +52,5 @@ class Evenement
return $this->participants; return $this->participants;
} }
public function getOrganisateur(): Alumni
{
return $this->organisateur;
}
public function getNbInscriptionMax(): int
{
return $this->nbInscriptionMax;
}
public function getImageUrl(): string
{
return $this->imageUrl;
}
} }

@ -1,94 +0,0 @@
<?php
class Experience
{
/**
* @var int Identifiant
*/
private int $id;
/**
* @var Profil profil
*/
private Profil $profil;
/**
* @var string Intitule
*/
private string $intitule;
/**
* @var string Date début
*/
private string $dateDebut;
/**
* @var string Date fin
*/
private string $dateFin;
/**
* @var string Nom entreprise
*/
private string $nomEntreprise;
/**
* @var bool Travail Actuel
*/
private bool $travailActuel;
/**
* @param int $id
* @param Profil $profil
* @param string $intitule
* @param string $dateDebut
* @param string $dateFin
* @param string $nomEntreprise
* @param bool $travailActuel
*/
public function __construct(int $id, Profil $profil, string $intitule, string $dateDebut, string $dateFin, string $nomEntreprise, bool $travailActuel)
{
$this->id = $id;
$this->profil = $profil;
$this->intitule = $intitule;
$this->dateDebut = $dateDebut;
$this->dateFin = $dateFin;
$this->nomEntreprise = $nomEntreprise;
$this->travailActuel = $travailActuel;
}
public function getId(): int
{
return $this->id;
}
public function getProfil(): Profil
{
return $this->profil;
}
public function getIntitule(): string
{
return $this->intitule;
}
public function getDateDebut(): string
{
return $this->dateDebut;
}
public function getDateFin(): string
{
return $this->dateFin;
}
public function getNomEntreprise(): string
{
return $this->nomEntreprise;
}
public function isTravailActuel(): bool
{
return $this->travailActuel;
}
}

@ -1,94 +0,0 @@
<?php
class Formation
{
/**
* @var int Identifiant
*/
private int $id;
/**
* @var Profil profil
*/
private Profil $profil;
/**
* @var string Nom
*/
private string $nom;
/**
* @var string Ville
*/
private string $ville;
/**
* @var string Date début
*/
private string $dateDebut;
/**
* @var string Date fin
*/
private string $dateFin;
/**
* @var bool Formation Actuelle
*/
private bool $formationActuelle;
/**
* @param int $id
* @param Profil $profil
* @param string $nom
* @param string $ville
* @param string $dateDebut
* @param string $dateFin
* @param bool $formationActuelle
*/
public function __construct(int $id, Profil $profil, string $nom, string $ville, string $dateDebut, string $dateFin, bool $formationActuelle)
{
$this->id = $id;
$this->profil = $profil;
$this->nom = $nom;
$this->ville = $ville;
$this->dateDebut = $dateDebut;
$this->dateFin = $dateFin;
$this->formationActuelle = $formationActuelle;
}
public function getId(): int
{
return $this->id;
}
public function getProfil(): Profil
{
return $this->profil;
}
public function getNom(): string
{
return $this->nom;
}
public function getVille(): string
{
return $this->ville;
}
public function getDateDebut(): string
{
return $this->dateDebut;
}
public function getDateFin(): string
{
return $this->dateFin;
}
public function isFormationActuelle(): bool
{
return $this->formationActuelle;
}
}

@ -1,213 +1,71 @@
<?php <?php
enum TypeContrat
{
case CDI;
case CDD;
case Alternance;
case Stage;
}
enum ProfilRecherche
{
case Junior;
case Senior;
case Indifferent;
}
enum NiveauEtudes: string
{
case Bac2 = "Bac+2";
case Bac3 = "Bac+3";
case Bac5 = "Bac+5";
case Indifferent = "Indifferent";
}
class Offre class Offre
{ {
/**
* @var int Identifiant
*/
private int $id;
/**
* @var Alumni Offreur
*/
private Alumni $offreur;
/** /**
* @var string intitulé de l'offre * @var string intitulé de l'offre
*/ */
private string $nom; private string $name;
/**
* @var string Description de l'offre
*/
private string $description;
/**
* @var string Url de l'image
*/
private string $imageUrl;
/**
* @var TypeContrat Type de contrat
*/
private TypeContrat $typeContrat;
/**
* @var string Ville
*/
private string $ville;
/** /**
* @var string Entreprise de l'offre * @var string Entreprise de l'offre
*/ */
private string $entreprise; private string $company;
/**
* @var string Descriptif du poste
*/
private string $descriptifPoste;
/**
* @var ProfilRecherche Profil recherché
*/
private ProfilRecherche $profil;
/**
* @var string Experience
*/
private string $experience;
/** /**
* @var NiveauEtudes Niveau d'études * @var Compte recruteur
*/ */
private NiveauEtudes $niveauEtudes; private Compte $recruiter;
/** /**
* @var string Email de contact * @var string description de l'offre
*/ */
private string $mailContact; private string $description;
/**
* @var string Numero
*/
private string $numero;
/**
* @var string Url du site
*/
private string $siteUrl;
/** public function __construct(string $offername,string $offercompany,
* @param int $id string $offermanager,string $description)
* @param Alumni $offreur
* @param string $nom
* @param string $description
* @param string $imageUrl
* @param TypeContrat $typeContrat
* @param string $ville
* @param string $entreprise
* @param string $descriptifPoste
* @param Profil $profil
* @param string $experience
* @param NiveauEtudes $niveauEtudes
* @param string $mailContact
* @param string $numero
* @param string $siteUrl
*/
public function __construct(int $id, Alumni $offreur, string $nom, string $description, string $imageUrl, TypeContrat $typeContrat, string $ville, string $entreprise, string $descriptifPoste, Profil $profil, string $experience, NiveauEtudes $niveauEtudes, string $mailContact, string $numero, string $siteUrl)
{ {
$this->id = $id; $this->name = $offername;
$this->offreur = $offreur; $this->company = $offercompany;
$this->nom = $nom; $this->recruiter = $offermanager;
$this->description = $description; $this->description = $description;
$this->imageUrl = $imageUrl;
$this->typeContrat = $typeContrat;
$this->ville = $ville;
$this->entreprise = $entreprise;
$this->descriptifPoste = $descriptifPoste;
$this->profil = $profil;
$this->experience = $experience;
$this->niveauEtudes = $niveauEtudes;
$this->mailContact = $mailContact;
$this->numero = $numero;
$this->siteUrl = $siteUrl;
} }
public function getId(): int /**
* @return string
*/
public function getName(): string
{ {
return $this->id; return $this->name;
} }
public function getOffreur(): Alumni /**
* @return string
*/
public function getCompany(): string
{ {
return $this->offreur; return $this->company;
} }
public function getNom(): string /**
* @return Compte|string
*/
public function getRecruiter(): Compte|string
{ {
return $this->nom; return $this->recruiter;
} }
/**
* @return string
*/
public function getDescription(): string public function getDescription(): string
{ {
return $this->description; return $this->description;
} }
public function getImageUrl(): string
{
return $this->imageUrl;
}
public function getTypeContrat(): TypeContrat
{
return $this->typeContrat;
}
public function getVille(): string
{
return $this->ville;
}
public function getEntreprise(): string
{
return $this->entreprise;
}
public function getDescriptifPoste(): string
{
return $this->descriptifPoste;
}
public function getProfil(): Profil
{
return $this->profil;
}
public function getExperience(): string
{
return $this->experience;
}
public function getNiveauEtudes(): NiveauEtudes
{
return $this->niveauEtudes;
}
public function getMailContact(): string
{
return $this->mailContact;
}
public function getNumero(): string
{
return $this->numero;
}
public function getSiteUrl(): string
{
return $this->siteUrl;
}
} }

@ -1,105 +1,28 @@
<?php <?php
class Profil
{
/**
* @var int Identifiant
*/
private int $id;
/** class Alumni{
* @var Alumni Compte
*/
private Alumni $alumni;
/** private string $id;
* @var string CV private string $alumni;
*/ private string $email;
private string $cv; private string $cv;
/**
* @var string Nom
*/
private string $nom; private string $nom;
/**
* @var string Prenom
*/
private string $prenom; private string $prenom;
private string $linkedin;
/** private string $github;
* @var string Url linkedin private string $portfolio;
*/
private string $linkedinUrl; public function __construct($id,$alumni,$email,$cv,$prenom,$linkedin,$github,$portfolio){
$this->id=$id;
/** $this->alumni=$alumni;
* @var string Url github $this->email=$email;
*/ $this->cv=$cv;
private string $githubUrl; $this->nom=$nom;
$this->prenom=$prenom;
/** $this->linkedin=$linkedin;
* @var string Url du portfolio $this->github=$github;
*/ $this->portfolio=$portfolio;
private string $portfolioUrl;
/**
* @param int $id
* @param Alumni $alumni
* @param string $cv
* @param string $nom
* @param string $prenom
* @param string $linkedinUrl
* @param string $githubUrl
* @param string $portfolioUrl
*/
public function __construct(int $id, Alumni $alumni, string $cv, string $nom, string $prenom, string $linkedinUrl, string $githubUrl, string $portfolioUrl)
{
$this->id = $id;
$this->alumni = $alumni;
$this->cv = $cv;
$this->nom = $nom;
$this->prenom = $prenom;
$this->linkedinUrl = $linkedinUrl;
$this->githubUrl = $githubUrl;
$this->portfolioUrl = $portfolioUrl;
}
public function getId(): int
{
return $this->id;
}
public function getAlumni(): Alumni
{
return $this->alumni;
}
public function getCv(): string
{
return $this->cv;
}
public function getNom(): string
{
return $this->nom;
}
public function getPrenom(): string
{
return $this->prenom;
}
public function getLinkedinUrl(): string
{
return $this->linkedinUrl;
}
public function getGithubUrl(): string
{
return $this->githubUrl;
}
public function getPortfolioUrl(): string
{
return $this->portfolioUrl;
} }
} }
?>

@ -6,9 +6,9 @@ class AdminModele extends MembreModele
{ {
/** /**
* @description supprimer un compte * @description supprimer un compte
* @param \Alumni $account compte à supprimer * @param \Compte $account compte à supprimer
*/ */
public function deleteAccount(\Alumni $account) public function deleteAccount(\Compte $account)
{ {
// TO DO // TO DO
} }

@ -0,0 +1,26 @@
<?php
/*include 'dal/gateway/Random.php';
$r=new Random(9);*/
include 'dal/Connection.php';
include 'dal/gateway/AlumniGateway.php';
include 'dal/gateway/ProfilGateway.php';
include 'config/config.php';
$co=new Connection($base,$login,$mdp);
$gat = new ProfilGateway($co);
//$gat->insertAlumni('faa','fua','fia');
//$gat->deleteAlumni(13);
/*$gat->modifieMdp(10,'Bwaaa');
*/
//$gat->recupereAlumni(10);
//$gat->recupereDataAlumni();
?>

@ -17,12 +17,12 @@ class UtilisateurModele
* @description se connecter * @description se connecter
* @param string email * @param string email
* @param string hash * @param string hash
* @return \Alumni * @return \Compte
*/ */
public function Login(string $email,string $hash) : \Alumni public function Login(string $email,string $hash) : \Compte
{ {
// TO DO // TO DO
return new \Alumni(null,null,null); return new \Compte(null,null,null);
} }
/** /**
@ -30,9 +30,9 @@ class UtilisateurModele
* @param string email * @param string email
* @param string hash * @param string hash
* @param string $pseudo * @param string $pseudo
* @return \Alumni chargé * @return \Compte chargé
*/ */
public function signIn(string $email,string $pseudo,string $hash) : \Alumni public function signIn(string $email,string $pseudo,string $hash) : \Compte
{ {
// TO DO // TO DO
return new Compte(null,null,null); return new Compte(null,null,null);

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Alica - Connection</title>
<link rel="stylesheet" type="text/css" href="css/connection.css">
</head>
<body>
<div class="container">
<form action="" method="POST">
<h3>S'identifier</h3>
<div class="CadreInput">
<span>Identifiant</span>
<div class="box">
<div class="icon"><ion-icon name="person"></ion-icon>
</div>
<input type="text" name="username" required>
</div>
</div>
<div class="CadreInput">
<span>Mot de passe</span>
<div class="box">
<div class="icon"><ion-icon name="lock-closed"></ion-icon>
</div>
<input type="password" name="password" required>
</div>
</div>
<label>
<input type="checkbox">Se souvenir de moi
</label>
<div class="CadreInput">
<div class="box">
<div class="icon"></div>
<input type="submit" value="S'identifier">
</div>
</div>
<a href="#" class="forgot">Mot de passe oublié</a>
</form>
<form action="index.php?action=inscription" method="POST">
<input type="submit" value="S'inscrire">
</form>
</div>
<script type="module" src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>
</body>
</html>
Loading…
Cancel
Save