Bonjour à tous,

Il me reste quelques réglages à faire et je voulais savoir si on peux masquer certaines données en fonction du STATUT du membre connecté ?

Je m'explique déjà une fois connecté à l'espace profil je voudrais qu'aucun membre vois dans le menu l'intitulé "SAISIR HEURES" sauf les membres ayant le statut ADMIN.

Ensuite pour le filtre:

Si un membre ayant le STATUT : ADEQUAT connecté alors le filtre propose : le filtre entre deux date mais seulement pour l'agence ADEQUAT seulement.

Lien vers la page pour l'exemple: http://empl.ddns.net/co.php log: test mdp: test

Ma table membre s'intitule : Login avec pour infos : id/login/mdp/statut

Ma parti PHP:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
<?php
session_start();
 
$bdd = new PDO('mysql:host=localhost;dbname=EMPL','root','xxxxx');
 
if(isset($_GET['id']) AND $_GET['id'] > 0)
{
	$getid = intval($_GET['id']);
	$requser = $bdd->prepare('SELECT * FROM Login WHERE id = ?');
	$requser->execute(array($getid));
	$userinfo = $requser->fetch();
 
 
}
////procedure filtre
if (isset($_POST['Filtrer'])) {
 
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=fichier.csv");
header("Pragma: no-cache");
header("Expires: 0");
 
$cnx = new PDO('mysql:dbname=EMPL;host=localhost', 'root', 'starwars');
 
$sth = $cnx->prepare('SELECT id, nom, agence ,datex, heures FROM Heuresinterim WHERE agence = :agence AND datex BETWEEN :datedebut AND DATE_ADD(:datefin, INTERVAL 1 DAY)');
$sth->execute(array(':agence'=>$_POST['agence'], ':datedebut'=>$_POST['datedebut'], ':datefin'=>$_POST['datefin']));
 
while ($row =  $sth->fetch(PDO::FETCH_ASSOC)) {
    echo implode(';', $row) . "\r\n";
}
exit();
}
 
?>
Ma parti HTML:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
 
 
 
<html>
<header id="header" role="banner" class="main-header">
	<div class="header-inner">
 
		<div class="header-logo">
			<img src="raspbian.png" alt="empl" width="150" height="75">
		</div>
 
		<nav class="header-nav">
			<ul>
				<li><a href="index.php">Home</a></li>
				<li><a href="suite.php">Informations</a></li>
				<li><a href="co.php">Connection</a></li>
				<li><a href="saisirh.php">Saisir les heures</a></li>
 
 
			</ul>
 
		</nav>
 
	</div>
</header>
 
	<head>
	<title> EMPL</title>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="style.css" />
 
    <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#datepicker1" ).datepicker({
    	dateFormat: "yy-mm-dd"
    });
 
  });
  </script>
 
 
    <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#datepicker2" ).datepicker({
    	dateFormat: "yy-mm-dd"
    });
 
  });
  </script>
 
 
	</head>
<body>
<div id="bloc_page">
            <img src="raspbian.png" alt="Logo_page" title="Accueil" id="logo" width="340" height="140" /></div>
 
 
		<p>Bonjour: <?php echo $userinfo['login']; ?> 
		   Votre Statut: <?php echo $userinfo['statut']; ?>
		</p>
 
 
 
//
 
<p>Filtrer par date:</p>
 
<form method="post" action"">
<br>
Du: <input type="text" name="datedebut" id="datepicker1"/> Au: <input type="text" id="datepicker2" name="datefin"/> Agence:  <select name="agence" style="width:130px">
<?php
mysql_connect("localhost", "root", "xxxx");
mysql_select_db("EMPL");
 
$reponse = mysql_query("SELECT agence FROM Agence");
while ($donnees =  mysql_fetch_array($reponse))
{
?>
<option value="<?php echo $donnees['agence'] ?>"><?php echo $donnees['agence'] ?></option>
   <?php
   }
   ?>
</select>
 
 
   <input type="SUBMIT" name="Filtrer" value="FILTRER"/>
   </form>
 
</table>
 
//
//
 
 
 
<?php
if(isset($erreur))
{
	echo "<script>alert(\"Erreur \")</script>"; //echo $erreur;
}
?>
 
</body>
 
<script type="text/javascript" src="header.js"></script>
</html>
Merci encore pour le temps que vous prenez pour m'aider.