<?php
    if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class InfoOcupacion_Model extends CI_Model
{
    //Constructor 
    function __construct()
    {
        parent::__construct();
        //$this->load->library('encryption');
    }

    //Registrar Permisos
    public function getInforme($limit=false,$offset=false,$data)
    {
        $this->load->library('Consultar');
        $conn = $this->CI_Consultar->conexion(APP_SERVERNAME,APP_DBNAME,APP_USER,APP_PASS);
      
        $misql = "EXEC spGetInformes @Opcion            = ".$data[0].",
                                     @IdEstablecimiento = ".$data[1].",
                                     @FechaIni          = ".$data[2]."";
        // print_r($misql);
        // die();
        $results = $this->CI_Consultar->consultarsp($misql,$conn);
        $results = mb_convert_encoding($results ,'UTF-8', 'HTML-ENTITIES');
        return $results;
    }


	//Buscar informacion Reporte Diario
    public function getInfoV($limit=null,$offset=null,$data)
    {
        $this->load->library('Consultar');
        $conn = $this->CI_Consultar->conexion(APP_SERVERNAME,APP_DBNAME,APP_USER,APP_PASS);
      
        $misql = "EXEC spGetReporteDiario @Opcion            = ".$data[0].",
                                          @IdEstablecimiento = ".$data[1].",
                                          @FechaIni          = ".$data[2].",
                                          @HoraIni           = ".$data[3].",
                                          @FechaFin          = ".$data[4].",
                                          @HoraFin           = ".$data[5].",
                                          @IdUsuario         = ".$data[6]."";
        // print_r($misql); die();
        $results = $this->CI_Consultar->consultarsp($misql,$conn);
        $results = mb_convert_encoding($results ,'UTF-8', 'HTML-ENTITIES');
        return $results;
    }

    //Buscar informacion Reporte Diario
    public function getInfoH($limit=null,$offset=null,$data)
    {
        $this->load->library('Consultar');
        $conn = $this->CI_Consultar->conexion(APP_SERVERNAME,APP_DBNAME,APP_USER,APP_PASS);
      
        $misql = "EXEC spGetReportecliente @Opcion            = ".$data[0].",
                                           @IdEstablecimiento = ".$data[1].",
                                           @FechaIni          = ".$data[2].",
                                           @FechaFin          = ".$data[3].",
                                           @IdHuesped         = ".$data[4].",
                                           @Identificacion    = ".$data[5].",
                                           @Placa             = ".$data[6].",
                                           @NumeroHabitacion  = ".$data[7]."";
        // print_r($misql); die();
        $results = $this->CI_Consultar->consultarsp($misql,$conn);
        $results = mb_convert_encoding($results ,'UTF-8', 'HTML-ENTITIES');
        return $results;
    }
}
    