1 |
mbroquet |
3730 |
<?php |
2 |
|
|
/** |
3 |
|
|
* Script permettant d'afficher la liste des requêtes mémorisées contenu dans les |
4 |
|
|
* fichiers sql/pgsql/*.reqmo.inc.php |
5 |
|
|
* |
6 |
|
|
* @package openfoncier |
7 |
|
|
* @version SVN : $Id: reqmo_pilot.php 4651 2015-04-26 09:15:48Z tbenita $ |
8 |
|
|
*/ |
9 |
|
|
|
10 |
|
|
require_once "../obj/utils.class.php"; |
11 |
|
|
$f = new utils(null, "reqmo_pilot", _("export / import")." -> "._("statistiques a la demande")); |
12 |
|
|
|
13 |
|
|
// Nom de l'objet metier |
14 |
|
|
(($f->get_submitted_get_value('obj') !== null) ? $obj = $f->get_submitted_get_value('obj') : $obj = ""); |
15 |
|
|
|
16 |
|
|
require_once "../obj/reqmo.class.php"; |
17 |
|
|
$reqmo_pilot = new reqmo($f, $obj, "reqmo_pilot"); |
18 |
|
|
|
19 |
|
|
if($obj == "") { |
20 |
|
|
$description = _("Les requetes memorisees permettent d'exporter des donnees ". |
21 |
|
|
"de la base de donnees pour une utilisation externe a ". |
22 |
|
|
"l'application. Veuillez cliquer sur l'objet a exporter ". |
23 |
|
|
"pour atteindre un formulaire vous permettant de choisir les ". |
24 |
|
|
"parametres de l'export."); |
25 |
|
|
$f->displayDescription($description); |
26 |
|
|
|
27 |
|
|
// Affichage du contenu |
28 |
|
|
$reqmo_pilot->displayReqmoList("../app/reqmo_pilot.php"); |
29 |
|
|
} else { |
30 |
|
|
|
31 |
|
|
/** |
32 |
|
|
* Fichiers requis |
33 |
|
|
*/ |
34 |
|
|
if (file_exists ("../dyn/var.inc")) { |
35 |
|
|
include ("../dyn/var.inc"); |
36 |
|
|
} |
37 |
|
|
|
38 |
|
|
/** |
39 |
|
|
* Paramètres |
40 |
|
|
*/ |
41 |
|
|
set_time_limit(180); |
42 |
|
|
$DEBUG=0; |
43 |
|
|
$aff = "requeteur"; |
44 |
|
|
$validation = 0; |
45 |
|
|
if ($f->get_submitted_get_value('validation') !== null) { |
46 |
|
|
$validation = $f->get_submitted_get_value('validation'); |
47 |
|
|
} |
48 |
|
|
$idx = ""; |
49 |
|
|
if ($f->get_submitted_get_value('idx') !== null) { |
50 |
|
|
$idx = $f->get_submitted_get_value('idx'); |
51 |
|
|
} |
52 |
|
|
|
53 |
|
|
if ($f->get_submitted_post_value('sortie') != null) { |
54 |
|
|
$sortie= $f->get_submitted_post_value('sortie'); |
55 |
|
|
} else { |
56 |
|
|
$sortie ='tableau'; |
57 |
|
|
} |
58 |
|
|
$ent = _("Pilotage")."->".$obj; |
59 |
|
|
$ico = "ico_aide.png"; |
60 |
|
|
// |
61 |
|
|
$f->setTitle(_("Requetes memorisees")." -> "._($obj)); |
62 |
|
|
$f->setFlag(null); |
63 |
|
|
$f->display(); |
64 |
|
|
|
65 |
|
|
if (file_exists ("../sql/".OM_DB_PHPTYPE."/".$obj.".reqmo_pilot.inc.php")) { |
66 |
|
|
include ("../sql/".OM_DB_PHPTYPE."/".$obj.".reqmo_pilot.inc.php"); |
67 |
|
|
} |
68 |
|
|
elseif (file_exists ("../sql/".OM_DB_PHPTYPE."/".$obj.".reqmo_pilot.inc")) { |
69 |
|
|
include ("../sql/".OM_DB_PHPTYPE."/".$obj.".reqmo_pilot.inc"); |
70 |
|
|
} |
71 |
|
|
if ($f->get_submitted_get_value('step') !== null) { |
72 |
|
|
$step = $f->get_submitted_get_value('step'); |
73 |
|
|
} |
74 |
|
|
else { |
75 |
|
|
$step = 0; |
76 |
|
|
} |
77 |
|
|
// post separateur de champ (csv) |
78 |
|
|
if ($f->get_submitted_post_value('separateur') !== null) { |
79 |
|
|
$separateur= $f->get_submitted_post_value('separateur'); |
80 |
|
|
} else { |
81 |
|
|
$separateur =';'; |
82 |
|
|
} |
83 |
|
|
/** |
84 |
|
|
* |
85 |
|
|
*/ |
86 |
|
|
if ($step == 0) { |
87 |
|
|
$reqmo_pilot->displayForm($validation, "../app/reqmo_pilot.php", "../app/reqmo_pilot.php", false); |
88 |
|
|
} else { // On affiche le csv ou le tableau |
89 |
|
|
$retour = $reqmo_pilot->prepareRequest($reqmo); |
90 |
|
|
// Un des champs n'est pas rempli |
91 |
|
|
if ($retour !== true ){ |
92 |
|
|
$reqmo_pilot->displayForm($validation, "../app/reqmo_pilot.php", "../app/reqmo_pilot.php", $retour); |
93 |
|
|
} |
94 |
|
|
else { |
95 |
|
|
if ($sortie =='tableau') { |
96 |
|
|
$reqmo_pilot->displayTable("../app/reqmo_pilot.php"); |
97 |
|
|
} elseif ($sortie =='csv') { |
98 |
|
|
$reqmo_pilot->displayCSV($separateur, "../app/reqmo_pilot.php"); |
99 |
|
|
} else { |
100 |
|
|
$reqmo_pilot->displayPDF("../app/reqmo_pilot.php"); |
101 |
|
|
} |
102 |
|
|
} |
103 |
|
|
} |
104 |
|
|
} |
105 |
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
|
|
?> |