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

//require_once '../builder/modules/grocery/libraries/Grocery_CRUD.php';
//require_once APPPATH . 'libraries/vendor/autoload.php';

    
class AceitaCookie 
{
    private $CI;
    static private $CIs;
    
    function __construct() 
    {
        parent::__construct();
        $this->CI =& get_instance();
        //self::$CIs =& get_instance();
        //self::$CIs->load->model('newsletter/newsletter_model');
        self::$CI->load->helper('cookie');
    }
    
    static function ini($nome_pagina = ''){
        
        delete_cookie('aceita_cookie'); 
        
        //return false;
        
        if((get_cookie('aceita_cookie')??'') != 'aceito'){
            
            Assets::add_module_css('cookie', array(
                'style'
            ));
            Assets::add_module_js('cookie', array(
                'script'
            ));
            Template::set_modal([],[
                'cookie/cookie_view'
            ]);
        }
    }
    
}