1 |
<?php |
<?php |
2 |
// $Id: sitadel.php,v 1.20 2010-11-15 14:50:40 fraynaud Exp $ |
// $Id$ |
3 |
/* |
/* |
4 |
transfert de dossier � SITADEL |
transfert de dossier � SITADEL |
5 |
realis� ville arles par fr+jlb |
realis� ville arles par fr+jlb |
6 |
voir parametrage trt/sitadel.inc |
voir parametrage trt/sitadel.inc |
7 |
*/ |
*/ |
8 |
require_once "../obj/utils.class.php"; |
require_once "../obj/utils.class.php"; |
10 |
require_once "../dyn/locales.inc.php"; |
require_once "../dyn/locales.inc.php"; |
11 |
require_once "../dyn/version.inc.php"; |
require_once "../dyn/version.inc.php"; |
12 |
require_once "sitadel.inc"; |
require_once "sitadel.inc"; |
13 |
$f = new utils(NULL, "export", _("export SITADEL"), "ico_reqmo.png", "export"); |
$f = new utils(NULL, "export_sitadel", _("export SITADEL"), "ico_reqmo.png", "export"); |
14 |
$f->addHTMLHeadJs(array("../js/script.js")); |
$f->addHTMLHeadJs(array("../js/script.js")); |
15 |
// GET |
// GET |
16 |
if (isset ($_GET['validation'])){ |
if (isset ($_GET['validation'])){ |
66 |
"-".substr($_POST["datefin"],3,2)."-". |
"-".substr($_POST["datefin"],3,2)."-". |
67 |
substr($_POST["datefin"],0,2); |
substr($_POST["datefin"],0,2); |
68 |
if ($correct==true){ // *** |
if ($correct==true){ // *** |
69 |
// dossiers concern�s |
// dossiers concern�s |
70 |
$sql= "select * from ".DB_PREFIXE."dossier"; |
$sql= "select * from ".DB_PREFIXE."dossier"; |
71 |
$sql.= " where (nature='PC' or nature = 'PD' or nature = 'PA' or nature = 'DP')"; |
$sql.= " INNER JOIN ".DB_PREFIXE."dossier_autorisation |
72 |
|
ON dossier.dossier_autorisation=dossier_autorisation.dossier_autorisation |
73 |
|
INNER JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille |
74 |
|
ON dossier_autorisation.dossier_autorisation_type_detaille |
75 |
|
= dossier_autorisation_type_detaille.dossier_autorisation_type_detaille"; |
76 |
|
$sql.= " where (dossier_autorisation_type_detaille.code='PCI' |
77 |
|
or dossier_autorisation_type_detaille.code='PCA' |
78 |
|
or dossier_autorisation_type_detaille.code = 'PD' |
79 |
|
or dossier_autorisation_type_detaille.code = 'PA' |
80 |
|
or dossier_autorisation_type_detaille.code = 'DP')"; |
81 |
$sql.= " AND ((date_depot >='".$datedebut."' AND date_depot<='".$datefin."')"; |
$sql.= " AND ((date_depot >='".$datedebut."' AND date_depot<='".$datefin."')"; |
82 |
$sql.= " OR (date_decision>='".$datedebut."' AND date_decision<='".$datefin."')"; |
$sql.= " OR (date_decision>='".$datedebut."' AND date_decision<='".$datefin."')"; |
83 |
$sql.= " OR (date_chantier>='".$datedebut."' AND date_chantier<='".$datefin."'))"; |
$sql.= " OR (date_chantier>='".$datedebut."' AND date_chantier<='".$datefin."'))"; |
169 |
// or !isset($row['date_decision'])){ |
// or !isset($row['date_decision'])){ |
170 |
//if(isset($row['date_decision']) and $row['date_decision']!=""){ |
//if(isset($row['date_decision']) and $row['date_decision']!=""){ |
171 |
// avis_sitadel et avis_sitadel_motif |
// avis_sitadel et avis_sitadel_motif |
172 |
if($row['avis']!=''){ |
if($row['avis_decision']!=''){ |
173 |
$avis_sitadel = "0"; |
$avis_sitadel = "0"; |
174 |
$avis_sitadel_motif="0" ; |
$avis_sitadel_motif="0" ; |
175 |
$sql="select sitadel, sitadel_motif from ".DB_PREFIXE."avis where avis ='". |
$sql="select sitadel, sitadel_motif from ".DB_PREFIXE."avis_decision where avis_decision ='". |
176 |
$row['avis']."'"; |
$row['avis_decision']."'"; |
177 |
$res1 = $f->db -> query ($sql); |
$res1 = $f->db -> query ($sql); |
178 |
$f->isDatabaseError($res1); |
$f->isDatabaseError($res1); |
179 |
while ($row1=& $res1->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row1=& $res1->fetchRow(DB_FETCHMODE_ASSOC)){ |
275 |
$modificatif.=$g->entete("MODIFICATIF",$departement,$commune,$pf_departement); |
$modificatif.=$g->entete("MODIFICATIF",$departement,$commune,$pf_departement); |
276 |
if(isset($row['date_decision']) or $row['date_decision']==""){ |
if(isset($row['date_decision']) or $row['date_decision']==""){ |
277 |
// avis_sitadel et avis_sitadel_motif |
// avis_sitadel et avis_sitadel_motif |
278 |
if($row['avis']!=''){ |
if($row['avis_decision']!=''){ |
279 |
$avis_sitadel = 0; |
$avis_sitadel = 0; |
280 |
$avis_sitadel_motif=0 ; |
$avis_sitadel_motif=0 ; |
281 |
$sql="select sitadel, sitadel_motif from ".DB_PREFIXE."avis where avis ='". |
$sql="select sitadel, sitadel_motif from ".DB_PREFIXE."avis_decision where avis_decision ='". |
282 |
$row['avis']."'"; |
$row['avis_decision']."'"; |
283 |
$res1 = $f->db -> query ($sql); |
$res1 = $f->db -> query ($sql); |
284 |
$f->isDatabaseError($res1); |
$f->isDatabaseError($res1); |
285 |
while ($row1=& $res1->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row1=& $res1->fetchRow(DB_FETCHMODE_ASSOC)){ |
373 |
$cpt=0; |
$cpt=0; |
374 |
for($i=0;$i<sizeof($nbenr);$i++){ |
for($i=0;$i<sizeof($nbenr);$i++){ |
375 |
// mb_strlen( variable,encoding) PHP 4 >= 4.0.6, PHP 5 |
// mb_strlen( variable,encoding) PHP 4 >= 4.0.6, PHP 5 |
376 |
// Le param�tre encoding est l'encodage des caract�res. |
// Le param�tre encoding est l'encodage des caract�res. |
377 |
// S'il est omis, l'encodage de caracteres interne sera utilis�. |
// S'il est omis, l'encodage de caracteres interne sera utilis�. |
378 |
$tmp[$i] = strlen($nbenr[$i]); |
$tmp[$i] = strlen($nbenr[$i]); |
379 |
//echo strlen($nbenr[$i])." ".$nbenr[$i]."<br>"; |
//echo strlen($nbenr[$i])." ".$nbenr[$i]."<br>"; |
380 |
$cpt++; |
$cpt++; |