-
Notifications
You must be signed in to change notification settings - Fork 1
/
tableau.php
executable file
·370 lines (323 loc) · 11.7 KB
/
tableau.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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
<?php
//erreur sur l'ajout----------------------------------------------------------------------------------------------------
require('connect_bdd.php');
if (isset($_GET['erreur'])){
if ($_GET['erreur'] == 'true') {
$erreur = 'Solonanarana na tenimiafina diso';
}
}
//mamafa---------------------------------------------------------------------------------------------------------------
if (isset($_GET['succes'])){
if ($_GET['succes'] == 'true') {
$succes = 'Voafafa tsara ilay fanafody';
$succesx = 'x';
}
}
//erreur reference----------------------------------------------------------------------------------------------------
if (isset($_GET['erreur_ref_ana_mitov'])){
if ($_GET['erreur_ref_ana_mitov'] == 'true') {
$err_jiab = 'Efa misy io famantarana na io anarana io';
}
}
//erreur isa----------------------------------------------------------------------------------------------------------
if (isset($_GET['erreur_isa'])){
if ($_GET['erreur_isa'] == 'true') {
$err_jiab = "Hamarino tsara ny isan'ny fanafody nampidirinao";
}
}
//erreur vidy----------------------------------------------------------------------------------------------------------
if (isset($_GET['erreur_vola'])){
if ($_GET['erreur_vola'] == 'true') {
$err_jiab = "Hamarino tsara ny vidin'ny fanafody nampidirinao";
}
}
if (isset($_GET['erreur_reference_int'])){
if ($_GET['erreur_reference_int'] == 'true') {
$err_jiab = "Hamarino tsara ny vidin'ny fanafody nampidirinao";
}
}
//session_start--------------------------------------------------------------------------------------------------------
session_start();
if (isset($_SESSION['solonanarana'] )) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Stock | Pharmacetica</title>
<link rel="icon" type="image/png" href="public/img/pharmacie_icone-1.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="public/css/font-awesome.min.css">
<link rel="stylesheet" href="public/css/bootstrap.min.css">
<link rel="stylesheet" href="public/css/pharmacie.css">
<link rel="stylesheet" href="public/css/modal_succes_supp.css">
<script src="public/js/jquery.min.js"></script>
<script src="public/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
// Activate tooltip
$('[data-toggle="tooltip"]').tooltip();
// Select/Deselect checkboxes
var checkbox = $('table tbody input[type="checkbox"]');
$("#selectAll").click(function(){
if(this.checked){
checkbox.each(function(){
this.checked = true;
});
} else{
checkbox.each(function(){
this.checked = false;
});
}
});
checkbox.click(function(){
if(!this.checked){
$("#selectAll").prop("checked", false);
}
});
});
</script>
</head>
<style>
body{
font-family: Poppins !important;
}
</style>
<body onclick=pageb()>
<<<<<<< HEAD
=======
<?php
gettype($err_jiab);
echo($err_jiab);
?>
>>>>>>> 79f658af49ee9d4d466415fb72a3041f2f0d0b7a
<div class="container">
<div class="table-wrapper">
<div class="table-title">
<div class="row">
<div class="col-sm-6">
<h2>Ireo Fanafody</h2>
</div>
<div class="col-sm-6">
<a href="#addEmployeeModal" class="btn btn-success" data-toggle="modal" ><i class="material-icons"></i> <span >Hampiditra fanafody</span></a>
<a href="upload.html" class="btn btn-success" ><i class="material-icons"></i> <span >Varotra </span></a>
</div>
</div>
</div>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Famantarana</th>
<th>Anarana</th>
<th>Vidin'ny iray</th>
<th>Isan'ny voafandrika</th>
<th>Sisa</th>
<th>Isan'ny fanafody</th>
<th>Hanova</th>
</tr>
</thead>
<tbody>
<?php
$tab = $_SESSION["tab"] ;
$unit = 'Ar';
for($i=0; $i<$_SESSION["nbr"]; $i++){
$id = $tab[$i]['id'];
$nom = $tab[$i]['nom'];
$prix_unit = $tab[$i]['prix_unit'];
$nombre = $tab[$i]['nombre'];
$nc = $tab[$i]['nombre_commande'];
?>
<tr>
<td> <?=$tab[$i]['id'] ?></td>
<td> <?=$tab[$i]['nom'] ?></td>
<td> <?=$tab[$i]['prix_unit'] ; echo' '; echo $unit;?></td>
<td> <?=$tab[$i]['nombre_commande'] ?></td>
<td> <?=$tab[$i]['nombre'] ?></td>
<td> <?=$tab[$i]['nombre'] ?></td>
<td>
<a href="#eModal<?=$id?>" class="edit" data-toggle="modal"><i class="material-icons" data-toggle="tooltip" title="Edit"></i></a>
<a href="#deleteEmployeeModal<?=$id?>" class="delete" data-toggle="modal"><i class="material-icons" data-toggle="tooltip" title="Delete"></i></a>
</td>
<!-- Delete Modal HTML -->
<div id="deleteEmployeeModal<?=$id?>" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<form value ="<?=$id?>" method="POST" id="forfa">
<div class="modal-header">
<h4 class="modal-title">Hamafa fanafody</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<p>Hofafana marina ve io fanafody io ?</p>
<p class="text-warning"><small>Tsy afaka averina intsony io raha voafafa !</small></p>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Hajanona">
<span ><input id="<?=$id?>" type="button" onclick="cacherform($(this).attr('id'))" class="btn btn-danger" value="Fafana" > </span>
</div>
</form>
</div>
</div>
</div>
<!-- Hanova ny mahakasika ilay fanafody -->
<div id="eModal<?=$id?>" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<form id='mod<?=$id?>'>
<div class="modal-header">
<h4 class="modal-title">Hanova fanafody</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Famantarana</label>
<input type="text" class="form-control" id="refer_v" disabled="disabled" name ="ref_v" value="<?=$id?>" required>
</div>
<div class="form-group">
<label>Anarana</label>
<input type="text" class="form-control" id="anar_v" name ="anarana_v" disabled="disabled" value="<?=$nom?>" required>
</div>
<div class="form-group">
<label>Isan'ny fanafody</label>
<input type="text" class="form-control" id="isani_v" name="isa_amp_v" value="<?=$nombre?>" required>
</div>
<div class="form-group">
<label>Vidin'ny iray</label>
<input type="text" class="form-control" id="vidin_v" name="vidin_irai_v" value="<?=$prix_unit?>" required>
</div>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Hajanona">
<input type="button" id=<?=$id?> onclick="modimed($(this).attr('id'))" class="btn btn-info" name="manova" value="Hanova">
</div>
<div class="form-group">
<label style="color:red !important; margin-left:15% !important;" id="notis"></label>
</div>
</form>
</div>
</div>
</div>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!-- Edit Modal HTML -->
<div id="addEmployeeModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<form action="server.php" method="POST" id="forma">
<div class="modal-header">
<h4 class="modal-title">Hampiditra fanafody</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Famantarana</label>
<input type="text" id= "refer" class="form-control" name ="ref" required>
</div>
<div class="form-group">
<label>Anarana</label>
<input type="text" id="anar" class="form-control" name ="anarana" required>
</div>
<div class="form-group">
<label>Isan'ny fanafody</label>
<input type="text" id="isani" class="form-control" name="isa_amp" required>
</div>
<div class="form-group">
<label>Vidin'ny iray</label>
<input type="text" id="vidini" class="form-control" name="vidin_irai" required>
</div>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Hajanona">
<input type="button" onclick=ajoumed() class="btn btn-success" name="ampidiro" value="Ampidirina">
</div>
<div class="form-group">
<label style="color:red !important; margin-left:15% !important;" id="notis"></label>
</div>
</form>
</div>
</div>
</div>
<!-- Voafafa tsara ilay fanafody -->
<div id="myModal" class="modal fade">
<div class="modal-dialog modal-confirm">
<div class="modal-content">
<div class="modal-header">
<div class="icon-box" onclick=vita()>
<i class="material-icons"></i>
</div>
<h4 class="" style="text-align: center !important">Vita!</h4>
</div>
<div class="modal-body">
<p class="text-center"> Voafafa tsara ilay fanafody</p>
</div>
<div class="modal-footer">
<button class="btn btn-success btn-block" data-dismiss="modal" onclick=vita()>Okay</button>
</div>
</div>
</div>
</div>
<!-- Tafiditra tsara ilay fanafody -->
<div id="myModalt" class="modal fade">
<div class="modal-dialog modal-confirm">
<div class="modal-content">
<div class="modal-header">
<div class="icon-box" onclick=vita()>
<i class="material-icons"></i>
</div>
<h4 class="" style="text-align: center !important">Vita!</h4>
</div>
<div class="modal-body">
<p class="text-center"> Tafiditra tsara ilay fanafody</p>
</div>
<div class="modal-footer">
<button class="btn btn-success btn-block" data-dismiss="modal" onclick=vita()>Okay</button>
</div>
</div>
</div>
</div>
<!-- Voaova tsara ilay fanafody -->
<div id="myModalh" class="modal fade">
<div class="modal-dialog modal-confirm">
<div class="modal-content">
<div class="modal-header">
<div class="icon-box" onclick=vita()>
<i class="material-icons"></i>
</div>
<h4 class="" style="text-align: center !important">Vita!</h4>
</div>
<div class="modal-body">
<p class="text-center"> Voaova tsara ilay fanafody</p>
</div>
<div class="modal-footer">
<button class="btn btn-success btn-block" data-dismiss="modal" onclick=vita()>Okay</button>
</div>
</div>
</div>
</div>
<footer class="footer" data-background-color="black">
<div class="container">
<div class="copyright float-right">
©
<script>
document.write(new Date().getFullYear())
</script>, edited by Landris.
</div>
</div>
</footer>
<button> <a href="server.php?deconnection"> Déconnexion </a> </button>
<script src="tableau.js"></script>
</body>
</html>
<?php
}
?>