<?php Run::loadLibrary("phpexcel"); // **************************************************************************************************************************** class ModelExportToExcel { public $columns = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "V", "W", "U", "T", "X", "Y", "Z", "AA", "AB", "AC", "AD", "AE", "AF", "AG", "AH", "AI", "AJ", "AK", "AL", "AM", "AN", "AO", "AP", "AQ", "AR", "AS", "AV", "AW", "AU", "AT", "AX", "AY", "AZ", "BA", "BB", "BC", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BK", "BL", "BM", "BN", "BO", "BP", "BQ", "BR", "BS", "BV", "BW", "BU", "BT", "BX", "BY", "BZ"); // public $lista = array(); public $model = ""; public $time_initial = ""; public $time_final = ""; //************************************************************************************************************************* function __construct($model = false, $lista = array()) { $this->model = $model; $this->lista = $lista; $this->time_initial = microtime(true); } //************************************************************************************************************************* function download($lista = array()) { // Create new PHPExcel object $objPHPExcel = new PHPExcel(); // Set properties //Debug::print_r($this->lista); $objPHPExcel->getProperties()->setCreator("SCCON")->setLastModifiedBy(Run::$control->session->get(array('LOGIN', 'USER', 'nome')) . " " . Run::$control->session->get(array('LOGIN', 'USER', 'sobrenome')))->setTitle("Relatório da tabela " . $this->model->SETTINGS['TABLE'])->setSubject("Gerado em " . date("d/m/Y") . " às " . date("H:i:s"))->setDescription("Registros Totais: " . count($this->lista))->setKeywords("")->setCategory("Relatório SCCON"); $headerStyle = array('font' => array('bold' => true)); $trendiStyle = array('font' => array('bold' => false, 'size' => "15")); $nome_relatorio = isset($this->model->SETTINGS['NICK_NAME']) ? $this->model->SETTINGS['NICK_NAME'] : $this->model->SETTINGS['TABLE']; $sheet = $objPHPExcel->getActiveSheet();