1 |
vpihour |
555 |
<?php |
2 |
|
|
require_once "../obj/utils.class.php"; |
3 |
|
|
|
4 |
|
|
// Identifiant de l'objet metier a copier |
5 |
|
|
(isset($_GET['idx']) ? $idx = $_GET['idx'] : $idx = ""); |
6 |
|
|
// Nom de l'objet metier |
7 |
|
|
(isset($_GET['obj']) ? $obj = $_GET['obj'] : $obj = ""); |
8 |
|
|
(isset($_GET['date_envoi']) ? $date_envoi = $_GET['date_envoi'] : $date_envoi = ""); |
9 |
|
|
|
10 |
|
|
$f = new utils("nohtml"); |
11 |
|
|
|
12 |
|
|
$liste_gauche = ""; |
13 |
|
|
|
14 |
|
|
/*Requête qui récupère les services qui sont dans des thématiques*/ |
15 |
|
|
$sql = |
16 |
|
|
"SELECT |
17 |
|
|
ser_cat.service_categorie, ser_cat.libelle AS them_lib, |
18 |
|
|
ser.service, ser.libelle AS ser_lib, ser.consultation_papier |
19 |
|
|
FROM |
20 |
nhaye |
889 |
".DB_PREFIXE."lien_service_service_categorie lie, |
21 |
|
|
".DB_PREFIXE."service_categorie ser_cat, |
22 |
|
|
".DB_PREFIXE."service ser |
23 |
vpihour |
555 |
WHERE |
24 |
|
|
ser_cat.service_categorie = lie.service_categorie AND |
25 |
|
|
ser.service = lie.service AND |
26 |
|
|
( |
27 |
|
|
ser.om_validite_fin <= CURRENT_DATE OR |
28 |
|
|
ser.om_validite_fin IS NULL |
29 |
|
|
) |
30 |
|
|
"; |
31 |
|
|
|
32 |
|
|
$res = $f->db->query($sql); |
33 |
|
|
$f->isDatabaseError($res); |
34 |
|
|
|
35 |
|
|
$temp_ser_cat = 0; |
36 |
|
|
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) { |
37 |
|
|
$name = $row['service_categorie'].'_'. |
38 |
|
|
$row['service'].'_'. |
39 |
|
|
(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '0' : '1' ).'_'; |
40 |
|
|
/*On change de thématique, donc rajoute le nom de la thématique*/ |
41 |
|
|
if ( $temp_ser_cat != $row['service_categorie'] ){ |
42 |
|
|
|
43 |
|
|
$temp_ser_cat = $row['service_categorie']; |
44 |
|
|
$liste_gauche .= ' |
45 |
|
|
<div id="them_'.$row['service_categorie'].'" class="liste_gauche_them" >'. |
46 |
|
|
$row['them_lib']. |
47 |
|
|
'</div> |
48 |
|
|
<div |
49 |
|
|
class="liste_gauche_service '.$name.'" |
50 |
|
|
id="'.$name.'" > |
51 |
|
|
'.$row['ser_lib'].' |
52 |
|
|
<input id="'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked' ).'/> |
53 |
|
|
</div> |
54 |
|
|
'; |
55 |
|
|
} |
56 |
|
|
|
57 |
|
|
/*On est dans la même thématique*/ |
58 |
|
|
else { |
59 |
|
|
|
60 |
|
|
$liste_gauche .= ' |
61 |
|
|
<div |
62 |
|
|
class="liste_gauche_service '.$name.'" |
63 |
|
|
id="'.$name.'" > |
64 |
|
|
'.$row['ser_lib'].' |
65 |
|
|
<input id="'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked' ).'/> |
66 |
|
|
</div> |
67 |
|
|
'; |
68 |
|
|
} |
69 |
|
|
|
70 |
|
|
} |
71 |
|
|
|
72 |
|
|
?> |