".$obj; $ico = "ico_aide.png"; /** * Classe utils () */ $f = new utils (); $f -> headerhtml (); $f -> collectivite (); $f -> droit ("reqmo"); $f -> header (1, $ent); echo "\n
\n"; if ($_SESSION ['profil'] > 0 && $_SESSION ['profil'] >= $f -> droit) { if (isset($langue)){ if (file_exists ("../sql/".$f -> phptype."/".$langue."/".$obj.".reqmo.inc")) include ("../sql/".$f -> phptype."/".$langue."/".$obj.".reqmo.inc"); }else{ if (file_exists ("../sql/".$f -> phptype."/".$obj.".reqmo.inc")) include ("../sql/".$f -> phptype."/".$obj.".reqmo.inc"); } if (isset ($_GET ['step'])) $step = $_GET ['step']; else $step = 0; // Si step == 0 on affiche le formulaire if ($step == 0) { $validation = 1; $cptemp = 0; $cpts=0; $cptsel=0; echo "
"; echo ""; echo ""; echo ""; echo ""; // On sépare tous les champs entre crochets dans la requête $temp = explode ("[", $reqmo ["sql"]); for ($i = 1; $i < sizeof ($temp); $i++) { // On vire le crochet de la fin $temp1 = explode("]", $temp [$i]); // On check si alias $temp4 = explode (" as ", $temp1 [0]); if (isset ($temp4 [1])) $temp1 [0] = $temp4 [1]; // On remplace les _ par des espaces // $temp6 = str_replace ('_', ' ', $temp1 [0]); // supprimer dans la version internationale $temp6 = $temp1 [0]; if (!isset ($reqmo [$temp1 [0]])) { //saisie criteres where // if ($cpts == 0) echo ""; elseif ($cpts == 4) { echo ""; $cpts = 0; } echo ""; echo ""; $cpts++; } else { if ($reqmo [$temp1 [0]] == "checked") { if ($cptemp == 0) echo ""; elseif ($cptemp == 4) { echo ""; $cptemp = 0; } echo ""; $cptemp++; } else { $temp3 = ""; $temp3 = $reqmo [$temp1 [0]]; if(!is_array($temp3)) $temp3 = substr ($temp3, 0, 6); if ($temp3 == "select") { if ($cptsel == 0) echo ""; elseif ($cptsel == 4) { echo ""; $cptsel = 0; } echo ""; } else { if ($cptsel == 0) echo ""; elseif ($cptsel == 4) { echo ""; $cptsel = 0; } echo ""; } } } // re initialisation $temp1[0]=""; } echo ""; echo ""; // echo ""; echo ""; // echo ""; // echo ""; // echo ""; // echo ""; // echo ""; // echo ""; // //echo ""; echo "
  "; echo "\"".$f-lang("reqmo")."\" title=\"".$f->lang("reqmo")."\" /> ".strtoupper($f -> lang("recherche"))." ".strtoupper($f -> lang($reqmo["libelle"])); echo ""; echo "lang("recherche")."\" style='".$styleBouton ."' />"; echo "  \"".$f-lang("retour")."\" title=\"".$f->lang("retour")."\" />"; echo " 
 
  ".$f->lang($temp6)."  
 
   ".$f->lang($temp6)."  
 
 ".$f->lang($temp6)." "; echo ""; $cptsel++; echo " 
 
 ".$f->lang($temp6)." "; // echo ""; $cptsel++; echo " 
 ".$f->lang("sortie")." "; echo ""; echo " ".$f->lang("separateur_champ")." "; echo ""; echo " ".$f->lang("limite")." "; echo ""; echo " 
 
"; echo "
"; //aide //echo "
aide"; echo "
"; echo "
"; echo ""; echo ""; echo ""; echo "
".$f->lang("afficher_ou_non")."            ".$f->lang("criteres_recherche_tri")."            ".$f->lang("criteres_sortie")."    
"; echo"
"; } else // On affiche le csv ou le tableau { $temp = explode ("[",$reqmo["sql"]); for($i = 1; $i < sizeof ($temp); $i++) { $temp1 = explode ("]", $temp [$i]); $temp4 = explode (" as ", $temp1 [0]); if (isset ($temp4 [1])) $temp5 = $temp4 [1]; // uniquement as else $temp5 = $temp1 [0]; // en entier if (isset ($_POST [$temp5])) $temp2 = $_POST [$temp5]; else $temp2 = ""; if($reqmo[$temp5]=="checked") { if ($temp2 == 'Oui') { $reqmo ['sql'] = str_replace ("[".$temp1[0]."]",$temp1[0],$reqmo['sql']); } else { $reqmo['sql']=str_replace("[".$temp1[0]."],",'',$reqmo['sql']); $reqmo['sql']=str_replace(",[".$temp1[0]."]",'',$reqmo['sql']); $reqmo['sql']=str_replace(", [".$temp1[0]."]",'',$reqmo['sql']); $reqmo['sql']=str_replace("[".$temp1[0]."]",'',$reqmo['sql']); } } else { $reqmo['sql']=str_replace("[".$temp1[0]."]",$temp2,$reqmo['sql']); } $temp1[0]=""; } $blanc = 0; $temp = ""; for($i=0;$i db -> query ($reqmo['sql']); if (DB :: isError($res)) die($res->getMessage()."erreur ".$reqmo['sql']); else { $info = $res -> tableInfo (); if ($sortie =='tableau') { echo ""; foreach($info as $elem) echo ""; echo ""; while ($row=& $res->fetchRow()) { echo ""; $i=0; foreach($row as $elem) { if (is_numeric($elem)) echo ""; $i++; } echo ""; } echo "
".$elem['name']."
"; else echo ""; echo $elem."
"; } else { $inf=""; foreach ($info as $elem) { //echo $elem['name'].$separateur; $inf=$inf.$elem['name'].$separateur; } //echo "
"; $inf .= "\n"; while ($row=& $res->fetchRow()) { $i=0; foreach($row as $elem) { //echo $elem.$separateur; $inf .= $elem.$separateur; $i++; } //echo "
"; $inf .= "\n"; } $nom_fichier="export_".$obj.".csv"; $fic = fopen ("../tmp/".$nom_fichier,"w"); fwrite ($fic, $inf); fclose ($fic); // $msg = $f->lang("voir")." ".$f->lang("resultat")." ".$f->lang("recherche")." : "; // $msg .= "\"".$f-lang("voir")." ".$nom_fichier."\" title=\"".$f->lang("voir")." ".$nom_fichier."\" />
"; // $msg .= $f->lang("resultat")." /tmp/".$nom_fichier.".
"; // echo $msg; // modification du 25 aout pour acces enregistrement sur clic $msg = $f->lang("message_1"); $msg .= "\"Fichier
"; $msg .= $f->lang("message_2")."\"".$nom_fichier."\".
"; echo $msg; } echo "
\"".$f-lang("retour")."\" title=\"".$f->lang("retour")."\" />
"; } } } else { echo "
".$f->lang("attention")." ".$f->lang("droit").$f->lang("pluriel")." ".$f->lang("insuffisant").$f->lang("pluriel")." - ". $f->lang("votre_profil_est")." : [".$_SESSION['profil']."]
"; } echo "\n
\n"; /** * */ $f -> footer (); $f -> deconnexion (); $f -> footerhtml (); ?>