Explorar el Código

Page historique

stany.ferer hace 2 años
padre
commit
2e288c5396

+ 5 - 1
core/class/historique.class.php

@@ -6,10 +6,12 @@ class historique
         db::query("SELECT "
                 . "" . DB_T_HISTORIQUE . ".id, "
                 . "" . DB_T_HISTORIQUE . ".idUser ,"
+                . "CONCAT (" . DB_T_USER . ".prenom, ' ', " . DB_T_USER . ".nom) AS 'user' ,"
                 . "" . DB_T_HISTORIQUE . ".idPage, "
                 . "" . DB_T_HISTORIQUE . ".log, "
                 . "" . DB_T_HISTORIQUE . ".addDate "
-                . "FROM " . DB_T_HISTORIQUE);
+                . "FROM " . DB_T_HISTORIQUE . " "
+                . "INNER JOIN " . DB_T_USER . " ON " . DB_T_HISTORIQUE . ".idUser = " . DB_T_USER . ".id ");
         return db::resultset();
     }
 
@@ -17,9 +19,11 @@ class historique
         db::query("SELECT "
                 . "" . DB_T_HISTORIQUE . ".id, "
                 . "" . DB_T_HISTORIQUE . ".idUser ,"
+                . "CONCAT (" . DB_T_USER . ".prenom, ' ', " . DB_T_USER . ".nom) AS 'user' ,"
                 . "" . DB_T_HISTORIQUE . ".log, "
                 . "" . DB_T_HISTORIQUE . ".addDate "
                 . "FROM " . DB_T_HISTORIQUE . " "
+                . "INNER JOIN " . DB_T_USER . " ON " . DB_T_HISTORIQUE . ".idUser = " . DB_T_USER . ".id "
                 . "WHERE " . DB_T_HISTORIQUE . ".idPage = :idPage");
         db::bind(':idPage', $_idPage);
         return db::resultset();

+ 10 - 0
core/json/cms.historique.php

@@ -0,0 +1,10 @@
+<?php 
+
+$row = historique::getAll();
+if (!empty($row)) {
+    $row[0]["log"] = nl2br($row[0]["log"]);
+    echo json_encode($row);
+    exit();
+} else {
+    exit();
+}

+ 1 - 0
core/views/_cms.menu.php

@@ -38,6 +38,7 @@
                 if(session::accessUserByType(1)){ 
                     core::elementMenuH6("Administration");
                     core::elementMenu("parametres", "/parametres.html", "IT : Paramètres", "tool"); 
+                    core::elementMenu("historique", "/historique.html", "IT : Historique", "activity"); 
                 }
                 
             ?>

+ 40 - 0
core/views/pages/cms.historique.php

@@ -0,0 +1,40 @@
+
+<header class="d-flex flex-column flex-md-row align-items-md-center p-3 bg-light ">
+<h2 class="bd-title" id="content">
+    <span>Historique</span>
+</h2>
+</header>
+<?php   
+        echo core::filAriane(array(
+            "current" => "IT : Historique", 
+            "arbo" => array( 
+                "Administration" => NULL,
+                "IT : Historique" => "/historique.html")
+        )); 
+?>
+<div>
+    <table
+        id="table"
+        class="table-striped table-hover table-sm" 
+        data-page-size="25"
+        data-toggle="table"
+        data-show-columns="true"
+        data-search="true"
+        data-buttons-align="left"
+        data-pagination="true"
+        data-filter-control="true"
+        data-flat="true"
+        data-sort-name="cree"
+        data-sort-order="desc"
+        data-url="/json.php?jsonData=historique">
+        <thead>
+            <tr>
+                <th data-sortable="true" data-field="addDate" data-filter-control="input" data-width="160"></th>
+                <th data-sortable="true" data-field="idPage" data-filter-control="input" data-width="250">Page</th>
+                <th data-sortable="true" data-field="log" data-filter-control="input">Log</th>
+                <th data-sortable="true" data-field="user" data-filter-control="input" data-width="160">Utilisateur</th>
+            </tr>
+        </thead>
+    </table> 
+</div>
+