diff --git a/public/bibliotheque.php b/public/bibliotheque.php index 32f044148427fdd1d59dbcd2e73b56192b67dda2..8b373c2867accca841f019a67a676c89924aae6c 100644 --- a/public/bibliotheque.php +++ b/public/bibliotheque.php @@ -42,8 +42,7 @@ urlHasArgument(); <html> -<?php generateHeader('Bibliothèque'); - generateUserBanner();?> +<?php generateHeader('Bibliothèque');?> <body onload="startviewer()"> <!-- génération des bannières --> <?php diff --git a/public/css/customCss.css b/public/css/customCss.css index 933cac8c3e1792479c22eed75682ce2f20e68761..ffdd2355339f17361404386d0a2c79535a39ce79 100644 --- a/public/css/customCss.css +++ b/public/css/customCss.css @@ -115,6 +115,12 @@ color: yellow; } +.etoile_remove { + width: 1vw; + height: 1vw; + margin-bottom: 0.75vw; + margin-right: 0.5vw; +} @keyframes appearcontent { diff --git a/public/js/ajax.js b/public/js/ajax.js index f91e15b4476d05f8904e7ed13e922e9218647d8b..3d3e6061b8817d44eb25e6556c6e8ea0149a397f 100644 --- a/public/js/ajax.js +++ b/public/js/ajax.js @@ -16,13 +16,12 @@ function ajaxRemoveCDC(userP, photoP) { function ajaxNewReview(userP, photoP, noteP) { - console.log("reviewAjout"); + console.log("reviewAjout "+noteP); $.post("ReviewSubmitAction.php", {user: userP, photo: photoP, note: noteP, action: "new"}) } function ajaxRemoveReview(userP, photoP) { console.log("reviewRetrait"); - $.post("ReviewSubmitAction.php", {user: userP, photo: photoP, action: "remove"}) + $.post("ReviewSubmitAction.php", {user: userP, photo: photoP, note: "0", action: "remove"}) } -// azedizgejguheif \ No newline at end of file diff --git a/public/js/connexion.js b/public/js/connexion.js index 6d0916cefb2ac7e188a9d660fc7f2b6c32f195c3..f2f6f374c4172030a520e01e29f98655061f122f 100644 --- a/public/js/connexion.js +++ b/public/js/connexion.js @@ -28,8 +28,13 @@ function fenetreModalFermee(fenetreModal) console.log("modal = connexion"); } + + document.getElementById('logoPhp').setAttribute('href', 'index.php?modal=' + modal); document.getElementById('indexPhp').setAttribute('href', 'index.php?modal=' + modal); document.getElementById('imageRandomPhp').setAttribute('href', 'image_alea.php?modal=' + modal); document.getElementById('bibliothequePhp').setAttribute('href', 'bibliotheque.php?modal=' + modal); -}; \ No newline at end of file + + +}; + diff --git a/public/js/picture_browser.js b/public/js/picture_browser.js index 9faeeac590b8fbe9e8ddd26156d532e7f9f8c78b..e9729901ff5933229012d63be999c258561eef2e 100644 --- a/public/js/picture_browser.js +++ b/public/js/picture_browser.js @@ -399,6 +399,7 @@ function isInReviewlist(id) { function updateEtoile(user, encoded_id, nbEtoile, option) { + icon_etoile = '<img class="etoile_remove" style="cursor: pointer;" onclick="remove_etoile(\'' + user + '\',\'' + encoded_id + '\')" src="./ressources/icons/croix_blanche.png" onmouseout="this.src=\'./ressources/icons/croix_blanche.png\'" onmouseover="this.src=\'./ressources/icons/croix_rouge.png\'">'; if (nbEtoile >= 5) { console.log(nbEtoile); @@ -407,7 +408,8 @@ function updateEtoile(user, encoded_id, nbEtoile, option) { '<span class="etoile" title="4 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 4, \'update\')">★</span>' + '<span class="etoile" title="3 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 3, \'update\')">★</span>' + '<span class="etoile" title="2 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 2, \'update\')">★</span>' + - '<span class="etoile" title="1 étoile" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 1, \'update\')">★</span>'; + '<span class="etoile" title="1 étoile" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 1, \'update\')">★</span>' + + icon_etoile; if (option == 'update') { ajaxRemoveReview(user, encoded_id); @@ -420,7 +422,8 @@ function updateEtoile(user, encoded_id, nbEtoile, option) { '<span class="etoile" title="4 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 4, \'update\')">★</span>' + '<span class="etoile" title="3 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 3, \'update\')">★</span>' + '<span class="etoile" title="2 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 2, \'update\')">★</span>' + - '<span class="etoile" title="1 étoile" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 1, \'update\')">★</span>'; + '<span class="etoile" title="1 étoile" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 1, \'update\')">★</span>' + + icon_etoile; if (option == 'update') { ajaxRemoveReview(user, encoded_id); @@ -433,7 +436,8 @@ function updateEtoile(user, encoded_id, nbEtoile, option) { '<span title="4 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 4, \'update\')">★</span>' + '<span class="etoile" title="3 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 3, \'update\')">★</span>' + '<span class="etoile" title="2 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 2, \'update\')">★</span>' + - '<span class="etoile" title="1 étoile" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 1, \'update\')">★</span>'; + '<span class="etoile" title="1 étoile" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 1, \'update\')">★</span>' + + icon_etoile; if (option == 'update') { ajaxRemoveReview(user, encoded_id); @@ -446,7 +450,8 @@ function updateEtoile(user, encoded_id, nbEtoile, option) { '<span title="4 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 4, \'update\')">★</span>' + '<span title="3 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 3, \'update\')">★</span>' + '<span class="etoile" title="2 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 2, \'update\')">★</span>' + - '<span class="etoile" title="1 étoile" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 1, \'update\')">★</span>'; + '<span class="etoile" title="1 étoile" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 1, \'update\')">★</span>' + + icon_etoile; if (option == 'update') { ajaxRemoveReview(user, encoded_id); @@ -459,7 +464,8 @@ function updateEtoile(user, encoded_id, nbEtoile, option) { '<span title="4 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 4, \'update\')">★</span>' + '<span title="3 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 3, \'update\')">★</span>' + '<span title="2 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 2, \'update\')">★</span>' + - '<span class="etoile" title="1 étoile" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 1, \'update\')">★</span>'; + '<span class="etoile" title="1 étoile" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 1, \'update\')">★</span>' + + icon_etoile if (option == 'update') { ajaxRemoveReview(user, encoded_id); @@ -481,3 +487,13 @@ function updateEtoile(user, encoded_id, nbEtoile, option) { } } +function remove_etoile(user, encoded_id) { + document.getElementById('emplacementEtoile_' + encoded_id).innerHTML = + '<span title="5 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 5, \'update\')">★</span>' + + '<span title="4 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 4, \'update\')">★</span>' + + '<span title="3 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 3, \'update\')">★</span>' + + '<span title="2 étoiles" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 2, \'update\')">★</span>' + + '<span title="1 étoile" onclick="updateEtoile(\'' + user + '\',\'' + encoded_id + '\', 1, \'update\')">★</span>'; + ajaxRemoveReview(user, encoded_id); +} + diff --git a/public/ressources/icons/croix_blanche.png b/public/ressources/icons/croix_blanche.png new file mode 100644 index 0000000000000000000000000000000000000000..a44f249214649c707f9c24750d64d278bbd2c0c5 Binary files /dev/null and b/public/ressources/icons/croix_blanche.png differ diff --git a/public/ressources/icons/croix_rouge.png b/public/ressources/icons/croix_rouge.png new file mode 100644 index 0000000000000000000000000000000000000000..d3fb0c6ad0f0a1aa4bd3a211baa2f2f23495a40c Binary files /dev/null and b/public/ressources/icons/croix_rouge.png differ diff --git a/public/utils/content.php b/public/utils/content.php index 0ac13d82445d2fc82752823ceb4c27b86099be1f..268b1e73b277a4989ce7d2fc051c9ff4bb8f255a 100644 --- a/public/utils/content.php +++ b/public/utils/content.php @@ -30,9 +30,7 @@ function generateHeader($titre) { function generateUserBanner() { if (!isset($_SESSION["id_user"])) {//si l'utilisateur n'est pas connecté - echo '<div class="UserBanner" style="font-family:Abang;font-size:20px;text-align:center;margin-bottom:0px;background-color: #F3282A"> - Vous n\'etes pas connecte - </div>'; + } else { $dbName = getenv('DB_NAME'); @@ -45,15 +43,10 @@ function generateUserBanner() { $user_actuel = $userRepository->fetchId($_SESSION["id_user"]); - $nom = $user_actuel->getNom(); - $prenom = $user_actuel->getPrenom(); - $pseudo = $user_actuel->getPseudo(); - echo "<div class=\"UserBanner\" style=\"font-size:20px;margin-bottom:0px;font-family:Abang;background-color: #554B9B\"> - Vous etes connectes en tant que : $nom '$pseudo' $prenom - </div> - <div id=\"userInfo\" style=\"display: none;\">".$user_actuel->getId()."</div>"; + echo + "<div id=\"userInfo\" style=\"display: none;\">".$user_actuel->getId()."</div>"; } } @@ -206,7 +199,9 @@ function generateNavBar($page){ // pour mettre en surbrillance l'onglet sélectionné echo '<nav class="navbar navbar-expand-lg bg-dark navbar-dark sticky-top" style="margin-top:0px;font-family:Abang"> - <a class="navbar-brand" href="index.php"><img src="./ressources/logo/logo_transparent_recadre.png" height="36" width="67"></a> + <a class="navbar-brand" id=logoPhp href="index.php"> + <img src="./ressources/logo/logo_transparent_recadre.png" height="36" width="67"> + </a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button>