<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Base
 *
 * @author Developer
 */
class Base extends MX_Controller {
/**
 * Método constructor. 
 */
    public function __construct() {
        parent::__construct();
        $this->load->model('Base_model');
    }

//-----------------------------------------------------------------------------
    public function index() { 
    	
        if ($this->session->userdata('logged_in')) {
            
        }
    }

//-----------------------------------------------------------------------------
    /**
     * Autocompletado. 
     */
    public function autocomplete_ciudades() {
        if ($this->session->userdata('logged_in')) {
            $phrase = $this->input->post('phrase');
            $resultado = $this->Base_model->autocomplete('gen04ciudad', 'COD_CIUDAD', 'TEX_NOMCIU', $phrase, 'COD_CIUDAD', 'TEX_NOMCIU');
            echo json_encode($resultado);
        } else {
            $this->redirect_no_login();
        }
    }

}
