-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
39 lines (36 loc) · 1.37 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
// Permets de ne pas afficher les notices mais seulement les erreurs
define ("DEBUG", true);
// Si on est entrain de bosser sans DEBUG, on affiche juste les erreurs
//ini_set('display_errors', 1);
error_reporting(E_ALL & ~E_NOTICE);
//error_reporting(E_ERROR);
// Si on est en DEBUG on affiche TOUT
if (DEBUG == true):
error_reporting(E_ALL);
endif;
// DEBUG (tjrs mettre en maj) est une constante qui est du coup
//définie par la fct define
function debug(){
if (DEBUG == true) :
// balise pre = preformaté
echo '<div id="debug" style="border:1px solid black; padding:8px; background-color: gold">';
echo "<pre>";
echo "<strong>GET</strong> <br>";
print_r($_GET);
echo "<strong>POST</strong> <br>";
print_r($_POST);
echo "<strong>SESSION</strong> <br>";
print_r($_SESSION);
//echo "<strong>SESSION ROLE</strong> <br>";
//print_r($_SESSION['role']);
echo "</pre>";
echo "</div>";
endif;
}
// Gestion de class current dans navigation header.php
function myCurrent($page){
if (isset($_GET['page']) ):
echo($_GET['page'] == $page) ? ' class="current" ' : '';
endif;
}