-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
executable file
·656 lines (561 loc) · 19.3 KB
/
index.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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
<?php
include_once ("config.php");
include_once ("functions.php");
include_once ("stat.php");
?>
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie ie6 no-js" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="ie ie7 no-js" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="ie ie8 no-js" lang="en"> <![endif]-->
<!--[if IE 9 ]> <html class="ie ie9 no-js" lang="en"> <![endif]-->
<!--[if gt IE 9]><!-->
<html class="no-js" lang="en" xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="https://www.facebook.com/2008/fbml">
<!--<![endif]-->
<!-- the "no-js" class is for Modernizr. -->
<!--[if lte IE 8]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta property="fb:admins" content="100001610260648,100001420300757" />
<meta property="fb:app_id" content="187783477900155" />
<title>#Permutation - ISI 2015</title>
<!-- begin facebook graphe -->
<meta property="og:title" content="#Permutation - ISI 2015" />
<meta property="og:url" content="http://www.freeways.tn/Permut-ISI/" />
<meta property="og:image"
content="resources/img/favicon.ico" />
<meta property="og:description"
content="Application web pour les demandes de permutations a l'ISI
(L'Institut Supérieur d'Informatique) " />
<!-- begin facebook graphe -->
<link rel="image_src" href="resources/img/favicon.ico" />
<meta name="author" content="Nidhal Rouissi, Anis Hosni">
<meta name="Copyleft" content="Freeways 2015. No Rights Reserved.">
<link rel="shortcut icon" href="resources/img/favicon.ico">
<link rel="stylesheet" href="resources/css/reset.css">
<link rel="stylesheet" href="resources/css/style.css">
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="resources/js/jquery.smooth-scroll.js"></script>
<script src="resources/js/jquery.easing.js"></script>
<script src="resources/js/jquery.tools.min.js"></script>
<script language="javascript">
function checkcin(){
var cin = document.getElementById('cin');
if ((cin.value.length < 8) || (cin.value.length > 8) || (isNaN(cin.value))) {
$('.insertion input[name="cin"]').css('background-color', '#FFD1D1');
return false
} else {
$('.insertion input[name="cin"]').css('background-color', '');
return true;
}
}
</script>
</head>
<body>
<a href="https://github.com/Freeways/permut">
<img style="position: absolute; top: 0; left: 0; border: 0;"
src="https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png"
alt="Fork me on GitHub">
</a>
<div class="wrapper">
<div class="chrome">
<img src="resources/img/chrome.png" title="testé avec Google Chrome 13">
</div>
<div class="firefox">
<img src="resources/img/firefox.png" title="testé avec Mozilla Firefox 40">
</div>
<div class="up">
<img src="resources/img/up.png" title="Haut de la page">
</div>
<div id="stat" align="right" style="margin-top: 5px;">
<r><?php echo $donnees['visteurtot'];?></r>
Visites -
<r><?php echo $donnees['nbre_entrees'] ?> </r>
Visiteurs connectés -
<r><?php echo $donnees['demandes'];?></r>
Demandes
</div>
<header id="header">
<center>
<div id="r">
<p>
<h1 id="logo">#Permutation</h1>
</p>
<div id="slogan">Trouver un(e) camarade pour faire une permutation</div>
</div>
<img id="s1" src="resources/img/stick.png">
<img id="s2" src="resources/img/stick.png">
<center>
</header>
<section>
<center>
<input id="avis" href="#coms" type="button" value="Votre avis">
<input id="rech" type="button" value="Rechercher">
<input id="inser" type="button"
value="Insérer une demande de permutation">
<br>
<br>
</center>
<div class="recherche">
<b>Affiner votre recherche :</b>
<br>
<br>
<center>
<form id="form2">
Nom :
<input type="text" name="nom">
- Prénom :
<input type="text" name="prenom">
- Inscrit(e) dans : -
<input type="text" name="de">
Vers :
<input type="text" name="vers">
</form>
</center>
</div>
<div class="insertion">
<b>Veuillez remplir les champs suivants :</b>
<br>
<br>
<center>
<form id="form1">
<p>
<label>Nom : </label>
<input type="text" name="nom">
</p>
<p>
<label>Prénom : </label>
<input type="text" name="prenom">
</p>
<p>
<label>
CIN
<r></r>
:
</label>
<input type="text" name="cin" id="cin" onkeyup="checkcin();">
</p>
<p>
<label>
Inscrit(e) dans
<r>*</r>
:
</label>
<datalist id="sources">
<select name="source">
<option value="1SIL1">1SIL1</option>
<option value="1SIL2">1SIL2</option>
<option value="1SIL3">1SIL3</option>
<option value="1SIL4">1SIL4</option>
<option value="1SIL5">1SIL5</option>
<option value="2SIL1">2SIL1</option>
<option value="2SIL2">2SIL2</option>
<option value="2SIL3">2SIL3</option>
<option value="2SIL4">2SIL4</option>
<option value="2SIL5">2SIL5</option>
<option value="3SIL1">3SIL1</option>
<option value="3SIL2">3SIL2</option>
<option value="3SIL3">3SIL3</option>
<option value="3SIL4">3SIL4</option>
<option value="3SIL5">3SIL5</option>
<option value="1ARS1">1ARS1</option>
<option value="1ARS2">1ARS2</option>
<option value="1ARS3">1ARS3</option>
<option value="1ARS4">1ARS4</option>
<option value="1ARS5">1ARS5</option>
<option value="2ARS1">2ARS1</option>
<option value="2ARS2">2ARS2</option>
<option value="2ARS3">2ARS3</option>
<option value="2ARS4">2ARS4</option>
<option value="2ARS5">2ARS5</option>
<option value="3ARS1">3ARS1</option>
<option value="3ARS2">3ARS2</option>
<option value="3ARS3">3ARS3</option>
<option value="3ARS4">3ARS4</option>
<option value="3ARS5">3ARS5</option>
<option value="1SE1">1SE1</option>
<option value="1SE2">1SE2</option>
<option value="1SE3">1SE3</option>
<option value="1SE4">1SE4</option>
<option value="1SE5">1SE5</option>
<option value="2SE1">2SE1</option>
<option value="2SE2">2SE2</option>
<option value="2SE3">2SE3</option>
<option value="2SE4">2SE4</option>
<option value="2SE5">2SE5</option>
<option value="3SE1">3SE1</option>
<option value="3SE2">3SE2</option>
<option value="3SE3">3SE3</option>
<option value="3SE4">3SE4</option>
<option value="3SE5">3SE5</option>
<option value="1LF1">1LF1</option>
<option value="1LF2">1LF2</option>
<option value="2LF1">2LF1</option>
<option value="1ING1">1ING1</option>
<option value="1ING2">1ING2</option>
<option value="1ING3">1ING3</option>
<option value="1ING4">1ING4</option>
<option value="2ING1">2ING1</option>
<option value="2ING2">2ING2</option>
<option value="2ING3">2ING3</option>
<option value="3GLSI1">3GLSI1</option>
<option value="3GLSI2">3GLSI2</option>
<option value="3GLSI3">3GLSI3</option>
<option value="3GTR1">3GTR1</option>
<option value="3GISI1">3GISI1</option>
</select>
</datalist>
<input type="text" id="source" name="de" list="sources">
</p>
<p>
<label>
Vers
<r>*</r>
:
</label>
<datalist id="sources">
<select name="source">
<option value="1SIL1">1SIL1</option>
<option value="1SIL2">1SIL2</option>
<option value="1SIL3">1SIL3</option>
<option value="1SIL4">1SIL4</option>
<option value="1SIL5">1SIL5</option>
<option value="2SIL1">2SIL1</option>
<option value="2SIL2">2SIL2</option>
<option value="2SIL3">2SIL3</option>
<option value="2SIL4">2SIL4</option>
<option value="2SIL5">2SIL5</option>
<option value="3SIL1">3SIL1</option>
<option value="3SIL2">3SIL2</option>
<option value="3SIL3">3SIL3</option>
<option value="3SIL4">3SIL4</option>
<option value="3SIL5">3SIL5</option>
<option value="1ARS1">1ARS1</option>
<option value="1ARS2">1ARS2</option>
<option value="1ARS3">1ARS3</option>
<option value="1ARS4">1ARS4</option>
<option value="1ARS5">1ARS5</option>
<option value="2ARS1">2ARS1</option>
<option value="2ARS2">2ARS2</option>
<option value="2ARS3">2ARS3</option>
<option value="2ARS4">2ARS4</option>
<option value="2ARS5">2ARS5</option>
<option value="3ARS1">3ARS1</option>
<option value="3ARS2">3ARS2</option>
<option value="3ARS3">3ARS3</option>
<option value="3ARS4">3ARS4</option>
<option value="3ARS5">3ARS5</option>
<option value="1SE1">1SE1</option>
<option value="1SE2">1SE2</option>
<option value="1SE3">1SE3</option>
<option value="1SE4">1SE4</option>
<option value="1SE5">1SE5</option>
<option value="2SE1">2SE1</option>
<option value="2SE2">2SE2</option>
<option value="2SE3">2SE3</option>
<option value="2SE4">2SE4</option>
<option value="2SE5">2SE5</option>
<option value="3SE1">3SE1</option>
<option value="3SE2">3SE2</option>
<option value="3SE3">3SE3</option>
<option value="3SE4">3SE4</option>
<option value="3SE5">3SE5</option>
<option value="1LF1">1LF1</option>
<option value="1LF2">1LF2</option>
<option value="2LF1">2LF1</option>
<option value="1ING1">1ING1</option>
<option value="1ING2">1ING2</option>
<option value="1ING3">1ING3</option>
<option value="1ING4">1ING4</option>
<option value="2ING1">2ING1</option>
<option value="2ING2">2ING2</option>
<option value="2ING3">2ING3</option>
<option value="3GLSI1">3GLSI1</option>
<option value="3GLSI2">3GLSI2</option>
<option value="3GLSI3">3GLSI3</option>
<option value="3GTR1">3GTR1</option>
<option value="3GISI1">3GISI1</option>
</select>
</datalist>
<input type="text" id="source" name="vers" list="sources">
</p>
<p>
<label>
Contact
<r>**</r>
:
</label>
<input type="text" name="contact">
</p>
<p id="accepte">
<input type="checkbox" name="lic" id="lic">
En ajoutant cette demande, j'accepte que mes informations seront
publiées sur cette application.
</p>
<span>
<r>*</r>
Sous la forme [1-3][SIL|ARS|SE][1-2-3] Exp : 3SIL2.
</span>
<br>
<span>
<r>**</r>
Numéro de téléphone, email ou lien vers profile facebook.
</span>
<br>
<div id="err"></div>
<input id="verif" type="button" value="Chance ?">
<input id="ajout" type="button" value="Ajouter demande">
</form>
</center>
</div>
<table name="result" id="result" cellspacing="10">
<tbody>
<tr class="th">
<th class="nom">Nom</th>
<th class="prenom">Prénom</th>
<th class="de">Inscrit(e) dans</th>
<th class="vers">Vers</th>
<th class="contact">Contact</th>
</tr>
<?php
$requete = "SELECT * from etudiant"; // requête
sql($requete);
?>
</tbody>
</table>
</div>
<br>
</section>
<section>
<center>
<fieldset id="coms">
<legend> Votre avis sur notre application </legend>
<div id="fb-root"></div>
<script>(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/fr_FR/all.js#xfbml=1";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));</script>
<fb:comments id="fbcoms"
href="http://www.freewaysclub.org/permut/index.php" num_posts="10"
width="900"></fb:comments>
</fieldset>
</center>
</section>
<footer>
<table style="height: 62px; width: 100%" border="0">
<tr>
<td>
<iframe
src="https://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffreewaysclub.org%2Fpermut%2F"
scrolling="no" frameborder="0" style="height: 62px; width: 100%"
allowTransparency="true"></iframe>
</td>
<td>
Application développée par
<a href="https://www.facebook.com/im6anis" target="_tab">Hosni Anis</a>
&
<a href="https://www.facebook.com/im.funktastik" target="_tab">Rouissi
Nidhal</a>
. Maintenu à jour par
<a href="https://www.facebook.com/sb2h0" target="_tab">Ben Hadj Hassin Salim</a>
</td>
</tr>
</table>
<center>
<a href="http://www.freeways.tn/" target="_tab">Freeways</a>
2015
<p>
<a href="http://creativecommons.org/">
<img src="resources/img/icon_cc.gif">
</a>
<a href="http://www.w3.org/">
<img src="http://www.w3.org/html/logo/downloads/HTML5_Logo_32.png">
</a>
</p>
</center>
</footer>
</div>
<script>
$(function() {
$('.chrome img, .firefox img').tooltip({
// place tooltip on the right edge
position: "center right",
// a little tweaking of the position
offset: [2, 0],
// use the built-in fadeIn/fadeOut effect
effect: "slide",
direction : "right",
bounce : "true"
});
$('.up img').tooltip({
// place tooltip on the right edge
position: "center left",
// a little tweaking of the position
offset: [0, 0],
// use the built-in fadeIn/fadeOut effect
effect: "slide",
direction : "left",
bounce : "true"
});
$('#avis').bind('click',function(event){
$('html, body').stop().animate({
scrollTop: $("#coms").offset().top
}, 1500,'easeInOutExpo');
event.preventDefault();
});
$('.up').bind('click',function(event){
$('html, body').stop().animate({
scrollTop: 0
}, 1500,'easeInOutExpo');
event.preventDefault();
});
});
$(".recherche").hide();
$(".insertion").hide();
$("#rech").click(function (){
$(".insertion").slideUp(500);
$(".recherche").slideToggle(500);
});
$("#inser").click(function (){
$(".recherche").slideUp(500);
$(".insertion").slideToggle(500);
});
// Recherche asynchrone - AJAX
$('.recherche input').keyup(function () {
var nom = $('.recherche input[name="nom"]').val();
var prenom = $('.recherche input[name="prenom"]').val();
var de = $('.recherche input[name="de"]').val();
var vers = $('.recherche input[name="vers"]').val();
$('#result tr:not(.th), #result td').remove();
$('#result > tbody').append(' <td colspan="5"><center><img src="resources/img/load.gif"></center></td>');
$.ajax({
type: "POST",
url: "filtre.php",
data: { nom: $('.recherche input[name="nom"]').val(),
prenom: $('.recherche input[name="prenom"]').val(),
from: $('.recherche input[name="de"]').val(),
to: $('.recherche input[name="vers"]').val(),
},
success: function(msg){
if (msg == 0)
{
$('#result tr:not(.th), #result td').remove();
$('#result > tbody').append(' <td colspan="5"><center><div class="none1">Aucun résultat trouvé !</div></center></td>');
}
else{
$('#result tr:not(.th), #result td').remove();
$('#result > tbody').append(msg);
}
}
});
});
// verification d'une nouvelle demande - AJAX
$("#verif").click(function (){
var nom = $('.insertion input[name="nom"]').val();
var prenom = $('.insertion input[name="prenom"]').val();
var cin = $('.insertion input[name="cin"]').val();
var de = $('.insertion input[name="de"]').val();
var vers = $('.insertion input[name="vers"]').val();
var contact = $('.insertion input[name="contact"]').val();
$('#result tr:not(.th), #result td').remove();
$('#result > tbody').append(' <td colspan="5"><center><img src="resources/img/load.gif"></center></td>');
$.ajax({
type: "POST",
url: "inscri.php",
data: { nom: $('.insertion input[name="nom"]').val(),
prenom: $('.insertion input[name="prenom"]').val(),
from: $('.insertion input[name="de"]').val(),
to: $('.insertion input[name="vers"]').val(),
cin: $('.insertion input[name="cin"]').val(),
contact: $('.insertion input[name="contact"]').val(),
act:"1"
},
success: function(msg){
if (msg == 1) {$('#err').html("<p> Erreurs de saisie ! <p>"); $('#result tr:not(.th), #result td').remove(); }
else{
if (msg == 0)
{
$('#result tr:not(.th), #result td').remove();
$('#result > tbody').append(' <td colspan="5"><center><div class="none2">Aucun résultat compatible trouvé !</div></center></td>');
$('#err').html("");
}
else{
$('#result tr:not(.th), #result td').remove();
$('#result > tbody').append(msg);
$('#err').html("");
}
}
}
});
});
// Insertion d'une nouvelle demande - AJAX
$("#ajout").click(function (){
var nom = $('.insertion input[name="nom"]').val();
var prenom = $('.insertion input[name="prenom"]').val();
var cin = $('.insertion input[name="cin"]').val();
var de = $('.insertion input[name="de"]').val();
var vers = $('.insertion input[name="vers"]').val();
var contact = $('.insertion input[name="contact"]').val();
var lic = $('.insertion input[name="lic"]').attr('checked');
if (lic==undefined) { $('#err').html("<p> Vous devez accepter les conditions d'utilisation ! <p>");
return false; }
$.ajax({
type: "POST",
url: "inscri.php",
data: { nom: $('.insertion input[name="nom"]').val(),
prenom: $('.insertion input[name="prenom"]').val(),
from: $('.insertion input[name="de"]').val(),
to: $('.insertion input[name="vers"]').val(),
cin: $('.insertion input[name="cin"]').val(),
contact: $('.insertion input[name="contact"]').val(),
},
success: function(msg){
if (msg == 1) $('#err').html("<p> Erreurs de saisie ! <p>");
else{
$('#result tr:not(.th), #result td').remove();
$('#result > tbody').append(msg);
$('#err').html("");
}
}
});
});
// Recherche asynchrone - AJAX on click button recherche
$("#rech").click(function (){
var nom = $('.recherche input[name="nom"]').val();
var prenom = $('.recherche input[name="prenom"]').val();
var de = $('.recherche input[name="de"]').val();
var vers = $('.recherche input[name="vers"]').val();
$.ajax({
type: "POST",
url: "filtre.php",
data: { nom: $('.recherche input[name="nom"]').val(),
prenom: $('.recherche input[name="prenom"]').val(),
from: $('.recherche input[name="de"]').val(),
to: $('.recherche input[name="vers"]').val(),
},
success: function(msg){
if (msg == 0)
{
$('#result tr:not(.th), #result td').remove();
$('#result > tbody').append(' <td colspan="5"><center><div class="none1">Aucun résultat trouvé !</div></center></td>');
}
else{
$('#result tr:not(.th), #result td').remove();
$('#result > tbody').append(msg);
}
}
});
});
if (document.images) {
img1 = new Image();
img1.src = "resources/img/load.gif";
}
</script>
</body>
</html>