4 |
|
|
5 |
include('../gen/sql/pgsql/demande.inc.php'); |
include('../gen/sql/pgsql/demande.inc.php'); |
6 |
|
|
7 |
|
//TABLE |
8 |
|
$table = DB_PREFIXE."demande |
9 |
|
INNER JOIN ".DB_PREFIXE."lien_demande_demandeur |
10 |
|
ON lien_demande_demandeur.demande=demande.demande |
11 |
|
AND lien_demande_demandeur.petitionnaire_principal IS TRUE |
12 |
|
INNER JOIN ".DB_PREFIXE."demandeur |
13 |
|
ON lien_demande_demandeur.demandeur=demandeur.demandeur |
14 |
|
LEFT JOIN ".DB_PREFIXE."arrondissement |
15 |
|
ON demande.arrondissement=arrondissement.arrondissement |
16 |
|
LEFT JOIN ".DB_PREFIXE."demande_type |
17 |
|
ON demande.demande_type=demande_type.demande_type |
18 |
|
LEFT JOIN ".DB_PREFIXE."dossier_autorisation |
19 |
|
ON demande.dossier_autorisation=dossier_autorisation.dossier_autorisation |
20 |
|
LEFT JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille |
21 |
|
ON demande.dossier_autorisation_type_detaille=dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
22 |
|
LEFT JOIN ".DB_PREFIXE."dossier |
23 |
|
ON demande.dossier_instruction=dossier.dossier |
24 |
|
LEFT JOIN ".DB_PREFIXE."instruction |
25 |
|
ON demande.instruction_recepisse=instruction.instruction "; |
26 |
|
|
27 |
|
// SELECT |
28 |
|
$champAffiche = array( |
29 |
|
'demande.demande as "'._("demande").'"', |
30 |
|
'COALESCE(demandeur.particulier_nom, demandeur.personne_morale_denomination) as "'._("petitionaire principal").'"', |
31 |
|
'TRIM(CONCAT(demande.terrain_adresse_voie_numero,\' \', |
32 |
|
demande.complement,\' \', |
33 |
|
demande.terrain_adresse_lieu_dit,\' \', |
34 |
|
demande.terrain_adresse_code_postal,\' \', |
35 |
|
demande.terrain_adresse_localite,\' \', |
36 |
|
demande.terrain_adresse_bp,\' \', |
37 |
|
demande.terrain_adresse_cedex |
38 |
|
)) as "'._("adresse du terrain").'"', |
39 |
|
'dossier_autorisation_type_detaille.libelle as "'._("dossier_autorisation_type_detaille").'"', |
40 |
|
'to_char(demande.date_demande ,\'DD/MM/YYYY\') as "'._("date_demande").'"', |
41 |
|
'arrondissement.libelle as "'._("arrondissement").'"', |
42 |
|
); |
43 |
|
|
44 |
// Recherche avancee |
// Recherche avancee |
45 |
$champs = array(); |
$champs = array(); |
46 |
|
|
52 |
|
|
53 |
|
|
54 |
$champs['particulier_nom'] = |
$champs['particulier_nom'] = |
55 |
array('colonne' => 'particulier_nom', |
array('colonne' => array('particulier_nom', 'personne_morale_denomination'), |
56 |
'table' => 'demandeur', |
'table' => 'demandeur', |
57 |
'libelle' => _('petitionnaire'), |
'libelle' => _('petitionnaire'), |
58 |
'type' => 'text' |
'type' => 'text' |
59 |
); |
); |
60 |
|
|
61 |
$champs['adresse'] = array( |
$champs['adresse'] = array( |
62 |
'table' => 'demandeur', |
'table' => 'demande', |
63 |
'colonne' => 'TRIM(CONCAT(demandeur.terrain_adresse_voie_numero,\' \', |
'colonne' => array('terrain_adresse_voie_numero','complement', |
64 |
demandeur.complement,\' \', |
'terrain_adresse_lieu_dit', 'terrain_adresse_code_postal', |
65 |
demandeur.terrain_adresse_lieu_dit,\' \', |
'terrain_adresse_localite', 'terrain_adresse_bp', |
66 |
demandeur.terrain_adresse_code_postal,\' \', |
'terrain_adresse_cedex'), |
|
demandeur.terrain_adresse_localite,\' \', |
|
|
demandeur.terrain_adresse_bp,\' \', |
|
|
demandeur.terrain_adresse_cedex |
|
|
))', |
|
67 |
'type' => 'text', |
'type' => 'text', |
68 |
'libelle' => _('terrain')); |
'libelle' => _('terrain')); |
69 |
|
|
90 |
$options[] = array('type' => 'search', |
$options[] = array('type' => 'search', |
91 |
'display' => true, |
'display' => true, |
92 |
'advanced' => $champs, |
'advanced' => $champs, |
93 |
'absolute_object' => 'dossier_autorisation', |
'absolute_object' => 'demande', |
94 |
'export' => array("csv")); |
'export' => array("csv")); |
95 |
|
|
96 |
$sousformulaire = NULL; |
$sousformulaire = NULL; |