Example #1
0
 function getListQuery()
 {
     $params = $this->state->params;
     $jinput = JFactory::getApplication()->input;
     $task = $jinput->getCmd('task');
     $user = JFactory::getUser();
     // Create a new query object.
     $query = parent::getListQuery();
     // limit output so only future events the user attends will be shown
     if ($params->get('filtermyregs')) {
         $query->where(' DATE_SUB(NOW(), INTERVAL ' . (int) $params->get('myregspast') . ' DAY) < (IF (a.enddates IS NOT NULL, a.enddates, a.dates)) ');
     }
     // then if the user is attending the event
     $query->join('LEFT', '#__jem_register AS r ON r.event = a.id');
     $query->where('r.uid = ' . $user->id);
     return $query;
 }
Example #2
0
 /**
  * @return	JDatabaseQuery
  */
 function getListQuery()
 {
     $params = $this->state->params;
     $jinput = JFactory::getApplication()->input;
     $task = $jinput->getCmd('task');
     // Create a new query object.
     $query = parent::getListQuery();
     $query->where('a.locid = ' . $this->_id);
     // here we can extend the query of the Eventslist model
     return $query;
 }
Example #3
0
	/**
	 * @return JDatabaseQuery
	 */
	function getListQuery()
	{
		// Let parent create a new query object.
		$query = parent::getListQuery();

		// here we can extend the query of the Eventslist model
		$query->select('DATEDIFF(a.enddates, a.dates) AS datesdiff,DAYOFMONTH(a.dates) AS start_day, YEAR(a.dates) AS start_year, MONTH(a.dates) AS start_month');

		return $query;
	}
Example #4
0
 /**
  * @return	JDatabaseQuery
  */
 function getListQuery()
 {
     $params = $this->state->params;
     $jinput = JFactory::getApplication()->input;
     $task = $jinput->getCmd('task');
     // Create a new query object.
     $query = parent::getListQuery();
     $query->select('DATEDIFF(a.enddates, a.dates) AS datesdiff,DAYOFWEEK(a.dates) AS weekday, DAYOFMONTH(a.dates) AS start_day, YEAR(a.dates) AS start_year, MONTH(a.dates) AS start_month, WEEK(a.dates) AS weeknumber');
     return $query;
 }
Example #5
0
 /**
  * @return	JDatabaseQuery
  */
 function getListQuery()
 {
     $params = $this->state->params;
     $jinput = JFactory::getApplication()->input;
     $task = $jinput->getCmd('task');
     // Create a new query object.
     $query = parent::getListQuery();
     $query->select('DATEDIFF(a.enddates, a.dates) AS datesdiff,DAYOFMONTH(a.dates) AS start_day, YEAR(a.dates) AS start_year, MONTH(a.dates) AS start_month');
     // here we can extend the query of the Eventslist model
     return $query;
 }
Example #6
0
	/**
	 * @return	JDatabaseQuery
	 */
	function getListQuery()
	{
		$params  = $this->state->params;
		$jinput  = JFactory::getApplication()->input;
		$task    = $jinput->get('task','','cmd');

		$requestVenueId 	= $this->getState('filter.req_venid');

		// Create a new query object.
		$query = parent::getListQuery();

		if ($requestVenueId){
			$query->where(' a.locid = '.$this->_db->quote($requestVenueId));
		}

		// Second is to only select events of the specified day
		$query->where('('.$this->_db->quote($this->_date).' BETWEEN (a.dates) AND (IF (a.enddates >= a.dates, a.enddates, a.dates)) OR '.$this->_db->quote($this->_date).' = a.dates)');

		return $query;
	}
Example #7
0
	/**
	 * @return	JDatabaseQuery
	 */
	function getListQuery()
	{
		//$params  = $this->state->params;
		//$jinput  = JFactory::getApplication()->input;
		//$task    = $jinput->get('task','','cmd');

		// Create a new query object.
		$query = parent::getListQuery();

		// here we can extend the query of the Eventslist model
		return $query;
	}
Example #8
0
	/**
	 * @return	JDatabaseQuery
	 */
	function getListQuery()
	{
		// Let parent create a new query object.
		$query = parent::getListQuery();

		$query->select('DATEDIFF(a.enddates, a.dates) AS datesdiff, DAYOFWEEK(a.dates) AS weekday, DAYOFMONTH(a.dates) AS start_day, YEAR(a.dates) AS start_year, MONTH(a.dates) AS start_month, WEEK(a.dates) AS weeknumber');

		return $query;
	}
Example #9
0
	/**
	 * @return	JDatabaseQuery
	 */
	function getListQuery()
	{
		// Create a new query object.
		$query = parent::getListQuery();

		// here we can extend the query of the Eventslist model
		$query->where('a.locid = '.(int)$this->_id);

		return $query;
	}