/**
  * Constructor
  * @param adminDb $db
  * @param bool $showTypeID
  */
 public function __construct(adminDb $db, $showTypeID = false)
 {
     $this->db = $db;
     $this->servKey = $db->getServKey();
     $query = "SELECT a.*,d.id_doc,d.basename,d.dirname,t.nom type FROM acces a\n\t\t\t LEFT JOIN documents d USING(id_doc)\n\t\t\t LEFT JOIN types t USING (id_type)";
     if ($showTypeID !== false) {
         $query .= " WHERE t.id_type = {$showTypeID}";
     }
     $query .= " ORDER BY a.id_type, a.name";
     $stmt = $db->query($query);
     $stmt->setFetchMode(PDO::FETCH_CLASS, 'AdminDocumentAccess', array($this->servKey, $db));
     $this->access = $stmt->fetchAll();
     unset($stmt);
 }
 /**
  * Constructor
  * @param adminDb $db
  * @param bool $showTypeID
  */
 public function __construct(adminDb $db, $showTypeID = false)
 {
     $this->db = $db;
     $this->servKey = $db->getServKey();
     $query = "\n          SELECT\n            aa.*,\n            a.*,\n            t.nom type\n          FROM archives_acces aa\n            LEFT JOIN archives a USING (id_archive)\n            LEFT JOIN types t USING (id_type)";
     if ($showTypeID !== false) {
         $query .= " WHERE t.id_type = {$showTypeID}";
     }
     $query .= " ORDER BY aa.id_type, aa.rank";
     $stmt = $db->query($query);
     $stmt->setFetchMode(PDO::FETCH_CLASS, 'AdminArchiveAccess', array($this->servKey, $db));
     $this->access = $stmt->fetchAll();
     unset($stmt);
 }
$style_thead_commercial_brochures = $style_thead_technical_brochures;
$style_thead_subcategory = array('font' => array('bold' => true, 'size' => 12, 'name' => 'Arial', 'color' => array('rgb' => 'FFFFFF')), 'borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('rgb' => '000000')), 'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('rgb' => 'FFFFFF'))), 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'color' => array('rgb' => '000000')), 'alignment' => array('shrinkToFit' => true, 'wrap' => true, 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT));
$style_access_line = array('font' => array('bold' => true, 'size' => 11, 'name' => 'Arial', 'color' => array('rgb' => '000000')), 'borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('rgb' => '000000'))), 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'color' => array('rgb' => 'FFFFFF')), 'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT));
/* -------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* -------------- Récupération  & exportation des données ------------- */
/* -------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
try {
    $db = new adminDb(DSN, USER, PASSW);
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
} catch (PDOException $e) {
    die("Erreur PDO : <br />" . $e->getMessage() . "<br />Trace : " . $e->getTraceAsString());
}
$servKey = $db->getServKey();
/* Catégories */
$theads = array('Name', 'Document Name', 'Ref', 'Size');
$theads_cnt = count($theads);
$title_line = 3;
$thead_line = 5;
$first = true;
$current_type = 'new';
$current_cat = 'new';
$current_product = 'new';
$i = 1;
$sheet_cnt = 0;
$workbook = new PHPExcel();
/* -------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* ----------------------------- Brochures ---------------------------- */