- Messaggi: 6
- Ringraziamenti ricevuti 2
The developer takes a few days off for Holidays...
...and will be back with charged battery!
From 23 December to 2 January included
During this period, assistance from developer will not be provided.
Si prega Accedi o Crea un account a partecipare alla conversazione.
Si prega Accedi o Crea un account a partecipare alla conversazione.
<?php // Show remaining seats for event ?>
<?php
$tempdb = JFactory::getDbo();
$query = $tempdb->getQuery(true);
$query
->select(array('count(*)', 't1.date', 't2.title', 'JSON_UNQUOTE(JSON_EXTRACT(t2.params,"$.maxReg")) AS capacity', '(JSON_UNQUOTE(JSON_EXTRACT(t2.params,"$.maxReg")) - count(*)) AS available'))
->from($tempdb->quoteName('#__icagenda_registration', 't1'))
->join('LEFT', $tempdb->quoteName('#__icagenda_events', 't2') . ' ON ' . $tempdb->quoteName('t1.eventid') . ' = ' . $tempdb->quoteName('t2.id'))
->where($tempdb->quoteName('t1.date') . ' LIKE "%' . $item->next . '%"')
->where($tempdb->quoteName('t2.title') . ' LIKE "%' . $item->title . '%"')
->where($tempdb->quoteName('t1.state') . ' = "1"')
->group($tempdb->quoteName('title'));
$tempdb->setQuery($query);
$tempResults = $tempdb->loadAssoc();
if ($tempResults["available"] > 0) {
echo $tempResults["available"]." seats available.";
} else {
echo "There are no seats available.";
}
?>
<?php // Show remaining seats for event ?>
<?php
$tempdb = JFactory::getDbo();
$query = $tempdb->getQuery(true);
$query
->select(array('t1.title', 'JSON_UNQUOTE(JSON_EXTRACT(t1.params,"$.maxReg")) AS capacity'))
->from($tempdb->quoteName('#__icagenda_events', 't1'))
->where($tempdb->quoteName('t1.period') . ' LIKE "%' . $evt . '%"')
->where($tempdb->quoteName('t1.title') . ' LIKE "%' . $item->title . '%"');
$tempdb->setQuery($query);
$tempResults = $tempdb->loadAssoc();
$capacity = $tempResults["capacity"];
$query = $tempdb->getQuery(true);
$query
->select(array('count(*)', 't1.date', 't2.title', 'JSON_UNQUOTE(JSON_EXTRACT(t2.params,"$.maxReg")) AS capacity', '(JSON_UNQUOTE(JSON_EXTRACT(t2.params,"$.maxReg")) - count(*)) AS available'))
->from($tempdb->quoteName('#__icagenda_registration', 't1'))
->join('LEFT', $tempdb->quoteName('#__icagenda_events', 't2') . ' ON ' . $tempdb->quoteName('t1.eventid') . ' = ' . $tempdb->quoteName('t2.id'))
->where($tempdb->quoteName('t1.date') . ' LIKE "%' . $evt . '%"')
->where($tempdb->quoteName('t2.title') . ' LIKE "%' . $item->title . '%"')
->where($tempdb->quoteName('t1.state') . ' = "1"')
->group($tempdb->quoteName('title'));
$tempdb->setQuery($query);
$tempResults = $tempdb->loadAssoc();
if ($tempResults == NULL) {
echo "$capacity seats available.";
} elseif ($tempResults["available"] > 0) {
echo $tempResults["available"]." seats available.";
} else {
echo "This venue is fully booked.";
}
?>
Si prega Accedi o Crea un account a partecipare alla conversazione.