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

// include_once GROCERY_CRUD;

class Sql extends Admin_Controller{
		
	public function __construct()
	{
		parent::__construct();
		$this->load->model('sistema/Configuracoes_model');
		$this->load->model('administrativo/admin_model');
	}
    
    public function index() 
    {
        
        $data['responsaveis'] = $this->admin_model->getCadUsers([['perfil',1]]);
        $data['responsavel'] = $this->session->all_userdata();
        
        $versao = $this->Configuracoes_model->get_version();
        if($versao != NULL)
            $data['versao'] = (int)$versao->version+1;
        else
            $data['versao'] = "Error";
        
        $sqls = $this->Configuracoes_model->get_sqls();
        if($sqls != NULL)
            $data['sqls'] = $sqls;
        else
            $data['sqls'] = "";
            
        Assets::add_module_css('sistema', array(
        ));
            
        Assets::add_module_js('sistema', array(
            'sql_migration'
        ));
            
        Template::set($data);
		Template::set_view('sql_migration_view');
		Template::render();
    }
    
    
	
	
}