3 |
//gen openMairie le 08/11/2012 14:00 |
//gen openMairie le 08/11/2012 14:00 |
4 |
|
|
5 |
include('../gen/sql/pgsql/demande.inc.php'); |
include('../gen/sql/pgsql/demande.inc.php'); |
6 |
|
// Titre |
7 |
|
//Menu : "Dossier Existant" |
8 |
|
if (isset($idx_dossier) && $idx_dossier != ']' && trim($idx_dossier) != '') { |
9 |
|
|
10 |
|
$ent = _("Demande sur dossier existant")." -> ".$idx_dossier; |
11 |
|
} |
12 |
|
//Menu : "Nouveau Dossier" |
13 |
|
elseif(isset($_GET['action'])&&$_GET['action']==0) { |
14 |
|
|
15 |
|
$ent = _("Demande pour nouveau dossier"); |
16 |
|
} |
17 |
|
//Menu : "Recepisse De Demande" |
18 |
|
else{ |
19 |
|
|
20 |
|
$ent = _("Recherche du recepisse d'une demande"); |
21 |
|
} |
22 |
|
|
23 |
// Recherche avancee |
//TABLE |
24 |
|
/*Champs du début de la requête*/ |
25 |
|
$table = DB_PREFIXE."demande |
26 |
|
INNER JOIN ".DB_PREFIXE."lien_demande_demandeur |
27 |
|
ON lien_demande_demandeur.demande=demande.demande |
28 |
|
AND lien_demande_demandeur.petitionnaire_principal IS TRUE |
29 |
|
INNER JOIN ".DB_PREFIXE."demandeur |
30 |
|
ON lien_demande_demandeur.demandeur=demandeur.demandeur |
31 |
|
LEFT JOIN ".DB_PREFIXE."arrondissement |
32 |
|
ON demande.arrondissement=arrondissement.arrondissement |
33 |
|
LEFT JOIN ".DB_PREFIXE."demande_type |
34 |
|
ON demande.demande_type=demande_type.demande_type |
35 |
|
LEFT JOIN ".DB_PREFIXE."dossier_autorisation |
36 |
|
ON demande.dossier_autorisation=dossier_autorisation.dossier_autorisation |
37 |
|
LEFT JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille |
38 |
|
ON demande.dossier_autorisation_type_detaille=dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
39 |
|
LEFT JOIN ".DB_PREFIXE."dossier |
40 |
|
ON demande.dossier_instruction=dossier.dossier |
41 |
|
LEFT JOIN ".DB_PREFIXE."instruction |
42 |
|
ON demande.instruction_recepisse=instruction.instruction "; |
43 |
|
/* Test SQL pour récupérer les bons champs selon la qualité du demandeur : |
44 |
|
* particulier ou personne morale*/ |
45 |
|
$case_demandeur = "CASE WHEN demandeur.qualite='particulier' |
46 |
|
THEN TRIM(CONCAT(demandeur.particulier_nom, ' ', demandeur.particulier_prenom)) |
47 |
|
ELSE TRIM(CONCAT(demandeur.personne_morale_raison_sociale, ' ', demandeur.personne_morale_denomination)) |
48 |
|
END"; |
49 |
|
|
50 |
|
/*Supression du bouton d'ajout de nouvelle demande à partir du formulaire*/ |
51 |
|
$tab_actions['corner']['ajouter'] = NULL; |
52 |
|
|
53 |
|
/*Liste des champs affichés dans le tableau de résultat*/ |
54 |
|
$champAffiche = array( |
55 |
|
'demande.demande as "'._("demande").'"', |
56 |
|
'demande.dossier_instruction as "'._("dossier").'"', |
57 |
|
$case_demandeur.' as "'._("nom").'"', |
58 |
|
'TRIM(CONCAT(demande.terrain_adresse_voie_numero,\' \', |
59 |
|
demande.complement,\' \', |
60 |
|
demande.terrain_adresse_lieu_dit,\' \', |
61 |
|
demande.terrain_adresse_code_postal,\' \', |
62 |
|
demande.terrain_adresse_localite,\' \', |
63 |
|
demande.terrain_adresse_bp,\' \', |
64 |
|
demande.terrain_adresse_cedex |
65 |
|
)) as "'._("terrain").'"', |
66 |
|
'dossier_autorisation_type_detaille.libelle as "'._("nature_dossier").'"', |
67 |
|
'to_char(demande.date_demande ,\'DD/MM/YYYY\') as "'._("date_demande").'"', |
68 |
|
'arrondissement.libelle as "'._("arrondissement").'"', |
69 |
|
); |
70 |
|
|
71 |
|
/* Recherche avancée */ |
72 |
$champs = array(); |
$champs = array(); |
73 |
|
|
74 |
$champs['dossier_instruction'] = array( |
$champs['dossier_instruction'] = array( |
75 |
'table' => 'dossier', |
'table' => 'dossier', |
76 |
'colonne' => 'dossier', |
'colonne' => 'dossier', |
77 |
'type' => 'text', |
'type' => 'text', |
78 |
'libelle' => _('dossier_instruction')); |
'libelle' => _('dossier')); |
79 |
|
|
80 |
|
|
81 |
$champs['particulier_nom'] = |
$champs['particulier_nom'] = |
82 |
array('colonne' => 'particulier_nom', |
array('colonne' => array('particulier_nom', 'personne_morale_denomination'), |
83 |
'table' => 'demandeur', |
'table' => 'demandeur', |
84 |
'libelle' => _('petitionnaire'), |
'libelle' => _('petitionnaire'), |
85 |
'type' => 'text' |
'type' => 'text' |
86 |
); |
); |
87 |
|
|
88 |
$champs['adresse'] = array( |
$champs['adresse'] = array( |
89 |
'table' => 'demandeur', |
'table' => 'demande', |
90 |
'colonne' => 'TRIM(CONCAT(demandeur.terrain_adresse_voie_numero,\' \', |
'colonne' => array('terrain_adresse_voie_numero','complement', |
91 |
demandeur.complement,\' \', |
'terrain_adresse_lieu_dit', 'terrain_adresse_code_postal', |
92 |
demandeur.terrain_adresse_lieu_dit,\' \', |
'terrain_adresse_localite', 'terrain_adresse_bp', |
93 |
demandeur.terrain_adresse_code_postal,\' \', |
'terrain_adresse_cedex'), |
|
demandeur.terrain_adresse_localite,\' \', |
|
|
demandeur.terrain_adresse_bp,\' \', |
|
|
demandeur.terrain_adresse_cedex |
|
|
))', |
|
94 |
'type' => 'text', |
'type' => 'text', |
95 |
'libelle' => _('terrain')); |
'libelle' => _('adresse')); |
96 |
|
|
97 |
$champs['arrondissement'] = |
$champs['arrondissement'] = |
98 |
array('colonne' => 'arrondissement', |
array('colonne' => 'arrondissement', |
117 |
$options[] = array('type' => 'search', |
$options[] = array('type' => 'search', |
118 |
'display' => true, |
'display' => true, |
119 |
'advanced' => $champs, |
'advanced' => $champs, |
120 |
'absolute_object' => 'dossier_autorisation', |
'absolute_object' => 'demande', |
121 |
'export' => array("csv")); |
'export' => array("csv")); |
122 |
|
/*Fin recherche avancée*/ |
123 |
|
|
124 |
|
/*Sous-formulaire non affichés*/ |
125 |
$sousformulaire = NULL; |
$sousformulaire = NULL; |
126 |
?> |
?> |