<?php namespace App\Controllers;

use App\Controllers\BaseController;
use App\Libraries\Make_bread;
use App\Models\ConfiguracioModel;
use http\Url;

class Configuracio extends BaseController
{

    /*
     * Configuracio
     */
	public function index()
	{
        $session = session();
        if(!session()->get('isLoggedIn')){
            return  redirect()->to(base_url().'/auth');
        }
        $make_bread = new Make_bread;
        $data=[
            'heading' =>'Configuració',
        ];
        $make_bread->add('Configuració', 'configuracio', TRUE);
        $breadcrumb = $make_bread->output();
        $data['breadcrumb'] =$breadcrumb;

        $db =  db_connect();
        $configuracio = new ConfiguracioModel($db);
        $currentEmpresaId = session()->get('empresa_id_user');
        $data['empresa'] = $configuracio->getEmpresa($currentEmpresaId);
		return view('admin/app/configuracio', $data);
	}

}