<?php 
	include_once "../model/Datos.php";
	class HomeModel extends Datos{

		# Lista eventos en home
		public function home() {

			$query = $this->read("e.evenid, e.evennomb, e.evenubic,	 e.evenfech, e.evenimg1, dg.digedesc AS ciudad", "eventos e, divigeo dg", "dg.digeid = e.evenciud AND CONCAT(e.evenfech, ' ', e.evenhora) > CURRENT_TIMESTAMP AND e.evenesta = 19", "ORDER BY e.evenid LIMIT 6");
			
			return $query;
		}

		# Captura la categoria del evento o lista de eventos
		public function getCategories(){

			$query = $this->read("cv.cavaid, cv.cavadesc", "catavalo cv", "cv.cavacaid = 7 AND cv.cavaesta = 1", "ORDER BY cv.cavadesc ASC");
			
			return $query;
		}

		# Captura las ciudades para la visualizacion en ticket search
		public function getCities(){

			$query = $this->read("dg.digeid, dg.digedesc", "divigeo dg", "dg.digetipo = 34", "ORDER BY dg.digeid ASC"); 
			// AND dg.digerefe = $_SESSION['usuapais']

			return $query;
		}

		# Captura las fechas de eventos proximos para la visualizacion en ticket search
		public function getDates(){

			$query = $this->read("DISTINCT e.evenfech", "eventos e", "CONCAT(e.evenfech, ' ', e.evenhora) > CURRENT_TIMESTAMP AND e.evenesta = 19", "ORDER BY e.evenfech ASC");

			return $query;
		}
	}
?>