1 |
<?php |
2 |
/** |
3 |
* Ce script a pour objet de recuperer l'info passée en paramètre : soit la nature (nouveau dossier, |
4 |
* dossier existant), soit le code du type de la demande |
5 |
* |
6 |
* @package openfoncier |
7 |
* @version SVN : $Id: getDemandeInfo.php 4418 2015-02-24 17:30:28Z tbenita $ |
8 |
*/ |
9 |
|
10 |
require_once "../obj/utils.class.php"; |
11 |
|
12 |
$f = new utils("nohtml"); |
13 |
$f->isAccredited(array("demande","demande_modifier","demande_ajouter"), "OR"); |
14 |
$f->disableLog(); |
15 |
|
16 |
// Donnees |
17 |
$id_demande_type = ""; |
18 |
if ($f->get_submitted_get_value("iddemandetype") != null) { |
19 |
$id_demande_type = $f->get_submitted_get_value("iddemandetype"); |
20 |
} |
21 |
$info = ""; |
22 |
if ($f->get_submitted_get_value("info") != null) { |
23 |
$info = $f->get_submitted_get_value("info"); |
24 |
} |
25 |
|
26 |
// Si les paramètre ne sont pas fournis on stop le traitement |
27 |
if ($id_demande_type == "" || $info == "") { |
28 |
die(); |
29 |
} |
30 |
if ($info == "nature") { |
31 |
$qres = $f->get_one_result_from_db_query( |
32 |
sprintf( |
33 |
'SELECT |
34 |
demande_nature.code |
35 |
FROM |
36 |
%1$sdemande_nature |
37 |
INNER JOIN %1$sdemande_type |
38 |
ON demande_type.demande_nature = demande_nature.demande_nature |
39 |
WHERE |
40 |
demande_type.demande_type = %2$d', |
41 |
DB_PREFIXE, |
42 |
intval($id_demande_type) |
43 |
), |
44 |
array( |
45 |
"origin" => "app/getDemandeInfo.php", |
46 |
) |
47 |
); |
48 |
echo $qres["result"]; |
49 |
} |
50 |
if ($info == "contraintes") { |
51 |
$qres = $f->get_one_result_from_db_query( |
52 |
sprintf( |
53 |
'SELECT |
54 |
demande_type.contraintes |
55 |
FROM |
56 |
%1$sdemande_type |
57 |
WHERE |
58 |
demande_type.demande_type = %2$d', |
59 |
DB_PREFIXE, |
60 |
intval($id_demande_type) |
61 |
), |
62 |
array( |
63 |
"origin" => "app/getDemandeInfo.php", |
64 |
) |
65 |
); |
66 |
echo $qres["result"]; |
67 |
} |
68 |
if ($info == "type_aff_form") { |
69 |
$qres = $f->get_one_result_from_db_query( |
70 |
sprintf( |
71 |
'SELECT |
72 |
dossier_autorisation_type.affichage_form |
73 |
FROM |
74 |
%1$sdemande_type |
75 |
INNER JOIN %1$sdossier_autorisation_type_detaille |
76 |
ON demande_type.dossier_autorisation_type_detaille = dossier_autorisation_type_detaille.dossier_autorisation_type_detaille |
77 |
INNER JOIN %1$sdossier_autorisation_type |
78 |
ON dossier_autorisation_type.dossier_autorisation_type = dossier_autorisation_type_detaille.dossier_autorisation_type |
79 |
WHERE |
80 |
demande_type.demande_type = %2$d', |
81 |
DB_PREFIXE, |
82 |
intval($id_demande_type) |
83 |
), |
84 |
array( |
85 |
"origin" => "app/getDemandeInfo.php", |
86 |
) |
87 |
); |
88 |
echo $qres["result"]; |
89 |
} |