diff --git a/public/ajax/connexion.php b/public/ajax/connexion.php new file mode 100644 index 0000000..00fd3f0 --- /dev/null +++ b/public/ajax/connexion.php @@ -0,0 +1,28 @@ +prepare($requete); + $query->execute($params); + $row = $query->fetch(PDO::FETCH_ASSOC); + if (password_verify($_POST['mdp'],$row['password'])) { + echo '{"valide":true,"username":"'.$row['username'].'"}'; + } else { + echo '{"valide":false}'; + } + } else { + $response['status'] = 200; + $response['message'] = "Invalid Request!"; + } +} catch (PDOException $e) { + echo "Erreur : " . $e->getMessage() . "
"; +} diff --git a/public/ajax/readRecords.php b/public/ajax/readRecords.php index f0f485f..e251f71 100644 --- a/public/ajax/readRecords.php +++ b/public/ajax/readRecords.php @@ -2,10 +2,11 @@ ini_set('display_errors', 0); include '../../config/conf.php'; $antenne_slug = $_GET['antenne_slug']; +$nom_connecte = $_GET['nom_connecte']; $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); - // Design initial table header + $data = ' @@ -14,9 +15,8 @@ $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); - - - '; + '; + $params["antenne_slug"] = $antenne_slug; $requete = "SELECT products.*, users.username @@ -27,9 +27,23 @@ $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); 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(); - + while ($row2 = $stmt2->fetch(PDO::FETCH_ASSOC)) { + if ($row2['username'] == $nom_connecte) { + $affich_actions = true; + } else { + $affich_actions = false; + } + } + if ($affich_actions) { + $data .= ''; + $data .= ''; + } else { + $data .= ''; + } if ($count > 0) { $number = 1; @@ -44,38 +58,42 @@ $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password); $data .= ''; $data .= ''; $data .= ''; - $data .= '
No.Vendeur Clé publique QuantitéPrix en junesActions
Prix en junesActions
'.$row['quantite'].''.$row['prix'].''; - $data .= '

-
-
diff --git a/src/Product/views/admin/recherches/index.twig b/src/Product/views/admin/recherches/index.twig index 9deeed6..b8157a8 100644 --- a/src/Product/views/admin/recherches/index.twig +++ b/src/Product/views/admin/recherches/index.twig @@ -45,7 +45,7 @@ overflow: hidden; padding: 0 !important; border-radius: 50px; - height: 26px; + height: 28px; width: 215px; } .toggle_radio > * { @@ -71,7 +71,7 @@ width: 100px; height: 20px; position: absolute; - top: 3px; + top: 4px; border-radius: 50px; transition: all .4s ease; } @@ -107,19 +107,11 @@
- -
- {% if antenne_name == 'Paris' %} +
@@ -47,18 +49,26 @@ {{ "now"|date('d/m/y') }}
{% if current_user() %} - -     +
{% else %} -