daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $csv = utf8_decode('Export des NC - audits centres
  2.  
  3.         Extrait du SIR Web - le '.date('d/m/Y').'
  4.         Pour l'année : '.$annee.'
  5.         Auditeur : '.$auditeur.'
  6.         Zone audit : '.$zoneaudit.'
  7.         Dpt : '.$departement.'
  8.  
  9.         ');
  10.         $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');
  11.  
  12.         foreach ($aResultStats as $row){
  13.  
  14.             $csv .= utf8_decode($row['FULL_CODE_CENTRE']).';';
  15.             $csv .= utf8_decode($row['AGREMENT']).';';
  16.             $csv .= utf8_decode($row['AUDITEUR']).';';
  17.             $csv .= utf8_decode($row['ZONE_AUDIT']).';';
  18.             $csv .= utf8_decode($row['DATE_AUDIT_CPL']).';';
  19.             $csv .= '="'.utf8_decode($row['NUMERO_NC']).'";';
  20.             $csv .= utf8_decode(trim($row['CODE_NC'])).';';
  21.             $csv .= utf8_decode($row['DELAI_AC']).';';
  22.             $csv .= utf8_decode($row['DELAI_REP']).';';
  23.             $csv .= utf8_decode($row['VALIDEE']).';';
  24.             $csv .= utf8_decode($row['DATE_VALID_CPL']).';';
  25.             $csv .= utf8_decode($row['INFO_VAL_CENTRE']).';';
  26.             $csv .= utf8_decode($row['DATE_REL1_CPL']).';';
  27.             $csv .= utf8_decode($row['DATE_REL2_CPL']).';';
  28.             $csv .= utf8_decode($row['DERNIER_DELAI_CPL']).';';
  29.             $csv .= utf8_decode($row['OBSERVATIONS']).';';
  30.             $csv .= utf8_decode($row['DAT_CODIR_CPL']).';';
  31.             $csv .= utf8_decode($row['SANCTION_CODIR']).';';
  32.             $csv .= utf8_decode($row['CLOTURE_AUDIT']).';';
  33.             $csv .= utf8_decode(str_replace(array("rn","n"),' ',$row['OBS'])).';
  34. ';
  35.             /*$csv .= utf8_decode(str_replace(array("\r", "", "\r"),array(" ", " ", " "),$row['OBS'])).';';*/
  36.             $csv .= utf8_decode(str_replace(array("rn","n"),' ',$row['ACT_CORR'])).'
  37. ';
  38.  
  39.     }
  40.  
  41.       $filename = 'export_NC_audits_centre_' . date('Ymd') .'_' . date('His');
  42.         header("Content-Type: application/vnd.ms-excel");
  43.         header("Content-Disposition: attachment; filename=".$filename.".csv");
  44.  
  45.         echo $csv;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top