<?php

class LogsIdebo extends Controller {

    protected $model;

    public function __construct() {
        parent::__construct();
        $this->model = $this->loadModel('logsIdebo_model');
    }

    public function index($id_usuario = FALSE) {
        $locales = $this->model->getLocales();

        $css_template = array('logsIdebo');
        $js_template = array('logsIdebo');
        $page_template = 'logsIdebo/index';
        $url_logsIdebo = URL_SITIO . 'logsIdebo';

        require APP_DIR . '/views/_templates/general.php';
    }

    public function action($action) {
        if ($action == 'getLogs' && isset($_POST['local'])) {
            $historicos = $this->model->getHistoricoLogs($_POST['local']);
            $page_template = 'logsIdebo/action_getLogs';
        }

        if ($action == 'getLog' && isset($_POST['local'])) {
            $file = $_POST['archLog'];
            $log = $this->model->getLogFromLocal($file);
            $page_template = 'logsIdebo/action_getLog';
        }

        $css_template = array();
        $js_template = array();
        require APP_DIR . '/views/_templates/blank.php';
    }

    public function delete($id = NULL) {
        
    }

}
