diff --git a/controllers/c_hello.php b/controllers/c_hello.php index fa5f7cb..b46a781 100644 --- a/controllers/c_hello.php +++ b/controllers/c_hello.php @@ -1,3 +1,12 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + return $bdd; + } catch (Exception $e) { + return $e; + } +} diff --git a/models/m_hello.php b/models/m_hello.php index a4abe2d..70660e5 100644 --- a/models/m_hello.php +++ b/models/m_hello.php @@ -1,2 +1,18 @@ prepare("SELECT * FROM Utilisateur WHERE nom = ?"); + $req->execute(array($username)); + + if (!$user = $req->fetch()) + $alert = choixAlert("login"); + } catch (Exception $e) { + $alert = choixAlert("query"); + } +} elseif ($bdd instanceof Exception) + $alert = choixAlert("connexion"); diff --git a/views/v_accueil.php b/views/v_accueil.php index 3f2c097..c182311 100644 --- a/views/v_accueil.php +++ b/views/v_accueil.php @@ -19,6 +19,11 @@ +
+ + + +
diff --git a/views/v_hello.php b/views/v_hello.php index 340619a..f9a4821 100644 --- a/views/v_hello.php +++ b/views/v_hello.php @@ -20,9 +20,15 @@ + + + -