/
clients.php
executable file
·624 lines (569 loc) · 25.7 KB
/
clients.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
<?php
require_once('headers.php');
require_once('global_functions.php');
require_once('clients_top.php');
(isset($_GET['edit']) ? $edit="&edit=".$_GET['edit'] : $edit="");
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<?php echo $title.$icon.$charset.$defaultcss.$chromecss.$clientjs.$retrieve_rues_js.$graburljs.$jquery.$jqueryui.$message_div.$compte_div.$kids_valid ?>
<link rel="stylesheet" href="chosen/chosen.css" />
<script src="chosen/chosen.jquery.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.ui.datepicker-fr.js"></script>
<script type="text/javascript">
<? print "var listclasses = ".json_encode(buildOptionsClasses()).";\n"; ?>
/////////////////////////////////////jquery start here /////////////////////////////////
$(document).ready(function() {
checkexist($('#txt_DateNaissance').val(), $('#txt_Nom').val(), $('#txt_Prenom').val());
showSubmitResult();
showCompte(<?php echo '"' . $arCompte[0] . '", "' . $arCompte[1] . '", "' . $arCompte[2] . '"' ?>);
var edit = gup('edit');
$("#opaquediv").hide();
$('.reject').hide();
$('#historique').hide();
$('#avoirs').hide();
$('#showreject').hide();
$("#slt_status_periode").hide();
if (edit>0){
$('#divhistorique').show();
$('#divavoirs').show();
$('#divconjoint').load('conjoint.php?id='+edit, function(){
$("#box_conjoint").chosen();
$("button").button();
});
$('#divconjoint').show();
}else{
$('#divhistorique').hide();
$('#divavoirs').hide();
$('#accounttoggle').hide();
$('#divconjoint').hide();
}
$('#showreject').click( function() {
$('.reject').toggle();
if ($('#showreject').text()=='Afficher les rejets'){
$('#showreject').button('option','label','Cacher les rejets');
}else{
$('#showreject').button('option','label','Afficher les rejets');
}
});
$('#togglehistory').click( function() {
$('#historique').slideToggle();
if ($('#togglehistory').text()=='Afficher'){
$('#togglehistory').button('option','label','Cacher');
$('#showreject').show();
}else{
$('#togglehistory').button('option','label','Afficher');
$('#showreject').hide();
}
scrolldown();
});
$('#toggleavoirs').click( function() {
$('#avoirs').slideToggle();
if ($('#toggleavoirs').text()=='Afficher'){
$('#toggleavoirs').button('option','label','Cacher');
}else{
$('#toggleavoirs').button('option','label','Afficher');
}
scrolldown();
})
$('#toggleaccount').click( function() {
$('#compte').slideToggle();
if ($('#toggleaccount').text()=='Afficher'){
$('#toggleaccount').button('option','label','Cacher');
}else{
$('#toggleaccount').button('option','label','Afficher');
}
});
$('#list_enfants').load('list_kids.php?id='+edit);
//////key checks//////
$('#txt_Nom').keypress(function(event) {
if(event.which=='0'||event.which=='8') return true;
return /^[a-zA-Z\-\ ]+$/.test(String.fromCharCode(event.which));
});
$('#txt_NomMarital').keypress(function(event) {
if(event.which=='0'||event.which=='8') return true;
return /^[a-zA-Z\-\ ]+$/.test(String.fromCharCode(event.which));
});
$('#txt_Prenom').keypress(function(event) {
if(event.which=='0'||event.which=='8') return true;
return /^[a-zA-Z\-\ ]+$/.test(String.fromCharCode(event.which));
//return /^[a-zA-Z\u00C0-\u00D6\u00D9-\u00F6\u00F9-\u00FD\-\ ]+$/.test(String.fromCharCode(event.which));
});
$('#txt_Prenom2').keypress(function(event) {
if(event.which=='0'||event.which=='8') return true;
return /^[a-zA-Z\-\ ]+$/.test(String.fromCharCode(event.which));
//return /^[a-zA-Z\u00C0-\u00D6\u00D9-\u00F6\u00F9-\u00FD\-\ ]+$/.test(String.fromCharCode(event.which));
});
$('#txt_IDTresor').keypress(function(event) {
if(event.which=='0'||event.which=='8') return true;
if ($("#txt_IDTresor").val().length == 4){
$("#txt_IDTresor").val($("#txt_IDTresor").val() + "-");
}
return /^[0-9\-]+$/.test(String.fromCharCode(event.which));
});
$('#txt_CPS').keypress(function(event) {
if(event.which=='0'||event.which=='8') return true;
return /^[0-9]+$/.test(String.fromCharCode(event.which));
});
$('#txt_Fax').keypress(function(event) {
if(event.which=='0'||event.which=='8') return true;
if ($("#txt_Fax").val().length == 2 || $("#txt_Fax").val().length == 5 || $("#txt_Fax").val().length == 8){
$("#txt_Fax").val($("#txt_Fax").val() + "-");
}
return /^[0-9]+$/.test(String.fromCharCode(event.which));
});
$('#txt_Telephone').keypress(function(event) {
if(event.which=='0'||event.which=='8') return true;
if ($("#txt_Telephone").val().length == 2 || $("#txt_Telephone").val().length == 5 || $("#txt_Telephone").val().length == 8){
$("#txt_Telephone").val($("#txt_Telephone").val() + "-");
}
return /^[0-9]+$/.test(String.fromCharCode(event.which));
});
$('#txt_RIB').keypress(function(event) {
if(event.which=='0'||event.which=='8') return true;
if ($("#txt_RIB").val().length == 5 || $("#txt_RIB").val().length == 11|| $("#txt_RIB").val().length == 23){
$("#txt_RIB").val($("#txt_RIB").val() + "-");
}
return /^[0-9A-Za-z]+$/.test(String.fromCharCode(event.which));
});
$('#txt_cps_enfant').keypress(function(event) {
if(event.which=='0'||event.which=='8') return true;
return /^[0-9]+$/.test(String.fromCharCode(event.which));
});
$('#txt_nom_enfant').keypress(function(event) {
if(event.which=='0'||event.which=='8') return true;
return /^[a-zA-Z\-\ ]+$/.test(String.fromCharCode(event.which));
//return /^[a-zA-Z\u00C0-\u00D6\u00D9-\u00F6\u00F9-\u00FD\-\ ]+$/.test(String.fromCharCode(event.which));
});
$('#txt_prenom_enfant').keypress(function(event) {
if(event.which=='0'||event.which=='8') return true;
return /^[a-zA-Z\-\ \']+$/.test(String.fromCharCode(event.which));
//return /^[a-zA-Z\u00C0-\u00D6\u00D9-\u00F6\u00F9-\u00FD\-\ \']+$/.test(String.fromCharCode(event.which));
});
//changement temporaire pour autoriser les enfants en tant que parents
//if(edit==""|edit=="0"){
//$('#txt_DateNaissance').datepicker({inline: true,changeMonth: true,changeYear: true,minDate: "-70Y",maxDate: "-18Y",yearRange: "-70:-18"});
$('#txt_DateNaissance').datepicker({inline: true,changeMonth: true,changeYear: true,minDate: "-70Y",maxDate: "0",yearRange: "-70:+0"});
//}
$('#txt_dn_enfant').datepicker({inline: true,changeMonth: true,changeYear: true,minDate: "-18Y",maxDate: "0",yearRange: "-18:+0"});
$('#txt_entree_enfant').datepicker({inline: true,changeMonth: true,changeYear: true});
$('#txt_sortie_enfant').datepicker({inline: true,changeMonth: true,changeYear: true});
//////jqueryui buttons/////
$( "input:submit,input:button,button" ).button();
load_classes($("#slt_ecole_enfant").val(),'slt_classe_enfant');
///////session info for the kids form//////////////
$("#slt_classe_enfant").val('<? print $_SESSION['values']['slt_enfantClasse']; ?>');
$("#slt_sexe_enfant").val('<? print $_SESSION['values']['slt_enfantSexe']; ?>');
});
function showSubmitResult(){
var success = gup('success');
var edit = gup('edit');
var exist = gup('exist');
if (success=='1') {
if (edit>0) {
message("Compte mis à jour avec succès");
} else {
message("Nouvel administré ajouté avec succès");
}
} else if (success=='0') {
if (edit>0) {
message("Echec dans la mise à jour du compte");
} else {
message("Echec dans l'ajout du nouvel administré");
}
if (exist){message("Doublon détecté");}
}
}
function editkid(id){
//alert("editkid");
//$("#chk_actif_enfant").prop("disabled", false);
$.post("kids_functions.php", { query: "select",id: id },
function(data) {
//alert("Data Loaded: " + data);
var xml = data,
xmlDoc = $.parseXML(xml),
$xml = $(xmlDoc),
$child = $xml.find("child");
var id = $child.attr("id");
var nom = $child.find("nom").text();
var prenom = $child.find("prenom").text();
var dn = $child.find("dn").text();
var sexe = $child.find("sexe").text();
var cps = $child.find("cps").text();
var status = $child.find("status").text();
var status_expires = $child.find("status_expires").text();
var status_periode = $child.find("status_periode").text();
var ecole = $child.find("ecole").text();
var classe = $child.find("classe").text();
var entree = $child.find("entree").text();
var sortie = $child.find("sortie").text();
var active = $child.find("active").text();
var dest = $child.find("destinataire").text();
$("#slt_ecole_enfant").val(ecole);
load_classes($("#slt_ecole_enfant").val(),'slt_classe_enfant');
$("#txt_nom_enfant").val(nom);
$("#txt_prenom_enfant").val(prenom);
dn = dn.split("-");
$("#txt_dn_enfant").val(dn[2]+"/"+dn[1]+"/"+dn[0]);
$("#txt_cps_enfant").val(cps);
//alert(classe);
$("#slt_classe_enfant").val(classe);
entree = entree.split("-");
$("#txt_entree_enfant").val(entree[2]+"/"+entree[1]+"/"+entree[0]);
sortie = sortie.split("-");
$("#txt_sortie_enfant").val(sortie[2]+"/"+sortie[1]+"/"+sortie[0]);
$("#slt_sexe_enfant").val(sexe);
$("#slt_status_enfant").val(status);
//determiner si le status est expire
var dateParts = status_expires.split("-");
var jsDate = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]);
var now = new Date();
//alert(status_periode);
if(now>jsDate){
$("#slt_status_periode").val(0);
}else{
$("#slt_status_periode").val(status_periode);
}
//fin
switch_periode(status);
//if($("#slt_status_periode").val()>0){$("#slt_status_periode").show();}
if(active=='1'){
$("#chk_actif_enfant").prop("checked", true);
}else{
$("#chk_actif_enfant").prop("checked", false);
}
if(dest=='1'){
$("#chk_dest_enfant").prop("checked", true);
}else{
$("#chk_dest_enfant").prop("checked", false);
}
$("#id_enfant").val(id);
$("#btn_add_enfant").button("option", "label","Mettre \340 jour");
});
}
function reaffectkid(id){
window.location = "retrieveid.php?form=clients&reaffect=true&type=kid";
}
function reaffectfactures(id){
window.location = "retrieveid.php?form=clients&reaffect=true&type=factures";
}
function load_classes(id,select){
//alert(id);
$("#"+select).empty();
var list = listclasses[id].split(",");
for (var i = 0; i < list.length; i++) {
$("#"+select).append("<option value='"+list[i]+"'>"+list[i]+"</option>");
}
}
function resetenfant(){
var edit = gup("edit");
window.location = "clients.php?edit="+edit+"&reset=1";
}
function scrolldown(){
var n = $(document).height();
$('html, body').animate({ scrollTop: n },'50');
}
function scrollup(){
window.scrollTo(0, 0);
}
function div_avoir(p){
scrollup();
$("#div_avoir").load(p);
$("#opaquediv").show();
}
function div_avoir_close(){
$("#div_avoir").empty();
$("#opaquediv").hide();
}
function affect_conjoint(){
var conjointid = $("#box_conjoint").val();
var id = gup('edit');
$.get("conjoint_set.php",{id:id,conjointid:conjointid},
function(data){
$('#divconjoint').empty();
$('#divconjoint').load('conjoint.php?id='+id, function(){
$("#box_conjoint").chosen();
$("button").button();
});
});
}
function switch_periode(value){
if(value=='15'||value=='16'){
$("#slt_status_periode").show();
}else{
$("#slt_status_periode").hide();
$("#slt_status_periode")[0].selectedIndex = 0;
}
}
function reset_date(input){
//alert(input);
$("#"+input).val("");
}
</script>
</head>
<body>
<? include_once('menu.php'); ?>
<div id="message" ></div>
<div id="compte_div"></div>
<div id="version">version <?php echo VERSION ?></div>
<br/><br/>
<!-- Form -->
<h1><?php echo $legend ?></h1>
<div id="accounttoggle">
<button id="toggleaccount">Cacher</button>
</div>
<div id="compte">
<table>
<tr>
<td>
<form name="frmRegistration" action="clients_validate.php?validationType=php<? echo $edit ?>" method="POST">
<table id="tblclient" class="tblform">
<tbody>
<tr><th colspan="2">Données du compte</th></tr>
<tr>
<td title="Option désactivée lorsque des factures sont en cours ou la liste des enfants n'est pas vide.">
<!--Status-->
<label for="chk_status">Compte Actif</label>
<input type="checkbox" name="chk_status" id="chk_status" value="1" <? if($_SESSION['values']['chk_status']) echo 'checked="checked"'; ?> <? echo $actiflock ?>/>
<div>
<?
if($svc=="FTR"||$svc=="REG"||$svc=="INF"){
echo $totalfactures;
}
?>
</div>
</td>
<td>
<!--Civilite-->
<label for="box_Civilite">Civilité<span class="red">*</span></label><br />
<select class="input" name="box_Civilite" id="box_Civilite" onchange="validate(this.value, this.id);">
<?php buildOptions($civiliteOptions, $_SESSION['values']['box_Civilite']) ?>
</select><br/>
<span id="box_CiviliteFailed" class="<?php echo $_SESSION['errors']['Civilite'] ?> red">
Veuillez sélectionner une civilité.
</span>
</td>
</tr>
<tr>
<td>
<!--Nom Patronimyque-->
<label for="txt_Nom">Nom<span class="red">*</span></label><br />
<input class="uppercase" type="text" name="txt_Nom" id="txt_Nom" value="<?php echo $_SESSION['values']['txt_Nom'] ?>" size="20" maxlength="20" onBlur="validate(this.value, this.id);" />
<span id="txt_NomFailed" class="<?php echo $_SESSION['errors']['Nom'] ?> red"><br/>
Veuillez entrer un nom valide.
</span>
</td>
<td>
<!--Nom Marital-->
<label for="txt_NomMarital">Nom Marital</label><br />
<input class="uppercase" type="text" name="txt_NomMarital" id="txt_NomMarital" value="<?php echo $_SESSION['values']['txt_NomMarital'] ?>" size="20" maxlength="20" onBlur="validate(this.value, this.id);" />
<span id="txt_NomMaritalFailed" class="<?php echo $_SESSION['errors']['NomMarital'] ?> red"><br/>
Veuillez entrer un nom marital valide.
</span>
</td>
</tr>
<tr>
<td>
<!--Prenom-->
<label for="txt_Prenom">Prénom<span class="red">*</span></label><br />
<input class="uppercase" type="text" name="txt_Prenom" id="txt_Prenom" value="<?php echo $_SESSION['values']['txt_Prenom'] ?>" size="20" maxlength="20" onBlur="validate(this.value, this.id);" />
<span id="txt_PrenomFailed" class="<?php echo $_SESSION['errors']['Prenom'] ?> red"><br/>
Veuillez entrer un prénom valide.
</span>
</td>
<td>
<!--Prenom2-->
<label for="txt_Prenom2">Prénom 2</label><br />
<input class="uppercase" type="text" name="txt_Prenom2" id="txt_Prenom2" value="<?php echo $_SESSION['values']['txt_Prenom2'] ?>" size="20" maxlength="20" onBlur="validate(this.value, this.id);" />
<span id="txt_Prenom2Failed" class="<?php echo $_SESSION['errors']['Prenom2'] ?> red"><br/>
Veuillez entrer un deuxième prénom valide.
</span>
</td>
</tr>
<tr>
<td>
<!--Date de Naissance-->
<label for="txt_DateNaissance">Date de Naissance<span class="red">*</span></label><br />
<input type="text" name="txt_DateNaissance" id="txt_DateNaissance" value="<?php echo $_SESSION['values']['txt_DateNaissance'] ?>" size="20" maxlength="10" onBlur="checkexist(this.value, document.getElementById('txt_Nom').value, document.getElementById('txt_Prenom').value);" readonly />
<span id="txt_DateNaissanceFailed" class="<?php echo $_SESSION['errors']['DateNaissance'] ?> red"><br/>
Veuillez entrer une date valide.
</span>
</td>
<td>
<!--LieuNaissance-->
<label for="txt_LieuNaissance">Lieu de Naissance</label><br />
<input class="uppercase" type="text" name="txt_LieuNaissance" id="txt_LieuNaissance" value="<?php echo $_SESSION['values']['txt_LieuNaissance'] ?>" size="20" maxlength="20" onBlur="validate(this.value, this.id);" />
<span id="txt_LieuNaissanceFailed" class="<?php echo $_SESSION['errors']['LieuNaissance'] ?> red"><br/>
Veuillez entrer un lieu valide.
</span>
</td>
</tr>
<tr>
<td>
<!--ID Tresor-->
<label for="txt_IDTresor">ID Trésor</label><br />
<input type="text" name="txt_IDTresor" id="txt_IDTresor" value="<?php echo $_SESSION['values']['txt_IDTresor'] ?>" size="20" maxlength="7" onBlur="validate(this.value, this.id);" />
<span id="txt_IDTresorFailed" class="<?php echo $_SESSION['errors']['IDTresor'] ?> red"><br/>
Veuillez entrer un identifiant trésor valide (ex: 1234-12).
</span>
</td>
<td>
<!--Email-->
<label for="txt_Email">Email</label><br />
<input class="lowercase" type="text" name="txt_Email" id="txt_Email" value="<?php echo $_SESSION['values']['txt_Email'] ?>" size="20" maxlength="50" onBlur="validate(this.value, this.id);" />
<span id="txt_EmailFailed" class="<?php echo $_SESSION['errors']['Email'] ?> red"><br/>
Veuillez entrer un email valide (ex: monsieur@mail.pf).
</span>
</td>
</tr>
<tr>
<td>
<!--CPS-->
<label for="txt_CPS">CPS</label><br />
<input type="text" name="txt_CPS" id="txt_CPS" value="<?php echo $_SESSION['values']['txt_CPS'] ?>" size="20" maxlength="7" onBlur="validate(this.value, this.id);" />
<span id="txt_CPSFailed" class="<?php echo $_SESSION['errors']['CPS'] ?> red"><br/>
Veuillez entrer un numéro CPS valide (ex: 1234567).
</span>
</td>
<td>
<!--Telephone-->
<label for="txt_Telephone">Téléphone</label><br />
<input type="text" name="txt_Telephone" id="txt_Telephone" value="<?php echo $_SESSION['values']['txt_Telephone'] ?>" size="20" maxlength="11" onBlur="validate(this.value, this.id);" />
<span id="txt_TelephoneFailed" class="<?php echo $_SESSION['errors']['Telephone'] ?> red"><br/>
Veuillez entrer un numéro téléphone valide (ex: 80-09-67).
</span>
</td>
</tr>
<tr>
<td>
<!--Fax-->
<label for="txt_Fax">Fax</label><br />
<input type="text" name="txt_Fax" id="txt_Fax" value="<?php echo $_SESSION['values']['txt_Fax'] ?>" size="20" maxlength="11" onBlur="validate(this.value, this.id);" />
<span id="txt_FaxFailed" class="<?php echo $_SESSION['errors']['Fax'] ?> red"><br/>
Veuillez entrer un numéro de fax valide (ex: 80-09-67).
</span>
</td>
<td>
<!--BP-->
<label for="txt_BP">B.P.</label><br />
<input type="text" name="txt_BP" id="txt_BP" value="<?php echo $_SESSION['values']['txt_BP'] ?>" size="20" maxlength="6" onBlur="validate(this.value, this.id);" />
<span id="txt_BPFailed" class="<?php echo $_SESSION['errors']['BP'] ?> red"><br/>
Veuillez entrer une boîte postale valide (ex: 60002).
</span>
</td>
</tr>
<tr>
<td>
<!--CP-->
<label for="txt_CP">Code Postal</label><br />
<input class="uppercase" type="text" name="txt_CP" id="txt_CP" value="<?php echo $_SESSION['values']['txt_CP'] ?>" size="20" maxlength="5" onBlur="validate(this.value, this.id);retrieve_rue(this.value);" />
<span id="txt_CPFailed" class="<?php echo $_SESSION['errors']['CP'] ?> red"><br/>
Veuillez entrer un code postal valide (ex: 98702).
</span>
</td>
<td>
<!--Ville-->
<label for="txt_Ville">Ville</label><br />
<input class="uppercase" type="text" name="txt_Ville" id="txt_Ville" value="<?php echo stripslashes($_SESSION['values']['txt_Ville']) ?>" size="20" maxlength="20" onBlur="validate(this.value, this.id);" />
<span id="txt_VilleFailed" class="<?php echo $_SESSION['errors']['Ville'] ?> red"><br/>
Veuillez entrer une ville valide (ex: FAAA).
</span>
</td>
</tr>
<tr>
<td>
<!--Commune-->
<label for="txt_Commune">Commune / Département</label><br />
<input class="uppercase" type="text" name="txt_Commune" id="txt_Commune" value="<?php echo stripslashes($_SESSION['values']['txt_Commune']) ?>" size="20" maxlength="20" onBlur="validate(this.value, this.id);" />
<span id="txt_CommuneFailed" class="<?php echo $_SESSION['errors']['Commune'] ?> red"><br/>
Veuillez entrer une commune valide (ex: FAAA).
</span>
</td>
<td>
<!--Pays-->
<label for="txt_Pays">Pays</label><br />
<input class="uppercase" type="text" name="txt_Pays" id="txt_Pays" value="<?php echo $_SESSION['values']['txt_Pays'] ?>" size="20" maxlength="20" onBlur="validate(this.value, this.id);" />
<span id="txt_PaysFailed" class="<?php echo $_SESSION['errors']['Pays'] ?> red"><br/>
Veuillez entrer un pays valide (ex: TAHITI).
</span>
</td>
</tr>
<tr>
<td>
<!--Aroa-->
<label for="txt_Aroa">N° + Aroa<span class="red">*</span></label><br />
<input class="uppercase" type="text" name="txt_Aroa" id="txt_Aroa" value="<?php echo stripslashes($_SESSION['values']['txt_Aroa']) ?>" size="20" maxlength="35" onBlur="validate(this.value, this.id);" />
<span id="txt_AroaFailed" class="<?php echo $_SESSION['errors']['Aroa'] ?> red"><br/>
Veuillez entrer une rue valide.
</span>
</td>
<td>
<!--Quartier-->
<label for="txt_Quartier">Quartier<span class="red">*</span></label><br />
<input class="uppercase" type="text" name="txt_Quartier" id="txt_Quartier" value="<?php echo $_SESSION['values']['txt_Quartier'] ?>" size="20" maxlength="20" onBlur="validate(this.value, this.id);" />
<span id="txt_QuartierFailed" class="<?php echo $_SESSION['errors']['Quartier'] ?> red"><br/>
Veuillez entrer un quartier valide.
</span>
</td>
</tr>
<tr>
<td colspan="2">
<!--RIB-->
<label for="txt_RIB">R.I.B.</label>
<input type="text" class="uppercase" name="txt_RIB" id="txt_RIB" size="40" maxlength="26" value="<?php echo $_SESSION['values']['txt_RIB'] ?>" onBlur="validate(this.value, this.id);" />
<span id="txt_RIBFailed" class="<?php echo $_SESSION['errors']['RIB'] ?> red"><br/>
Veuillez entrer un R.I.B. valide.
</span>
</td>
</tr>
<tr>
<td colspan="2">
<!--Obs-->
<label for="txt_obs">Observations</label><br />
<textarea style="height:100px;width:340px;resize:none;" id="txt_obs" name="txt_obs"><?php echo $_SESSION['values']['txt_obs'] ?></textarea>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:right;">
<!--Reset-->
<input class="submit" type="button" onClick="window.location='<?php print $_SERVER['PHP_SELF'] ?>?reset=1&edit=<?php print $_GET['edit'] ?>';" value="Annuler" name="raz" />
<!--Submit-->
<input class="submit" type="submit" value="Valider" name="submit" />
</td>
</tr>
</tbody>
</table>
<p class="legend"><span class="red">*</span> Champs Obligatoires</p>
</form>
</td>
<?php echo buildAnnexesTable() ?>
</tr>
</table>
</div>
<?php
if($svc=="FTR"||$svc=="REG"||$svc=="INF"){
echo "<div id='divhistorique'>".
"<h1>Status des factures liées au compte</h1> <button id='togglehistory'>Afficher</button> <button id='showreject'>Afficher les rejets</button>".
"<div id='historique'>";
if (isset($_GET['edit'])) echo buildFacturesEnCoursTable($_GET['edit'],$ar_f_c);
echo "<br/></div></div>";
}
?>
<!-- obsolete
<div id="divavoirs">
<h1>Avoirs</h1> <button id="toggleavoirs">Afficher</button> <button onclick="div_avoir('avoirs.php');">Ajouter</button>
<div id="avoirs">
<?php
//if (isset($_GET['edit'])) echo buildAvoirsTable($_GET['edit']);
?>
<br/>
</div>
</div>
//-->
<br/><br/>
<div id="opaquediv" style="position:absolute;top:0px;width:100%;height:100%;z-index:20;">
<div style="background-color:white;" id="div_avoir" ></div>
</div>
</body>
</html>