root / views / adminsite_view.php @ ff47f4e6
Historique | Voir | Annoter | Télécharger (5,46 ko)
1 |
<?php
|
---|---|
2 |
/************************************************************************************
|
3 |
*
|
4 |
* Projet AbulEdu Mur de Classe - Licence: GNU/Affero GPL v3 ou +
|
5 |
*
|
6 |
* (c) 2020 Frédéric Adamczak <fred@fadamczak.fr>
|
7 |
*
|
8 |
* This file is part of AbulEdu Mur de Classe.
|
9 |
*
|
10 |
* AbulEdu Mur de Classe is free software: you can redistribute it and/or modify
|
11 |
* it under the terms of the GNU Affero General Public License as published by
|
12 |
* the Free Software Foundation, either version 3 of the License, or
|
13 |
* (at your option) any later version.
|
14 |
*
|
15 |
* AbulEdu Mur de Classe is distributed in the hope that it will be useful,
|
16 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
* GNU Affero General Public License for more details.
|
19 |
*
|
20 |
* You should have received a copy of the GNU General Public License
|
21 |
* along with ClicAlbum. If not, see <https://www.gnu.org/licenses/>.
|
22 |
*
|
23 |
************************************************************************************/
|
24 |
|
25 |
function afficheSuperUser($nbMurs,$nbPublics,$nbInactifs,$murs,$requete) { |
26 |
?>
|
27 |
|
28 |
<!doctype html>
|
29 |
<html>
|
30 |
<head>
|
31 |
|
32 |
<?php include_once 'views/includes/head.php'?> |
33 |
|
34 |
<title><?= ucfirst($page) ?></title> |
35 |
</head>
|
36 |
|
37 |
<body>
|
38 |
|
39 |
<?php include_once 'views/includes/header.php'?> |
40 |
<div class="container"> |
41 |
<div class="row mt-4"> |
42 |
<div class="col-sm-3 ml-2 alert alert-primary"> |
43 |
<?=$nbMurs?> mur(s) enregistré(s) |
44 |
</div>
|
45 |
<div class="col-sm-3 ml-2 alert alert-success"> |
46 |
<p>
|
47 |
<?=$nbPublics?> mur(s) public(s) |
48 |
</p>
|
49 |
<p>
|
50 |
<?=$nbMurs-$nbPublics?> mur(s) privé(s) |
51 |
</p>
|
52 |
</div>
|
53 |
<div class="col-sm-3 ml-2 alert alert-secondary"> |
54 |
<p>
|
55 |
<?=$nbInactifs?> mur(s) inactif(s) |
56 |
</p>
|
57 |
<p id="trash"> |
58 |
<i class="fas fa-trash-alt"></i> Effacer les murs inactifs |
59 |
</p>
|
60 |
</div>
|
61 |
</div>
|
62 |
|
63 |
<hr /> |
64 |
|
65 |
<div class="row mt-4 mb-4"> |
66 |
<div class="col-sm-12"> |
67 |
<form method="post"> |
68 |
<div class="form-group"> |
69 |
<label for="sql">Requete SQL</label> |
70 |
<input type="text" class="form-control" id="sql" name="sql"> |
71 |
</div>
|
72 |
<button type="submit" class="btn btn-primary">lancer la requete</button> |
73 |
</form>
|
74 |
</div>
|
75 |
|
76 |
|
77 |
<div class="col-sm-12"> |
78 |
|
79 |
<?php
|
80 |
if (strpos($requete,"ERREUR dans la requete SQL")>0) { |
81 |
print $requete; |
82 |
} else {
|
83 |
|
84 |
print "<div class='alert alert-success mt-3 mb-2'>"; |
85 |
print "Résultats de la requete"; |
86 |
print "</div>"; |
87 |
|
88 |
print "<table class='table table-striped'>"; |
89 |
|
90 |
print "<thead>"; |
91 |
print "<tr>"; |
92 |
foreach ($requete[0] as $key => $value) { |
93 |
print "<th scope='col'>$key</th>"; |
94 |
} |
95 |
print "</tr>"; |
96 |
print "</thead>"; |
97 |
|
98 |
print "<tbody>"; |
99 |
|
100 |
foreach ($requete as $sql) { |
101 |
print "<tr>"; |
102 |
$i=0; |
103 |
foreach ($sql as $key => $value) { |
104 |
if ($i==0) { |
105 |
print "<th scope='row'>$value</th>"; |
106 |
} else {
|
107 |
print "<td>$value</td>"; |
108 |
} |
109 |
++$i;
|
110 |
} |
111 |
print "</tr>"; |
112 |
} |
113 |
print "</tbody>"; |
114 |
|
115 |
print "</table>"; |
116 |
} |
117 |
?>
|
118 |
</div>
|
119 |
</div>
|
120 |
|
121 |
<hr /> |
122 |
|
123 |
<div class="row mt-4" id="lesMurs"> |
124 |
<div class="col-sm-12"> |
125 |
<b>LISTE DES MURS</b> |
126 |
</div>
|
127 |
<table class="table table-striped"> |
128 |
<thead>
|
129 |
<tr>
|
130 |
<th scope="col">#</th> |
131 |
<th scope="col">nom</th> |
132 |
<th scope="col">slug</th> |
133 |
<th scope="col">descriptif</th> |
134 |
<th scope="col">date création</th> |
135 |
<th scope="col">dernier accès</th> |
136 |
</tr>
|
137 |
</thead>
|
138 |
<tbody>
|
139 |
<?php
|
140 |
foreach($murs as $mur) { |
141 |
print "<tr>"; |
142 |
print "<th scope='row'>".$mur->getid()."</th>"; |
143 |
print "<td>".$mur->getNom()."</td>"; |
144 |
print "<td>".$mur->getSlug()."</td>"; |
145 |
print "<td>".$mur->getDescriptif()."</td>"; |
146 |
print "<td>".$mur->getDateCreation()."</td>"; |
147 |
print "<td>".$mur->getDateAcces()."</td>"; |
148 |
print "</tr>"; |
149 |
} |
150 |
?>
|
151 |
</tbody>
|
152 |
</table>
|
153 |
</div>
|
154 |
|
155 |
</body>
|
156 |
|
157 |
<script language='javascript'> |
158 |
|
159 |
$('#trash').hover(function(){
|
160 |
$('#trash').css('cursor','pointer');
|
161 |
});
|
162 |
$('#trash').on('click',function(){
|
163 |
if (confirm("Es-tu certaint de vouloir supprimer ces murs ?") == true) {
|
164 |
console.log("on supprime les murs");
|
165 |
location.href = "_scripts/berlin1989.php";
|
166 |
}
|
167 |
});
|
168 |
|
169 |
</script>
|
170 |
</html>
|
171 |
|
172 |
<?php
|
173 |
} |
174 |
|
175 |
function afficheLoginType($msg) { |
176 |
?>
|
177 |
|
178 |
<!doctype html>
|
179 |
<html>
|
180 |
<head>
|
181 |
|
182 |
<?php include_once 'views/includes/head.php'?> |
183 |
|
184 |
<title><?= ucfirst($page) ?></title> |
185 |
</head>
|
186 |
|
187 |
<body>
|
188 |
|
189 |
<?php include_once 'views/includes/header.php'?> |
190 |
<div class="container"> |
191 |
<form method="post"> |
192 |
<?=$msg?> |
193 |
<div class="form-group"> |
194 |
<label for="mdp_su">Password</label> |
195 |
<input type="password" class="form-control" id="mdp_su" name="mdp_su"> |
196 |
</div>
|
197 |
<button type="submit" class="btn btn-primary">OK</button> |
198 |
</form>
|
199 |
</div>
|
200 |
|
201 |
</body>
|
202 |
</html>
|
203 |
|
204 |
<?php } ?> |