Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $csv = utf8_decode('Export des NC - audits centres
- Extrait du SIR Web - le '.date('d/m/Y').'
- Pour l'année : '.$annee.'
- Auditeur : '.$auditeur.'
- Zone audit : '.$zoneaudit.'
- Dpt : '.$departement.'
- ');
- $csv .= utf8_decode('Code centre;Agrément;Auditeur;Zone audit;Date audit;Numéro NC;Code NC;Délai AC;Délai Rép;Validée;Date Validation;Info val au centre;Date rel 1;Date rel 2;Dernier délai;Observations;Date codir;Sanction codir;Clôture d'Audit;Observations;Action corrective');
- foreach ($aResultStats as $row){
- $csv .= utf8_decode($row['FULL_CODE_CENTRE']).';';
- $csv .= utf8_decode($row['AGREMENT']).';';
- $csv .= utf8_decode($row['AUDITEUR']).';';
- $csv .= utf8_decode($row['ZONE_AUDIT']).';';
- $csv .= utf8_decode($row['DATE_AUDIT_CPL']).';';
- $csv .= '="'.utf8_decode($row['NUMERO_NC']).'";';
- $csv .= utf8_decode(trim($row['CODE_NC'])).';';
- $csv .= utf8_decode($row['DELAI_AC']).';';
- $csv .= utf8_decode($row['DELAI_REP']).';';
- $csv .= utf8_decode($row['VALIDEE']).';';
- $csv .= utf8_decode($row['DATE_VALID_CPL']).';';
- $csv .= utf8_decode($row['INFO_VAL_CENTRE']).';';
- $csv .= utf8_decode($row['DATE_REL1_CPL']).';';
- $csv .= utf8_decode($row['DATE_REL2_CPL']).';';
- $csv .= utf8_decode($row['DERNIER_DELAI_CPL']).';';
- $csv .= utf8_decode($row['OBSERVATIONS']).';';
- $csv .= utf8_decode($row['DAT_CODIR_CPL']).';';
- $csv .= utf8_decode($row['SANCTION_CODIR']).';';
- $csv .= utf8_decode($row['CLOTURE_AUDIT']).';';
- $csv .= utf8_decode(str_replace(array("rn","n"),' ',$row['OBS'])).';
- ';
- /*$csv .= utf8_decode(str_replace(array("\r", "", "\r"),array(" ", " ", " "),$row['OBS'])).';';*/
- $csv .= utf8_decode(str_replace(array("rn","n"),' ',$row['ACT_CORR'])).'
- ';
- }
- $filename = 'export_NC_audits_centre_' . date('Ymd') .'_' . date('His');
- header("Content-Type: application/vnd.ms-excel");
- header("Content-Disposition: attachment; filename=".$filename.".csv");
- echo $csv;
Add Comment
Please, Sign In to add comment