diff --git a/Assets/functions.php b/Assets/functions.php index 1a06a11..26f0d8f 100644 --- a/Assets/functions.php +++ b/Assets/functions.php @@ -623,4 +623,54 @@ function updateUserPermissions($bdd, $user, $permissions) mysqli_stmt_close($stmt); return $success; +} + +function deleteRaccourcis($bdd, $id) +{ + $sql = "DELETE FROM raccourcis WHERE id = ?"; + $req = $bdd->prepare($sql); + $req->bind_param("i", $id); + $req->execute(); + return $req->affected_rows > 0; +} + +function getEventVisibility($bdd, $event) +{ + $stmt = mysqli_prepare( + $bdd, + "SELECT public FROM evenements WHERE id = ? LIMIT 1" + ); + + mysqli_stmt_bind_param($stmt, "s", $event); + mysqli_stmt_execute($stmt); + + $result = mysqli_stmt_get_result($stmt); + $row = mysqli_fetch_assoc($result); + + mysqli_stmt_close($stmt); + + return $row ? $row['public'] : null; +} + +function createGuide($bdd, $nom, $lien, $image) +{ + + $stmt = mysqli_prepare( + $bdd, + "INSERT INTO guides (nom, lien, image) VALUES (?, ?, ?)" + ); + mysqli_stmt_bind_param($stmt, "sss", $nom, $lien, $image); + mysqli_stmt_execute($stmt); + $guideId = mysqli_insert_id($bdd); + mysqli_stmt_close($stmt); + return $guideId; +} + +function deleteGuide($bdd, $id) +{ + $sql = "DELETE FROM guides WHERE id = ?"; + $req = $bdd->prepare($sql); + $req->bind_param("i", $id); + $req->execute(); + return $req->affected_rows > 0; } \ No newline at end of file diff --git a/admin/admin.php b/admin/admin.php index 6b77a07..7662a2f 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -153,6 +153,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { + +
@@ -168,21 +174,26 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { -
+
- " - style="width:40px;height:40px;margin-right:10px;cursor:pointer;"> +
+ " + style="width:40px;height:40px;margin-right:10px;cursor:pointer;"> -
- - - -
- - - +
+ + + +
+ + + +
+
+ +
+
@@ -221,7 +232,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
+
+ +
+ + +
+ +
+ + +
+ + + + + +
+ \ No newline at end of file diff --git a/admin/gestionUser.php b/admin/gestionUser.php index f631344..fc891f8 100644 --- a/admin/gestionUser.php +++ b/admin/gestionUser.php @@ -7,12 +7,13 @@ if (userExists($bdd, $_POST['username'])) { if (isset($_POST['password']) && !empty($_POST["password"])) { updateUserPassword($bdd, $_POST['username'], hash('sha256', $_POST['password'])); } - if(isset($_POST['site']) && $_POST["site"] != ""){ + if (isset($_POST['site']) && $_POST["site"] != "") { updateUserSite($bdd, $_POST["username"], $_POST["site"]); } - if($_POST['permissions'] != "Sélectionner"){ + if (!empty($_POST['permissions'])) { updateUserPermissions($bdd, $_POST['username'], $_POST['permissions']); } -}else{ + header('location: admin.php'); +} else { die('L\'utilisateur n\'existe pas...'); } diff --git a/admin/modifyEvent.php b/admin/modifyEvent.php index 81d2f91..2e3fb24 100644 --- a/admin/modifyEvent.php +++ b/admin/modifyEvent.php @@ -22,8 +22,11 @@ $eventId = $_GET['id'] ?? null; $titre = getEventName($bdd, $eventId) ?? ''; $site = getEventSite($bdd, $eventId) ?? ''; $couverture = getEventBigImage($bdd, $eventId) ?? ''; +$public = getEventVisibility($bdd, $eventId); if ($_SERVER['REQUEST_METHOD'] === 'POST' && empty($_POST['new'])) { + var_dump($_POST); + die(); if (!empty($_POST['title'])) { updateEventTitle($bdd, $eventId, trim($_POST['title'])); } @@ -188,6 +191,10 @@ if (!empty($_POST['new'])) {
+
+ + +
diff --git a/guides.php b/guides.php index fe0c094..4838a63 100644 --- a/guides.php +++ b/guides.php @@ -8,26 +8,29 @@ $guides = getGuides($bdd); ?> - - - - Intranet de l'APEI - - - - - -
- -
-

- Image de couverture -
- -
+ + + + Intranet de l'APEI + + + + + + + + +
+ +
+

+ +
+ +
+ + + - - - \ No newline at end of file diff --git a/login.php b/login.php index f47299d..95cb021 100644 --- a/login.php +++ b/login.php @@ -25,6 +25,7 @@ if(isset($_POST['user']) && isset($_POST['password']) && isset($_GET['redirect_t + Se connecter ! diff --git a/styles-scripts/guides.css b/styles-scripts/guides.css index 8bda2c7..8085fcf 100644 --- a/styles-scripts/guides.css +++ b/styles-scripts/guides.css @@ -1,14 +1,28 @@ - .grid-container { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); - gap: 1rem; - padding: 1rem; - } +.grid-container { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 20px; + justify-items: center; + padding: 20px; +} - .card { - background: #f0f0f0; - border: 2px solid #ccc; - padding: 20px; - /* text-align: center; */ - border-radius: 8px; - } \ No newline at end of file +.card { + width: 100%; + height: 40vh; + cursor: pointer; + padding: 10px; + text-align: center; +} + +img { + width: 100%; + height: auto; + max-height: 250px; + object-fit: contain; +} + +@media (max-width: 768px) { + .grid-container { + grid-template-columns: repeat(2, 1fr); + } +} \ No newline at end of file diff --git a/styles-scripts/login.css b/styles-scripts/login.css new file mode 100644 index 0000000..b073c0f --- /dev/null +++ b/styles-scripts/login.css @@ -0,0 +1,4 @@ +body +{ + padding: 1rem; +} \ No newline at end of file