stany.ferer 2 years ago
parent
commit
029f2dfb74

+ 4 - 4
core/submit/cms.evenement.php

@@ -20,11 +20,11 @@ if(core::getPost("id") == "add"){
             alert::recSuccess("L'évènement a bien été créé");
         } catch (Exception $ex) {
             alert::recError("Erreur lors de l'enregistrement de l'évènement");
-            header("Location: /?p=evenement&add=1");
+            header("Location: /add-evenement.html");
             exit();
         }
     
-    header("Location: /?p=evenement&id=" . event::lastEvenement());
+    header("Location: /evenement-" . event::lastEvenement().".html");
     exit();
     
 } else {
@@ -55,10 +55,10 @@ if(core::getPost("id") == "add"){
             alert::recSuccess("L'évènement a bien été modifié");
         } catch (Exception $ex) {
             alert::recError("Erreur lors de la modification de l'évènement");
-            header("Location: /?p=evenement&id=" . core::getPost("id"));
+            header("Location: /evenement-" . core::getPost("id").".html");
             exit();
         }
 
-        header("Location: /?p=evenement&id=" . core::getPost("id"));
+        header("Location: /evenement-" . core::getPost("id").".html");
         exit();
     }

+ 1 - 1
core/submit/cms.event-deinscription.php

@@ -10,6 +10,6 @@ if(core::ifPost("event") AND core::ifPost("from")){
     alert::recSuccess("Désinscription de ". core::getPost("texte"));
     alert::recTab("inscrits-tab");
     
-    header("Location: /?p=evenement&id=" . core::getPost("event"));
+    header("Location: /evenement-" . core::getPost("event").".html");
     exit();
 }

+ 1 - 1
core/submit/cms.event-delete.php

@@ -7,5 +7,5 @@ if(core::ifGet("id")) {
     alert::recSuccess("L'évènement vient d'être supprimé");
 }
 
-header("Location: /?p=evenements");
+header("Location: /evenements.html");
 exit();

+ 4 - 4
core/submit/cms.event-import-inscription.php

@@ -20,7 +20,7 @@ if (core::ifPost("from") AND core::getPost("from") == "event-import-inscription"
         }
     } elseif ($_FILES[core::getPost("from")]['type'] != "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") {
         alert::recError("Seuls les fichiers Excel au format xlsx sont acceptés (".$_FILES[core::getPost("from")]['type'].")");
-        header("Location: /?p=evenement&id=".core::getPost("event"));
+        header("Location: /evenement-".core::getPost("event").".html");
         exit();
     } else {
 
@@ -34,7 +34,7 @@ if (core::ifPost("from") AND core::getPost("from") == "event-import-inscription"
                     OR $returnXlsx[0][1] != "Nom SALAR" 
                     OR $returnXlsx[0][2] != "Prénom SALAR"){
                 alert::recError("Le fichier " . $_FILES[core::getPost("from")]['name'] . " n'est pas un fichier d'inscription à un évènement.");
-                header("Location: /?p=evenement&id=".core::getPost("event"));
+                header("Location: /evenement-".core::getPost("event").".html");
                 exit();
             } 
             
@@ -65,14 +65,14 @@ if (core::ifPost("from") AND core::getPost("from") == "event-import-inscription"
 
             }
             
-            header("Location: /?p=evenement&id=".core::getPost("event"));
+            header("Location: /evenement-".core::getPost("event").".html");
             exit();
         } else {
             alert::recError("Erreur lors du chargement du fichier : " . $_FILES[core::getPost("from")]['name']);
         }
     }
 
-    header("Location: /?p=evenement&id=".core::getPost("event"));
+    header("Location: /evenement-".core::getPost("event").".html");
     exit();
 } else {
     header('HTTP/1.0 401 Unauthorized');

+ 1 - 1
core/submit/cms.event-inscription.php

@@ -12,6 +12,6 @@ if(core::ifPost("event") AND core::ifPost("salarie")){
     alert::recSuccess("Inscription de ". core::getPost("texte"));
     alert::recTab("salaries-tab");
     
-    header("Location: /?p=evenement&id=" . core::getPost("event"));
+    header("Location: /evenement-" . core::getPost("event").".html");
     exit();
 }

+ 8 - 8
core/views/_cms.menu.php

@@ -5,27 +5,27 @@
                 if(session::accessUserByType(1)){ 
                     core::elementMenuH6("Salariés");
                     core::elementMenu("rh-liste-salaries", "/", "RH : Liste des salariés", "users");
-                    core::elementMenu("rh-historique-excel", "/?p=rh-historique-excel", "RH : Historique des Excels", "file-text");
-                    if(isset(salaries::excel_get_in_progress()["name"])){ core::elementMenu("rh-import-to-temp", "/?p=rh-import-to-temp", "RH : Reprise du traitement", "file-text"); } 
-                    core::elementMenu("stats", "/?p=stats", "RH : Stats salariés", "pie-chart"); 
+                    core::elementMenu("rh-historique-excel", "/rh-historique-excel.html", "RH : Historique des Excels", "file-text");
+                    if(isset(salaries::excel_get_in_progress()["name"])){ core::elementMenu("rh-import-to-temp", "/rh-import-to-temp.html", "RH : Reprise du traitement", "file-text"); } 
+                    core::elementMenu("stats", "/stats.html", "RH : Stats salariés", "pie-chart"); 
                 }
                     
                 if(session::accessUserByType(1)){ 
                     core::elementMenuH6("ProWeb"); }
                 if(session::accessUserByType(1)){ 
-                    core::elementMenu("proweb-salaries", "/?p=proweb-salaries", "Proweb : Liste des salariés", "archive");
-                    core::elementMenu("proweb-historique-excel", "/?p=proweb-historique-excel", "Proweb : Historique des Excels", "file-text");
-                    core::elementMenu("proweb-export-csv", "/?p=proweb-export-csv", "Proweb : Transfert de données", "send"); 
+                    core::elementMenu("proweb-salaries", "/proweb-salaries.html", "Proweb : Liste des salariés", "archive");
+                    core::elementMenu("proweb-historique-excel", "/proweb-historique-excel.html", "Proweb : Historique des Excels", "file-text");
+                    core::elementMenu("proweb-export-csv", "/proweb-export-csv.html", "Proweb : Transfert de données", "send"); 
                 }
                 
                 if(session::accessUserByType(1) OR session::accessUserByType(3)){ 
                     core::elementMenuH6("Accès services sociaux");
-                    core::elementMenu("sociale-check-salarie", "/?p=sociale-check-salarie", "Validation d'un compte salarié", "check-square"); 
+                    core::elementMenu("sociale-check-salarie", "/sociale-check-salarie.html", "Validation d'un compte salarié", "check-square"); 
                 }
                         
                 if(session::accessUserByType(1)){ 
                     core::elementMenuH6("Evènements");
-                    core::elementMenu("evenements", "/?p=evenements", "Listes des évènements", "calendar");
+                    core::elementMenu("evenements", "/evenements.html", "Listes des évènements", "calendar");
                     core::elementMenuLink("https://".DOMAIN_EVENTS, "Interface d'émargement", "link");
                 }
                 

+ 1 - 1
core/views/pages/cms.evenement-inscription-upload.php

@@ -13,7 +13,7 @@
             "current" => "Importer un fichier Excel", 
             "arbo" => array( 
                 "Evènement" => NULL,
-                "[#" . $evenement["id"] . "] " . $evenement["titre"] => "?p=evenement&id=" . core::getGet("id"),
+                "[#" . $evenement["id"] . "] " . $evenement["titre"] => "/evenement-" . core::getGet("id") . ".html",
                 "Importer un fichier Excel" => NULL)
         )); 
 ?>

+ 2 - 2
core/views/pages/cms.evenement-salaries.php

@@ -39,7 +39,7 @@ if(core::ifGet("id")){
 <script>
         function selectFormatterSalarie(value, row) { 
             if(row.inscrit == 0){
-               return '<form method="post" action="/submit.php">\n\
+                return '<form method="post" action="/submit.php">\n\
                 <input type="hidden" name="texte" value="' + row.prenom + ' ' + row.nom + '">\n\
                 <input type="hidden" name="from" value="event-inscription">\n\
                 <input type="hidden" name="event" value="' + <?php echo core::getGet("id") ?> + '">\n\
@@ -47,7 +47,7 @@ if(core::ifGet("id")){
                 <button type="submit" class="btn btn-outline-primary btn-sm">Inscrire</button>\n\
                 </form>'; 
             } else {
-               return '<button type="submit" class="btn btn-outline-warning btn-sm" disabled>Inscrit</button>'; 
+                return '<button type="submit" class="btn btn-outline-warning btn-sm" disabled>Inscrit</button>'; 
             } 
         }
 </script>

+ 9 - 9
core/views/pages/cms.evenement.php

@@ -56,16 +56,16 @@ if(alert::ifTab()){
 <?php 
         if(core::ifGet("add")) {
             $labelFil = "Ajouter un évènement";
-            $lienFil = "/?p=evenement&add=1";
+            $lienFil = "/evenement-add.html";
         } else {
             $labelFil = "[#" . $event["id"] . "] " . $event["titre"];
-            $lienFil = "/?p=evenement&id=".core::getGet("id");
+            $lienFil = "/evenement-".core::getGet("id").".html";
         }
         echo core::filAriane(array(
             "current" => $labelFil, 
             "arbo" => array( 
                 "Evènements" => NULL,
-                "Listes des évènements" => "/?p=evenements",
+                "Listes des évènements" => "/evenements.html",
                 $labelFil => $lienFil)
         )); 
 ?>
@@ -131,12 +131,12 @@ if(alert::ifTab()){
 
 <?php if(isset($event["id"]) AND isset($event["type_emargement"]) AND $event["type_emargement"] != 1){ ?>
 <div class="modal fade" id="QRCodeModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-dialog-centered" role="document">
-    <div class="modal-content">
-      <div class="modal-body">
-        <?php event::getQRCode($event["id"], "100%") ?>
-      </div>
+    <div class="modal-dialog modal-dialog-centered" role="document">
+        <div class="modal-content">
+            <div class="modal-body">
+                <?php event::getQRCode($event["id"], "100%") ?>
+            </div>
+        </div>
     </div>
-  </div>
 </div>
 <?php } ?>

+ 2 - 2
core/views/pages/cms.evenements.php

@@ -6,7 +6,7 @@
 <header class="d-flex flex-column flex-md-row align-items-md-center p-3 bg-light ">
 <h2 class="bd-title" id="content">
     <span>Listes des évènements</span>
-    <a href="/?p=evenement&add=1" style="position: absolute; right: 0; margin: 0 40px 0 0;"><button type="submit" class="btn btn-outline-success btn-sm"><span data-feather="plus-square"></span> Ajouter un évènement</button></a>
+    <a href="/evenement-add.html" style="position: absolute; right: 0; margin: 0 40px 0 0;"><button type="submit" class="btn btn-outline-success btn-sm"><span data-feather="plus-square"></span> Ajouter un évènement</button></a>
 </h2>
 </header>
 <?php   
@@ -53,6 +53,6 @@
 
 <script>
     function selectFormatter(value, row) { 
-        return '<form method="get" action="/"><input type="hidden" name="p" value="evenement"><input type="hidden" name="id" value="' + row.id + '"><button type="submit" class="btn btn-outline-primary btn-sm">Ouvrir</button></form>';
+        return '<a href="/evenement-' + row.id + '.html"><button type="submit" class="btn btn-outline-primary btn-sm">Ouvrir</button></a>';
     }
 </script>

+ 1 - 1
core/views/pages/cms.proweb-historique-excel.php

@@ -1,7 +1,7 @@
 <header class="d-flex flex-column flex-md-row align-items-md-center p-3 bg-light ">
     <h2 class="bd-title" id="content">
         <span>Base ProWeb : Historique des Excels</span>
-        <a href="/?p=proweb-salaries-upload" style="position: absolute; right: 0; margin: 0 40px 0 0;"><button type="submit" class="btn btn-outline-success btn-sm"><span data-feather="file-plus"></span> Importer un fichier Excel</button></a>
+        <a href="proweb-salaries-upload.html" style="position: absolute; right: 0; margin: 0 40px 0 0;"><button type="submit" class="btn btn-outline-success btn-sm"><span data-feather="file-plus"></span> Importer un fichier Excel</button></a>
         <a href="https://www.cse-invent.com/gestion/beneficiaire/od/export-etat/124/excel?type=EtatListe_od" target="_blank" style="position: absolute; right: 0; margin: 0 250px 0 0;"><button type="submit" class="btn btn-outline-secondary btn-sm"><span data-feather="link"></span> Exporter tous les salariés depuis Proweb</button></a>
     </h2>
 </header>

+ 1 - 1
core/views/pages/cms.proweb-salaries-upload.php

@@ -11,7 +11,7 @@
             "arbo" => array( 
                 "Proweb" => NULL,
                 "Liste des salariés" => "/?p=proweb-salaries",
-                "Importer un fichier Excel (base Proweb)" => "/?p=proweb-salaries-upload")
+                "Importer un fichier Excel (base Proweb)" => "/proweb-salaries-upload.html")
         )); 
 ?>
 <br />

+ 2 - 2
core/views/pages/cms.proweb-salaries.php

@@ -5,7 +5,7 @@
 <header class="d-flex flex-column flex-md-row align-items-md-center p-3 bg-light ">
     <h2 class="bd-title" id="content">
         <span>Base ProWeb : Liste des salariés<?php echo $date ?></span>
-        <a href="/?p=proweb-salaries-upload" style="position: absolute; right: 0; margin: 0 40px 0 0;"><button type="submit" class="btn btn-outline-success btn-sm"><span data-feather="file-plus"></span> Importer un fichier Excel</button></a>
+        <a href="proweb-salaries-upload.html" style="position: absolute; right: 0; margin: 0 40px 0 0;"><button type="submit" class="btn btn-outline-success btn-sm"><span data-feather="file-plus"></span> Importer un fichier Excel</button></a>
     </h2> 
 </header>
 <?php   
@@ -13,7 +13,7 @@
             "current" => "Liste des salariés", 
             "arbo" => array( 
                 "Proweb" => NULL,
-                "Liste des salariés" => "/?p=proweb-salaries")
+                "Liste des salariés" => "proweb-salaries.html")
         )); 
 ?>
 <div>

+ 6 - 0
public-cms/.htaccess

@@ -0,0 +1,6 @@
+RewriteEngine On
+RewriteBase /
+
+RewriteRule ^add\-([a-z]+)\.html$ index.php?p=$1&add=1 [L,NC,QSA,NS]
+RewriteRule ^([\-a-z]+)\.html$ index.php?p=$1 [L,NC,QSA,NS]
+RewriteRule ^([a-z]+)\-([0-9]*)\.html$ index.php?p=$1&id=$2 [L,NC,QSA,NS]

+ 2 - 0
public-cms/test.php

@@ -9,6 +9,8 @@ require_once DIR_PHP_LAYOUTS . "header.php";
 error_reporting(E_ALL);
 ini_set('display_errors', 1);
 
+core::print_r($_GET);
+
 //db::restoreBackupMysql(DIR_DATAS_BACKUP."20230428161012.Mysql.gz");
 
 /*