diff --git a/public/css/style.css b/public/css/style.css index c6653e5..71a6f6f 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -145,18 +145,24 @@ header.header img { display: block; margin: auto; } + +/******************************************************************/ +/* dashboard.twig */ +/******************************************************************/ +.tab-de-bord { + background-color: brown; + padding: 1rem; + min-width: 350px; +} /******************************************************************/ /* layout.twig */ /******************************************************************/ - .mdp_oublie:hover { background-color: deepskyblue; } - /******************************************************************/ /* LOADING PUBKEY */ /******************************************************************/ - #cle_pub { display: none; } @@ -178,7 +184,17 @@ body.loading .loadingPubkey { /* POUR MOBILES */ /******************************************************************/ @media only screen and (max-width:560px) { - + /******************************************************************/ + /* dashboard.twig */ + /******************************************************************/ + .tab-de-bord { + background-color: brown; + padding: 1rem; + min-width: 280px; + } + /******************************************************************/ + /* layout.twig */ + /******************************************************************/ .fond { background-color: black; background-image: url("../images/bildreich_1275.jpg"); diff --git a/public/models/readRecords.php b/public/models/readRecords.php index 55ddbf5..8b740c0 100644 --- a/public/models/readRecords.php +++ b/public/models/readRecords.php @@ -2,12 +2,12 @@ session_start(); ini_set('display_errors', 0); include '../../config/config.php'; - $antenne_slug = $_GET['antenne_slug']; - $nom_connecte = $_SESSION['user']; - $bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); +$antenne_slug = $_GET['antenne_slug']; +$nom_connecte = $_SESSION['user']; +$bdd = new \PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password); - // Affichage des intitulés de colonnes - $data = ' +// Affichage des intitulés de colonnes +$data = '
@@ -17,88 +17,88 @@ '; - $params["antenne_slug"] = $antenne_slug; - $requete = "SELECT products.*, users.username, users.pubkey +$params["antenne_slug"] = $antenne_slug; +$requete = "SELECT products.*, users.username, users.pubkey FROM products LEFT JOIN antennes ON antennes.id = products.antenne_id LEFT JOIN users ON users.id = products.user_id WHERE antennes.slug = :antenne_slug"; - $stmt = $bdd->prepare($requete); - $stmt2 = $bdd->prepare($requete); - $stmt->execute($params); - $stmt2->execute($params); - $count = $stmt->rowCount(); - $affich_actions = false; - while ($row2 = $stmt2->fetch(PDO::FETCH_ASSOC)) { - if ($row2['username'] == $nom_connecte) { - $affich_actions = true; - } +$stmt = $bdd->prepare($requete); +$stmt2 = $bdd->prepare($requete); +$stmt->execute($params); +$stmt2->execute($params); +$count = $stmt->rowCount(); +$affich_actions = false; +while ($row2 = $stmt2->fetch(PDO::FETCH_ASSOC)) { + if ($row2['username'] == $nom_connecte) { + $affich_actions = true; } - if ($affich_actions) { - $data .= ''; - $data .= ''; - } else { - $data .= ''; - } - if ($count > 0) - { - $number = 1; - while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { +} +if ($affich_actions) { + $data .= ''; + $data .= ''; +} else { + $data .= ''; +} +if ($count > 0) +{ + $number = 1; + while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { - $data .= " + $data .= ""; - $prix = $row['prix']; - $vendeur = $row['username']; - $produit = $row['name']; - $pubkey = $row['pubkey']; - $pubkeyShort = substr($pubkey, 0, 8); - $vendeur_format = "$vendeur"; - $cle_pub_format = " $pubkeyShort... "; - $data .= ''; - $data .= ''; - $data .= ''; - $data .= ''; - $data .= ''; - $data .= ''; - if ($row['username'] == $nom_connecte ) { - $data .= ''; + $data .= ''; + $data .= ''; + $data .= ''; + $data .= ''; + $data .= ''; + if ($row['username'] == $nom_connecte ) { + $data .= '
No. Bien / serviceQuantité Prix en junesActions
Actions
$number'.$produit.''.$vendeur_format.''.$cle_pub_format.''.$row['quantite'].''.$prix.''; - $data .= ''.$produit.''.$vendeur_format.''.$cle_pub_format.''.$row['quantite'].''.$prix.''; + $data .= ' + + + +

+

Profil

+ +
    + +
    +
    + + {{ field('firstname', profil_user.firstname, 'Prénom') }} + {{ field('lastname', profil_user.lastname, 'Nom') }} + Adresse mail {{ profil_user.email }}

    + Clé publique {{ profil_user.pubkey }} +

    + +
    +
    + +
+
    +
    +
    + +
    +
    +
+

+

Liste des antennes suivies

+ +
    +
  • + {% set antenne_suivie = profil_user.suiviantenne|split('|') %} + {% for antenne in antenne_suivie %} + {% for item in listeAntennes %} + {% if (item.id == antenne) %} +
  • + + {{ item.antenneName }} + +
  • + {% endif %} + {% endfor %} + {% endfor %} + +
+

+ +{% endblock %} \ No newline at end of file diff --git a/src/Admin/views/layout.twig b/src/Admin/views/layout.twig index 27072cc..440c29b 100644 --- a/src/Admin/views/layout.twig +++ b/src/Admin/views/layout.twig @@ -26,13 +26,17 @@ {% if name_user != '' %}
- + +
{% else %} + + name_user = {{ name_user }} + name_user2 = {{ name_user2 }} diff --git a/src/Auth/ForbiddenMiddleware.php b/src/Auth/ForbiddenMiddleware.php index 7e89ea5..3f1c1f3 100644 --- a/src/Auth/ForbiddenMiddleware.php +++ b/src/Auth/ForbiddenMiddleware.php @@ -52,7 +52,7 @@ class ForbiddenMiddleware implements MiddlewareInterface public function redirectLogin(ServerRequestInterface $request): ResponseInterface { $this->session->set('auth.redirect', $request->getUri()->getPath()); - (new FlashService($this->session))->error('Vous devez posséder un compte pour accéder à cette page'); + //(new FlashService($this->session))->error('Vous devez posséder un compte pour accéder à cette page'); return new RedirectResponse($this->loginPath); } } diff --git a/src/Contact/ContactAction.php b/src/Contact/ContactAction.php index 63bdaea..9467c8a 100644 --- a/src/Contact/ContactAction.php +++ b/src/Contact/ContactAction.php @@ -31,10 +31,12 @@ class ContactAction } if (isset($_SESSION['user'])) { $nom_user = $_SESSION['user']; + $role = $_SESSION['role']; } else { $nom_user = ''; + $role = '3'; } - return $this->renderer->render('@contact/contact',compact('nom_user')); + return $this->renderer->render('@contact/contact',compact('nom_user','role')); } } } diff --git a/src/Contact/contact.twig b/src/Contact/contact.twig index 88576e2..8140d7c 100644 --- a/src/Contact/contact.twig +++ b/src/Contact/contact.twig @@ -3,14 +3,6 @@ {% block title "Ğ1-Marché - Contact" %} {% block body %}