<?php
@session_start();
class Xen extends MX_Controller{
	public function __construct(){
		if(!isset($_SESSION["app.gxc_sesion_id"]) || $_SESSION["app.gxc_sesion_id"]==0){
 			header('Location: '.base_url().'main/no_conectado');
 		}
		parent::__construct();
		$this->load->model('maestras/xen_model');
		$this->load->model('seguridad/xppo_model');
		date_default_timezone_set('America/Lima');
	}

	public function combo($id='', $descripcion='', $ids=0){
		$html 	= '';
		$ds 	= $this->xen_model->listar();
		if($id!=''&&$descripcion!='')
			$html 	.= '<option value="'.$id.'">'.$descripcion.'</option>';
		foreach ($ds->result() as $row) {
			$selected = ($row->exa_id==$ids)?'selected="selected"':'';
			$html 	.= '<option '.$selected.' value="'.$row->exa_id.'">'.$row->exa_descripcion.'</option>';
		}
		return $html;
	}
}