Subversion Repositories Applications.referentiel

Compare Revisions

Ignore whitespace Rev 349 → Rev 350

/trunk/services/modules/Referentiel.php
199,7 → 199,7
public function getElementExport($param) {
// Initialisation des variables
$info = array();
$p = $this->traiterParametresUrl(array("ref","version","champs","filtre"), $param, false);
$p = $this->traiterParametresUrl(array("ref","version","champs","filtre", "encodage"), $param, false);
$ref = $p['ref'].'_v'.$p['version'];
$racine_tmp = $this->config['chemins']['chemin_tmp'];
$dossier = $racine_tmp.date('Y_m_d').'/';
211,9 → 211,10
if (isset($p['champs'])) {
$champs = $this->formaterColonnes($p['champs'], $ref);
$requete = 'SELECT "'.implode('","', $champs['titre']).'" UNION (SELECT '.implode(', ',$champs['select']).
" INTO OUTFILE '".$fichier."' CHARACTER SET utf8 FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n' ".
" INTO OUTFILE '".$fichier."' CHARACTER SET ".$p['encodage']." FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n' ".
" FROM $ref a left join $ref b on b.num_nom=a.num_nom_retenu";
if (isset($p['filtre']) && $p['filtre'] != "*") {
$param_filtres = explode(",",$p["filtre"]);
$dernier_filtre = array_pop($param_filtres);