diff --git a/.DS_Store b/.DS_Store
index de363c1..b4acdff 100755
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/php/.DS_Store b/php/.DS_Store
index e471992..76e13f1 100755
Binary files a/php/.DS_Store and b/php/.DS_Store differ
diff --git a/php/public/uploads/10329logo.png b/php/public/uploads/10329logo.png
deleted file mode 100644
index d272825..0000000
Binary files a/php/public/uploads/10329logo.png and /dev/null differ
diff --git a/php/public/uploads/10640offre_cgi.webp b/php/public/uploads/10640offre_cgi.webp
deleted file mode 100644
index 4876665..0000000
Binary files a/php/public/uploads/10640offre_cgi.webp and /dev/null differ
diff --git a/php/public/uploads/10865offre_cgi.webp b/php/public/uploads/10865offre_cgi.webp
deleted file mode 100644
index 4876665..0000000
Binary files a/php/public/uploads/10865offre_cgi.webp and /dev/null differ
diff --git a/php/public/uploads/12013offre_cgi.webp b/php/public/uploads/12013offre_cgi.webp
deleted file mode 100644
index 4876665..0000000
Binary files a/php/public/uploads/12013offre_cgi.webp and /dev/null differ
diff --git a/php/public/uploads/12231GIB-e0c1f0d7.png b/php/public/uploads/12231GIB-e0c1f0d7.png
deleted file mode 100644
index 2bc507a..0000000
Binary files a/php/public/uploads/12231GIB-e0c1f0d7.png and /dev/null differ
diff --git a/php/public/uploads/12311LOGO-CGI-1993-1998.svg.png b/php/public/uploads/12311LOGO-CGI-1993-1998.svg.png
deleted file mode 100644
index b02459b..0000000
Binary files a/php/public/uploads/12311LOGO-CGI-1993-1998.svg.png and /dev/null differ
diff --git a/php/public/uploads/12323Image-blob.png b/php/public/uploads/12323Image-blob.png
deleted file mode 100644
index 637af31..0000000
Binary files a/php/public/uploads/12323Image-blob.png and /dev/null differ
diff --git a/php/public/uploads/12664GIB-e0c1f0d7.png b/php/public/uploads/12664GIB-e0c1f0d7.png
deleted file mode 100644
index 2bc507a..0000000
Binary files a/php/public/uploads/12664GIB-e0c1f0d7.png and /dev/null differ
diff --git a/php/public/uploads/12675GIB-e0c1f0d7.png b/php/public/uploads/12675GIB-e0c1f0d7.png
deleted file mode 100644
index 2bc507a..0000000
Binary files a/php/public/uploads/12675GIB-e0c1f0d7.png and /dev/null differ
diff --git a/php/public/uploads/13524GIB-e0c1f0d7.png b/php/public/uploads/13524GIB-e0c1f0d7.png
deleted file mode 100644
index 2bc507a..0000000
Binary files a/php/public/uploads/13524GIB-e0c1f0d7.png and /dev/null differ
diff --git a/php/public/uploads/13584GIB-e0c1f0d7.png b/php/public/uploads/13584GIB-e0c1f0d7.png
deleted file mode 100644
index 2bc507a..0000000
Binary files a/php/public/uploads/13584GIB-e0c1f0d7.png and /dev/null differ
diff --git a/php/public/uploads/14479offre_cgi.webp b/php/public/uploads/14479offre_cgi.webp
deleted file mode 100644
index 4876665..0000000
Binary files a/php/public/uploads/14479offre_cgi.webp and /dev/null differ
diff --git a/php/public/uploads/14524Image-blob.png b/php/public/uploads/14524Image-blob.png
deleted file mode 100644
index 637af31..0000000
Binary files a/php/public/uploads/14524Image-blob.png and /dev/null differ
diff --git a/php/public/uploads/14609offre_cgi.webp b/php/public/uploads/14609offre_cgi.webp
deleted file mode 100644
index 4876665..0000000
Binary files a/php/public/uploads/14609offre_cgi.webp and /dev/null differ
diff --git a/php/public/uploads/14945Image-blob.png b/php/public/uploads/14945Image-blob.png
deleted file mode 100644
index 637af31..0000000
Binary files a/php/public/uploads/14945Image-blob.png and /dev/null differ
diff --git a/php/public/uploads/15505GIB-e0c1f0d7.png b/php/public/uploads/15505GIB-e0c1f0d7.png
deleted file mode 100644
index 2bc507a..0000000
Binary files a/php/public/uploads/15505GIB-e0c1f0d7.png and /dev/null differ
diff --git a/php/public/uploads/15641Image-blob.png b/php/public/uploads/15641Image-blob.png
deleted file mode 100644
index 637af31..0000000
Binary files a/php/public/uploads/15641Image-blob.png and /dev/null differ
diff --git a/php/public/uploads/16452Modèles_Données.png b/php/public/uploads/16452Modèles_Données.png
deleted file mode 100644
index a7499e5..0000000
Binary files a/php/public/uploads/16452Modèles_Données.png and /dev/null differ
diff --git a/php/public/uploads/16811GIB-e0c1f0d7.png b/php/public/uploads/16811GIB-e0c1f0d7.png
deleted file mode 100644
index 2bc507a..0000000
Binary files a/php/public/uploads/16811GIB-e0c1f0d7.png and /dev/null differ
diff --git a/php/public/uploads/17883GIB-e0c1f0d7.png b/php/public/uploads/17883GIB-e0c1f0d7.png
deleted file mode 100644
index 2bc507a..0000000
Binary files a/php/public/uploads/17883GIB-e0c1f0d7.png and /dev/null differ
diff --git a/php/public/uploads/18029Image-blob.png b/php/public/uploads/18029Image-blob.png
deleted file mode 100644
index 637af31..0000000
Binary files a/php/public/uploads/18029Image-blob.png and /dev/null differ
diff --git a/php/public/uploads/18188Image-blob.png b/php/public/uploads/18188Image-blob.png
deleted file mode 100644
index 637af31..0000000
Binary files a/php/public/uploads/18188Image-blob.png and /dev/null differ
diff --git a/php/public/uploads/18312Image-blob.png b/php/public/uploads/18312Image-blob.png
deleted file mode 100644
index 637af31..0000000
Binary files a/php/public/uploads/18312Image-blob.png and /dev/null differ
diff --git a/php/public/uploads/18373imgbin-cgi-group-business-process-information b/php/public/uploads/18373imgbin-cgi-group-business-process-information
deleted file mode 100644
index e284619..0000000
Binary files a/php/public/uploads/18373imgbin-cgi-group-business-process-information and /dev/null differ
diff --git a/php/public/uploads/18801logo.png b/php/public/uploads/18801logo.png
deleted file mode 100644
index d272825..0000000
Binary files a/php/public/uploads/18801logo.png and /dev/null differ
diff --git a/php/public/uploads/18852pexels-christian-heitz-842711.jpg b/php/public/uploads/18852pexels-christian-heitz-842711.jpg
deleted file mode 100644
index 637af31..0000000
Binary files a/php/public/uploads/18852pexels-christian-heitz-842711.jpg and /dev/null differ
diff --git a/php/public/uploads/19294GIB-e0c1f0d7.png b/php/public/uploads/19294GIB-e0c1f0d7.png
deleted file mode 100644
index 2bc507a..0000000
Binary files a/php/public/uploads/19294GIB-e0c1f0d7.png and /dev/null differ
diff --git a/php/public/uploads/19712offre_cgi.webp b/php/public/uploads/19712offre_cgi.webp
deleted file mode 100644
index 4876665..0000000
Binary files a/php/public/uploads/19712offre_cgi.webp and /dev/null differ
diff --git a/php/src/config/Validation.php b/php/src/config/Validation.php
index 59cb150..25c8fd2 100755
--- a/php/src/config/Validation.php
+++ b/php/src/config/Validation.php
@@ -116,4 +116,13 @@ class Validation
return in_array($level,$studies);
}
+ public static function ValidateEntry($entry, $nbChars): bool
+ {
+ if(!empty($entry))
+ {
+ return strlen($entry)>= $nbChars;
+ }
+ return false;
+ }
+
}
diff --git a/php/src/config/config.php b/php/src/config/config.php
index 51f5581..00d1a7d 100755
--- a/php/src/config/config.php
+++ b/php/src/config/config.php
@@ -11,4 +11,4 @@ $base = 'mysql:host=localhost;dbname=dbAlica';
$login = 'test';
$mdp = 'test';
-static $OffersByPage = 5;
\ No newline at end of file
+static $OffersByPage = 5;
diff --git a/php/src/controleur/UtilisateurControleur.php b/php/src/controleur/UtilisateurControleur.php
index cfd0013..9baa9c7 100755
--- a/php/src/controleur/UtilisateurControleur.php
+++ b/php/src/controleur/UtilisateurControleur.php
@@ -206,19 +206,38 @@ class UtilisateurControleur
global $twig;
$taberror = [];
- $requiredFields = ['name', 'entreprise', 'description','typeContrat', 'descriptPoste', 'profilRecherche', 'choixExp', 'education', 'mail', 'num'];
+ // champs de saisie / texte uniquement
+ $requiredFields = ['name', 'entreprise', 'description', 'descriptPoste', 'profilRecherche','ville'];
+
+ $arrayLong = array(
+ 'name' => 128,
+ 'entreprise' => 64,
+ 'description'=> 200,
+ 'descriptPoste' => 2028,
+ 'profilRecherche' => 2028,
+ 'ville' => 100
+ );
- $error = false;
foreach ($requiredFields as $field) {
- if (empty($_POST[$field])) {
- $error = true;
- $taberror[] = "Le champ {$field} est requis !";
+ if (!Validation::ValidateEntry($_POST[$field],$arrayLong[$field])) {
+ $taberror[] = "Erreur : {$field} non valide !";
}
}
- if($error)
+
+
+ if(!Validation::validateTypeStudies($_POST['education']))
{
- echo $twig->render("CreerOffre.html", ['tabError' => $taberror ]);
- return;
+ $taberror[] = "Niveau d'études non valide !";
+ }
+
+ if(!Validation::validateTypeContract($_POST['typeContrat']))
+ {
+ $taberror[] = "Type de contrat non valide !";
+ }
+
+ if(!Validation::validateExperience($_POST['choixExp']))
+ {
+ $taberror[] = "Experience Non valide !";
}
if(!Validation::verifierEmail($_POST["mail"]))
diff --git a/php/src/gateway/OffreGateway.php b/php/src/gateway/OffreGateway.php
index 047be8a..2c1f917 100755
--- a/php/src/gateway/OffreGateway.php
+++ b/php/src/gateway/OffreGateway.php
@@ -62,7 +62,7 @@ class OffreGateway
':v' => array($offre->getVille(), \PDO::PARAM_STR),
':e' => array($offre->getEntreprise(), \PDO::PARAM_STR),
':desc' => array($offre->getDescriptifPoste(), \PDO::PARAM_STR),
- ':pro' => array($offre->getProfil(), \PDO::PARAM_STR),
+ ':pro' => array($offre->getProfilSearched(), \PDO::PARAM_STR),
':exp' => array($offre->getExperience(), \PDO::PARAM_STR),
':niv' => array($offre->getNiveauEtudes(), \PDO::PARAM_STR),
':mail' => array($offre->getMailContact(), \PDO::PARAM_STR),
diff --git a/php/src/metier/Offre.php b/php/src/metier/Offre.php
index c5b9cc6..bd9b494 100755
--- a/php/src/metier/Offre.php
+++ b/php/src/metier/Offre.php
@@ -76,7 +76,7 @@ class Offre
* @var \App\metier\ProfilRecherche Profil recherché
*/
//private \App\metier\ProfilRecherche $profil;
- private string $profil;
+ private string $profilSearched;
/**
* @var string Experience
*/
@@ -156,7 +156,7 @@ class Offre
$this->ville = $ville;
$this->entreprise = $entreprise;
$this->descriptifPoste = $descriptifPoste;
- $this->profil = $profil;
+ $this->profilSearched = $profil;
$this->experience = $experience;
$this->niveauEtudes = $niveauEtudes;
$this->mailContact = $mailContact;
@@ -196,10 +196,6 @@ class Offre
return $this->description;
}
- public function Id(): int
- {
- return $this->img->getId();
- }
public function getImg() : string
{
@@ -227,9 +223,9 @@ class Offre
return $this->descriptifPoste;
}
- public function getProfil(): string
+ public function getProfilSearched(): string
{
- return $this->profil;
+ return $this->profilSearched;
}
public function getExperience(): string
diff --git a/php/src/modele/OffreModele.php b/php/src/modele/OffreModele.php
index dbeb385..d2515bf 100644
--- a/php/src/modele/OffreModele.php
+++ b/php/src/modele/OffreModele.php
@@ -42,9 +42,6 @@ class OffreModele
}
else $remote = false;
- echo "education :".$_POST['education'];
- echo '
';
-
// à la place de NULL passer id utilisateur créateur offre
$offre = new Offre($this->offreGw->getNewId(),
new Alumni(12,"test.mail@icloud.fr","password","admin"),
diff --git a/php/templates/CreerOffre.html b/php/templates/CreerOffre.html
index e20aaf3..8a1e867 100644
--- a/php/templates/CreerOffre.html
+++ b/php/templates/CreerOffre.html
@@ -48,7 +48,7 @@
-
+