<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    /**
     *
     */
    class Main_model extends CI_Model {
        
        public function __construct() {
            parent::__construct();
        }
        
        
        public function traeCaracteristica($caracteristica)
        {
            $this->db->where ('id', $caracteristica);
            $query = $this->db->get ('caracteristica');
            if ($query->num_rows() == 1)
            {
                return $query->row();
            }else{
                return [];
            }
        }
        
        public function traeUsuario($id)
        {
            $this->db->where ('id', $id);
            $query = $this->db->get ('usuario');
            if ($query->num_rows() == 1)
            {
                return $query->row();
            }else{
                return [];
            }
        }
        
        public function traeRuta($id)
        {
            $this->db->where ('id', $id);
            $query = $this->db->get ('ruta');
            if ($query->num_rows() == 1)
            {
                return $query->row();
            }else{
                return [];
            }
        }

        public function traeSeccion($id)
        {
            $this->db->where ('id', $id);
            $query = $this->db->get ('seccion');
            if ($query->num_rows() == 1)
            {
                return $query->row();
            }else{
                return null;
            }
        }
    
    }
