-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmembre.php
315 lines (256 loc) · 11.9 KB
/
membre.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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<?php
$bdd= new PDO("mysql:host=localhost;dbname=gss;charset=utf8","root","");
$conn = mysqli_connect("localhost", "root", "", "gss");
if (isset($_POST['envoi']) ){
$id = $_GET['mem'];
if( !empty(trim($_POST['id'])))
{
$recherche="
SELECT `idmembre` FROM `membre` WHERE `idmembre`='".$_POST['id']."'";
$rs=mysqli_query($conn,$recherche);
if(mysqli_num_rows($rs)>0){
echo "<script> alert('tu peux pas ajouter ce member deux fois'); </script> ";
}
if (mysqli_num_rows($rs)<=0) {
$requete=$bdd->prepare('INSERT INTO `membre`(`idmembre`, `nom`, `motdepasse`,`groupepartage_idgrppartage`) VALUES (?,?,?,?)');
$requete->execute(array($_POST['id'],$_POST['nom'],$_POST['mdp'],$id));
$requete1=$requete->fetch();
echo "<script>alert('le member a ete bien ajouter');</script>";
}
}
header("Location:membre.php?mem=$id");
}
?>
<!DOCTYPE html>
<html style="font-size: 85%;">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GSS</title>
<link href="css1/bootstrap1.css" rel="stylesheet" />
<link href="css1/style1.css" rel="stylesheet" />
<link rel="icon" type="image/png" href="images/icons/favicon.ico"/>
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto+Slab:400,700,300,100">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,400italic,300italic,300,500,500italic,700,900">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/font-awesome.css">
<link rel="stylesheet" href="css/animate.css">
<link rel="stylesheet" href="css/templatemo-misc.css">
<link rel="stylesheet" href="css/templatemo-style0.css">
<script src="js/vendor/modernizr-2.6.1-respond-1.1.0.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
<link href="js1/dataTables/dataTables.bootstrap.css" rel="stylesheet" />
<!--AJAX-->
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<!--<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css" /> -->
<script rel="stylesheet" href="vendor/bootstrap/js/bootstrap.min.js"></script>
<style type="text/css">
a.btn-left, .top-header .social-top ul li a, .main-header .menu-wrapper a.toggle-menu {
border: 2px solid #5E7D7E;
border-radius: 40%;}
</style>
</head>
<body>
<section id="pageloader">
<div class="loader-item fa fa-spin colored-border"></div>
</section>
<header class="site-header container-fluid">
<div class="top-header">
<div style="padding: 5px 0 5px 5px;"> <img src="images/logo.png" width="100px" height="100px" ></div>
<div class="social-top" col-md-6 col-sm-6>
<ul>
<?php
$query ="SELECT * FROM `groupe-partage` JOIN `membre` WHERE `idgrppartage` LIKE`groupepartage_idgrppartage` AND `idgrppartage`=
'".$_GET['mem']."'";
$stat = $bdd->query($query);
$tab = $stat->fetchAll ();
foreach($tab as $row)
{
$i=$row["fichier partage_idfichierpartage"];
}
$recherche1="SELECT * FROM `groupe-partage` JOIN `membre` WHERE `idgrppartage` LIKE`groupepartage_idgrppartage` AND `idgrppartage`=
'".$_GET['mem']."'";
$rs1=mysqli_query($conn,$recherche1);
if(mysqli_num_rows($rs1)>0){
echo '<li style="margin-right:3px;"><a href="groupe-par.php?fif='.$i.'" class="fa fa-angle-left" title="Précédent" ></a></li>';
}
else{echo '<li style="margin-right:3px;"><a href="#" class="fa fa-angle-left" title="Précédent" ></a></li>';}
session_start();
$r=session_id();
if (strcmp( $_SESSION['type'], "Admin") == 0) {
echo '<li style="margin-right:3px;"><a href="interfaceadmin.php" class="fa fa-home" title="Accueil" ></a></li>';
echo '<li><a href="liste-compte.php" class="fa fa-users" title="Comptes" ></a></li>';
}
if (strcmp( $_SESSION['type'], "User") == 0) {
echo '<li><a href="interfaceuser.php" class="fa fa-home" title="Accueil"></a></li>';
}
?>
<li><a href="profile.php" class="fa fa-user" title="Profile"></a></li>
<li><a href="msg.php" class="fa fa-envelope" title="G-mail"></a></li>
<li><a href="statistiques.php" class="fa fa-signal" title="Statistiques"></a></li>
<li><a href="deconecte.php" class="fa fa-sign-out" title="Déconnexion"></a></li>
</ul>
</div>
</div>
</header>
<div id="wrapper">
<div id="page-inner">
<div style="margin-left: 1400px;">
<button type="button" data-toggle="modal" data-target="#myModala"style="padding:1px 1px 1px 1px; border-radius: 30%;">
<img style="width:28px;height:26px; border-radius: 50% ;" src="img/add.png">
</button>
<button type="button" name="btn_delete" id="btn_delete" style="padding:1px 1px 1px 1px; border-radius: 30%;">
<img style="width:28px;height:26px; border-radius: 50% ;" src="img/delete.png">
</button>
</div>
<div style="text-align: center; color: #2b3856;">
<b style="font-size:40px;"> MEMBRES DU GROUPE</b></div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body">
<div class="table-responsive" style="overflow-x:scroll;">
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead style="color:#2b3856;">
<tr>
<?php
if (strcmp( $_SESSION['type'], "Admin") == 0) {
echo '<th><img style="width:26px;height:24px; "
src="img/trash.png"></th>' ; } ?>
<th>ID</th>
<th>Nom</th>
<?php
if (strcmp( $_SESSION['type'], "Admin") == 0) {
echo '<th>Mot De Passe</th>' ; } ?>
<?php
if (strcmp( $_SESSION['type'], "Admin") == 0) {
echo '<th><i class="fa fa-pencil"></i></th>' ; } ?>
</tr>
</thead>
<tbody>
<?php
$bdd= new PDO("mysql:host=localhost;dbname=gss;charset=utf8","root","");
$conn = mysqli_connect("localhost", "root", "", "gss");
$query = "SELECT * FROM `membre` WHERE `groupepartage_idgrppartage`= ".$_GET['mem']." " ;
$stat = $bdd->query($query);
$tab = $stat->fetchAll ();
foreach($tab as $row)
{
echo "<tr>";
if (strcmp( $_SESSION['type'], "Admin") == 0) {echo '<td> <input type="checkbox" name="chc[]" value="'.$row["idmembre"]; echo'"> </td>';}
echo '<td>' .$row["idmembre"]; echo '</td>';
echo '<td>' .$row["nom"] ;echo '</td>';
if (strcmp( $_SESSION['type'], "Admin") == 0) {echo '<td>'.$row["motdepasse"] ;echo'</td>';}
if (strcmp( $_SESSION['type'], "Admin") == 0) {echo '<td> <a href="modifier-membre.php?mm='.$row["idmembre"].'" data-toggle="modal1" data-target="#my">
<img style="width:33px;height:30px; border-radius: 50% ;" src="img/edit.png"></button></td>';}
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$('#btn_delete').click(function(){
if(confirm("Voulez-vous vraiment supprimer ces informations?"))
{
var id = [];
$(':checkbox:checked').each(function(i){
id[i] = $(this).val();
});
if(id.length === 0) //tell you if the array is empty
{
alert("Sélectionner un élément!!!");
}
else
{
$.ajax({
url:'supprimer-membre.php',
method:'POST',
data:{id:id},
success:function()
{
location.reload();
}
});
}
}
else
{
return false;
}
});
});
</script>
<div class="row">
<div class="col-md-6">
<div class="modal fade" id="myModala" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
style="margin-top:5%;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="padding:35px 50px; background-color:#2B3856;">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 style="font-size:20px;color:white;text-align: center;"><span class="fa fa-user-plus"></span><i><b>Ajouter Membre </b></i></h4></div>
<div class="modal-body" style="padding:40px 50px;">
<form role="form" action="" method="post">
<div class="form-group">
<label for="usrname">ID</label>
<input type="text" class="form-control" placeholder="id" name="id" required>
</div>
<div class="form-group">
<label for="usrname"> NOM</label>
<input type="text" class="form-control" placeholder="nom" name="nom" required>
</div>
<div class="form-group">
<label for="usrname">MOT DE PASSE</label>
<input type="text" class="form-control" placeholder="mdp" name="mdp" required>
</div>
<button type="submit" class="btn btn-success" name="envoi"> Ajouter</button>
<br><br>
<button type="submit" class="btn btn-danger btn-default pull-left" data-dismiss="modal">Annuler</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
<!-- JQUERY SCRIPTS -->
<script src="js1/jquery-1.10.2.js"></script>
<!-- BOOTSTRAP SCRIPTS -->
<script src="js1/bootstrap.min.js"></script>
<!-- METISMENU SCRIPTS -->
<script src="js1/jquery.metisMenu.js"></script>
<!-- DATA TABLE SCRIPTS -->
<script src="js1/dataTables/jquery.dataTables.js"></script>
<script src="js1/dataTables/dataTables.bootstrap.js"></script>
<script>
$(document).ready(function () {
$('#dataTables-example').dataTable();
});
</script>
<!-- Preloader -->
<script type="text/javascript">
//<![CDATA[
$(window).load(function() { // makes sure the whole site is loaded
$('.loader-item').fadeOut(); // will first fade out the loading animation
$('#pageloader').delay(350).fadeOut('slow'); // will fade out the white DIV that covers the website.
$('body').delay(350).css({'overflow-y':'visible'});
})
//]]>
</script>
<!-- CUSTOM SCRIPTS -->
<script src="js1/custom.js"></script>
</body>
</html>