<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

include_once GROCERY_CRUD;

class Relatorios extends Grocery {

    function __construct() 
    {
        parent::__construct();
		
		Assets::add_module_js('comdono', array(
            'main'
        ));
    }
    
    function index()
    {
        Assets::add_css(array(
            '../comdono/plugins/timeLine/css/style'
        ));
        
        Assets::add_module_js('atendimento', array(
            'relatorios',
            'atendimento_fila',
        ));
        
        $data['empreendimentos'] = $this->cad_model->getEmpreendimentos([['emp_status',4]]);
        
        $this->dataTables();
        
        $data['module']="";
        
        Template::set($data);
        Template::set_view('atendimento/relatorio/resumo_view');
        Template::render();
    }
    
    function old()
    {
        Assets::add_css(array(
            '../comdono/plugins/timeLine/css/style'
        ));
        
        Assets::add_module_js('atendimento', array(
            'relatorios',
            'atendimento_fila',
        ));
        
        $data['empreendimentos'] = $this->cad_model->getEmpreendimentos([['emp_status',4]]);
        
        $this->dataTables();
        
        $data['module']="";
        
        Template::set($data);
        Template::set_view('atendimento/relatorios_view');
        Template::render();
    }
    
    public function dataTables(){
	    Assets::add_css(array(
            '../comdono/plugins/dataTables/css/dataTables.bootstrap4.min',
            '../comdono/plugins/daterangepicker-v3.14/daterangepicker'
        ));
        
        Assets::add_js(array(
            '../comdono/plugins/dataTables/js/jquery.dataTables.min',
            '../comdono/plugins/dataTables/js/dataTables.bootstrap4.min',
            '../comdono/plugins/dataTables/js/dataTables.buttons.min.js',
            '../comdono/plugins/datetimepicker/js/moment',
            '../comdono/plugins/daterangepicker-v3.14/daterangepicker.min',
            /*'../comdono/plugins/dataTables/js/buttons.flash.min.js',
            '../comdono/plugins/dataTables/js/jszip.min.js',
            '../comdono/plugins/dataTables/js/vfs_fonts.js',
            '../comdono/plugins/dataTables/js/buttons.html5.min.js',*/
            //'../comdono/plugins/dataTables/js/config'
        ));
	}
    
}