Subversion Repositories Applications.referentiel

Rev

Rev 335 | Rev 342 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 335 Rev 341
Line 203... Line 203...
203
		$ref = $p['ref'].'_v'.$p['version'];
203
		$ref = $p['ref'].'_v'.$p['version'];
204
		$racine_tmp = $this->config['chemins']['chemin_tmp'];
204
		$racine_tmp = $this->config['chemins']['chemin_tmp'];
205
		$dossier = $racine_tmp.date('Y_m_d').'/';
205
		$dossier = $racine_tmp.date('Y_m_d').'/';
206
		if(!is_dir($dossier)){
206
		if(!is_dir($dossier)){
207
			mkdir($dossier);
207
			mkdir($dossier);
-
 
208
			chmod($dossier, 0777);
208
		}
209
		}
209
		$fichier = $dossier.$ref."_".time().'.csv'; 
210
		$fichier = $dossier.$ref."_".time().'.csv'; 
210
		$champs = $this->formaterColonnes($p['champs'], $ref);
211
		$champs = $this->formaterColonnes($p['champs'], $ref);
211
		$requete = 'SELECT "'.implode('","', $champs['titre']).'" UNION (SELECT '.implode(', ',$champs['select']).
212
		$requete = 'SELECT "'.implode('","', $champs['titre']).'" UNION (SELECT '.implode(', ',$champs['select']).
212
			" INTO OUTFILE '".$fichier."' CHARACTER SET utf8 FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n' ". 
213
			" INTO OUTFILE '".$fichier."' CHARACTER SET utf8 FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n' ".