diff --git a/php/.htaccess b/php/.htaccess new file mode 100644 index 0000000..095bf2a --- /dev/null +++ b/php/.htaccess @@ -0,0 +1,6 @@ + + RewriteEngine On + RewriteBase /php/public/ + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php [QSA,L] + diff --git a/php/index.php b/php/index.php deleted file mode 100755 index 242d196..0000000 --- a/php/index.php +++ /dev/null @@ -1,16 +0,0 @@ - false, - 'debug' => true -]); - -$cont = new App\controleur\FrontControleur(); diff --git a/php/css/.DS_Store b/php/public/css/.DS_Store similarity index 100% rename from php/css/.DS_Store rename to php/public/css/.DS_Store diff --git a/php/css/accueil.css b/php/public/css/accueil.css similarity index 100% rename from php/css/accueil.css rename to php/public/css/accueil.css diff --git a/php/css/connexion.css b/php/public/css/connexion.css similarity index 100% rename from php/css/connexion.css rename to php/public/css/connexion.css diff --git a/php/css/erreur.css b/php/public/css/erreur.css similarity index 100% rename from php/css/erreur.css rename to php/public/css/erreur.css diff --git a/php/css/inscription.css b/php/public/css/inscription.css similarity index 100% rename from php/css/inscription.css rename to php/public/css/inscription.css diff --git a/php/public/index.php b/php/public/index.php new file mode 100755 index 0000000..8a015ce --- /dev/null +++ b/php/public/index.php @@ -0,0 +1,16 @@ + false, + 'debug' => true +]); + +$cont = new \App\controleur\FrontControleur(); \ No newline at end of file diff --git a/php/src/Autoloader.php b/php/src/Autoloader.php new file mode 100644 index 0000000..7d6ac76 --- /dev/null +++ b/php/src/Autoloader.php @@ -0,0 +1,17 @@ +inscription($email, $motDePasse); // Si l'inscription a réussi, redirigez l'utilisateur vers une page de confirmation // Vous pouvez également gérer les erreurs ici en cas d'échec de l'inscription - if ($nouvelUtilisateur instanceof \App\metier\Alumni) { + if ($nouvelUtilisateur instanceof \App\modele\Alumni) { // L'inscription a réussi, redirigez l'utilisateur vers une page de confirmation // par exemple : header('Location: index.php?action=inscription_success'); diff --git a/php/src/dal/gateway/AlumniGateway.php b/php/src/gateway/AlumniGateway.php similarity index 85% rename from php/src/dal/gateway/AlumniGateway.php rename to php/src/gateway/AlumniGateway.php index 7819d4b..1a00ff4 100644 --- a/php/src/dal/gateway/AlumniGateway.php +++ b/php/src/gateway/AlumniGateway.php @@ -1,26 +1,28 @@ con = $con; } public function insert(string $email, string $motDePasse, string $role){ - $query='INSERT INTO Alumni VALUES (:e, :m, :r)'; + $query = 'INSERT INTO Alumni (mail, mdp, role) VALUES (:mail, :mdp, :role)'; return $this->con->executeQuery($query, array( - ':e' => array($email, PDO::PARAM_STR), - ':m' => array($motDePasse, PDO::PARAM_STR), - ':r' => array($role, PDO::PARAM_STR) + ':mail' => array($email, PDO::PARAM_STR), + ':mdp' => array($motDePasse, PDO::PARAM_STR), + ':role' => array($role, PDO::PARAM_STR) )); } + public function updateEmail(int $id, string $newEmail){ $query='UPDATE Alumni SET email=:new WHERE id=:i'; $this->con->executeQuery($query, array( diff --git a/php/src/dal/Connection.php b/php/src/gateway/Connection.php similarity index 97% rename from php/src/dal/Connection.php rename to php/src/gateway/Connection.php index e8c1e83..1389c2a 100755 --- a/php/src/dal/Connection.php +++ b/php/src/gateway/Connection.php @@ -1,6 +1,7 @@ con = $con; } diff --git a/php/src/dal/gateway/OffreGateway.php b/php/src/gateway/OffreGateway.php similarity index 64% rename from php/src/dal/gateway/OffreGateway.php rename to php/src/gateway/OffreGateway.php index d783846..85e4aab 100755 --- a/php/src/dal/gateway/OffreGateway.php +++ b/php/src/gateway/OffreGateway.php @@ -1,13 +1,13 @@ con = $con; } diff --git a/php/src/models/AdminModele.php b/php/src/modele/AdminModele.php similarity index 90% rename from php/src/models/AdminModele.php rename to php/src/modele/AdminModele.php index 21bdcdb..5cc4474 100755 --- a/php/src/models/AdminModele.php +++ b/php/src/modele/AdminModele.php @@ -1,9 +1,6 @@ id = $id; $this->offreur = $offreur; @@ -161,7 +162,7 @@ class Offre return $this->imageUrl; } - public function getTypeContrat(): TypeContrat + public function getTypeContrat(): \App\metier\TypeContrat { return $this->typeContrat; } @@ -191,7 +192,7 @@ class Offre return $this->experience; } - public function getNiveauEtudes(): NiveauEtudes + public function getNiveauEtudes(): \App\metier\NiveauEtudes { return $this->niveauEtudes; } diff --git a/php/src/metier/Profil.php b/php/src/modele/Profil.php similarity index 98% rename from php/src/metier/Profil.php rename to php/src/modele/Profil.php index a05b32e..69e5bc5 100644 --- a/php/src/metier/Profil.php +++ b/php/src/modele/Profil.php @@ -1,5 +1,6 @@ insert($email, $hashpassword, $role)) { // L'insertion a réussi, retournez le nouvel utilisateur - $nouvelUtilisateur = new \App\metier\Alumni($email, $hashpassword, $role); + $nouvelUtilisateur = new \App\modele\Alumni($email, $hashpassword, $role); return $nouvelUtilisateur; } else { // L'insertion a échoué, renvoyez un utilisateur vide pour indiquer l'échec - return new \App\metier\Alumni(null, null, null); + return new \App\modele\Alumni(null, null, null); } } } diff --git a/php/src/models/ModerateurControleur.php b/php/src/models/ModerateurControleur.php deleted file mode 100755 index 608bf52..0000000 --- a/php/src/models/ModerateurControleur.php +++ /dev/null @@ -1,8 +0,0 @@ - - + Alica - Accueil @@ -15,7 +15,7 @@

Vous pouvez aussi consulter les articles

Vous pouvez aussi consulter les annonces

Connexion :

-
+
diff --git a/php/vues/connexion.html b/php/templates/connexion.html similarity index 90% rename from php/vues/connexion.html rename to php/templates/connexion.html index d3508c5..2dd061a 100755 --- a/php/vues/connexion.html +++ b/php/templates/connexion.html @@ -4,7 +4,7 @@ Alica - Connexion - +
@@ -37,7 +37,7 @@
-
+
diff --git a/php/vues/erreur.html b/php/templates/erreur.html similarity index 74% rename from php/vues/erreur.html rename to php/templates/erreur.html index c3fcde6..740cace 100755 --- a/php/vues/erreur.html +++ b/php/templates/erreur.html @@ -3,7 +3,7 @@ - + Alica - Erreur @@ -14,7 +14,7 @@

{{value}}

{% endfor %} {% endif %} -
+
diff --git a/php/vues/inscription.html b/php/templates/inscription.html similarity index 91% rename from php/vues/inscription.html rename to php/templates/inscription.html index cfee55a..b86bcea 100755 --- a/php/vues/inscription.html +++ b/php/templates/inscription.html @@ -4,7 +4,7 @@ Alica - Inscription - +
@@ -45,7 +45,7 @@
-
+
diff --git a/php/vendor/composer/installed.php b/php/vendor/composer/installed.php index 9500923..295225e 100644 --- a/php/vendor/composer/installed.php +++ b/php/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '68bdbc2afe49996b3ceec196c42f5e25b3edec96', + 'reference' => 'ca79f102cff2316dd789a28ba980fe14643acaa0', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '68bdbc2afe49996b3ceec196c42f5e25b3edec96', + 'reference' => 'ca79f102cff2316dd789a28ba980fe14643acaa0', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), diff --git a/php/vues/.DS_Store b/php/vues/.DS_Store deleted file mode 100755 index 5008ddf..0000000 Binary files a/php/vues/.DS_Store and /dev/null differ