-
Notifications
You must be signed in to change notification settings - Fork 0
/
modifier-grp-par.php
218 lines (179 loc) · 8.08 KB
/
modifier-grp-par.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
<?php
$bdd= new PDO("mysql:host=localhost;dbname=gss;charset=utf8","root","");
$conn = mysqli_connect("localhost", "root", "", "gss");
$id = $_GET['modu'];
$sql = 'SELECT * FROM `groupe-admin` WHERE `idadmin`=:id';
$statement = $bdd->prepare($sql);
$statement->execute([':id' => $id]);
$admin = $statement->fetch(PDO::FETCH_OBJ);
##########################################
if (isset($_POST['mod'])) {
if(!empty(trim($_POST['ida']))){
$requete=$bdd->prepare('UPDATE `groupe-admin` SET `idadmin`=?,`nom`=?,`type`=?, `service`=?,`motdepasse`=? ,`description`=?
WHERE `idadmin`=?');
$requete->execute(array($_POST['ida'],$_POST['nom'],$_POST['type'],$_POST['ser'],$_POST['mdp'],$_POST['des'],$id));
$requete1=$requete->fetch();
echo '<script>alert("la modification est bien effectuée");</script>';
}
if (isset($_POST['ida'])) {
$query ="SELECT * FROM `groupe-admin` WHERE `idadmin` ='".$_POST['ida']."'";
$stat = $bdd->query($query);
$tab = $stat->fetchAll ();
foreach($tab as $row)
{
$i=$row["serveur_idserveur"];
}
header("Location:grp-par.php?adminap=$i");}
else{
$query ="SELECT * FROM `groupe-admin` WHERE `idadmin` ='".$_GET['modu']."'";
$stat = $bdd->query($query);
$tab = $stat->fetchAll ();
foreach($tab as $row)
{
$i=$row["serveur_idserveur"];
}
header("Location:grp-par.php?adminap=$i");
}
}
?>
<!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" />
<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-admin` WHERE `idadmin` ='".$_GET['modu']."'";
$stat = $bdd->query($query);
$tab = $stat->fetchAll ();
foreach($tab as $row)
{
$n=$row["serveur_idserveur"];
} echo '<li style="margin-right:3px;"><a href="grp-par.php?adminap='.$n.'" 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 class="row" >
<div class="col-md-4">
</div>
<div class="col-md-4">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="padding:35px 50px; background-color:#2B3856;">
<h4 style="font-size:20px;color:white;text-align: center;"><i><b>modifier le groupe d'admin</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="ida" required value="<?= $admin->idadmin;?>" >
</div>
<div class="form-group">
<label for="usrname">NOM</label>
<input type="text" class="form-control" placeholder="nom" name="nom" value="<?= $admin->nom;?>" >
</div>
<div class="form-group">
<label for="usrname">SERVICE</label>
<select class="form-control" name="ser" value="<?= $admin->service;?>">
<option>Système et sécurité</option>
<option>Support informatique</option>
<option>Data management</option>
<option>Infrastructure</option>
<option>Patrimoine data</option>
</select>
</div></br>
<div class="form-group">
<label for="usrname">TYPE</label>
<input type="text" class="form-control" placeholder="type" name="type" value="<?= $admin->type;?>" >
</div></br>
<div class="form-group">
<label for="usrname">DESCRIPTION</label>
<input type="text" class="form-control" placeholder="description" name="des" value="<?= $admin->description;?>">
</div>
<div class="form-group">
<label for="usrname">MOT DE PASSE</label>
<input type="text" class="form-control" placeholder="mdp" name="mdp" required value="<?= $admin->motdepasse;?>">
</div>
<button type="submit" class="btn btn-success" name="mod">Modifier</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>
<!-- 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>