/**
  * Certicates / revokes certification of the booking
  *
  * @throws  Exception - if query fails
  * @return  void
  */
 public function certificate()
 {
     $input = JFactory::getApplication()->input;
     $booking_ids = $input->get("cid", array(), 'array');
     $database = JFactory::getDBO();
     if (count($booking_ids)) {
         $uids = implode(',', $booking_ids);
         $database->setQuery("SELECT * FROM #__matukio_bookings WHERE id IN ({$uids})");
         $rows = $database->loadObjectList();
         if ($database->getErrorNum()) {
             throw new Exception($database->stderr(), 42);
         }
         foreach ($rows as $row) {
             if ($this->task == "certificate") {
                 $database->setQuery("UPDATE #__matukio_bookings SET certificated='1' WHERE id='{$row->id}'");
                 $certmail = 6;
             }
             if ($this->task == "uncertificate") {
                 $database->setQuery("UPDATE #__matukio_bookings SET certificated='0' WHERE id='{$row->id}'");
                 $certmail = 7;
             }
             if (!$database->execute()) {
                 throw new Exception($database->stderr(), 42);
             }
             $event = MatukioHelperUtilsEvents::getEventRecurring($row->semid);
             MatukioHelperUtilsEvents::sendBookingConfirmationMail($event, $row->id, $certmail);
         }
     }
     $link = 'index.php?option=com_matukio&view=bookings';
     $this->setRedirect($link);
 }
Example #2
0
 /**
  * Displays the map
  *
  * @param   bool  $cachable   - Cachable
  * @param   bool  $urlparams  - Params
  *
  * @return JControllerLegacy|void
  */
 public function display($cachable = false, $urlparams = false)
 {
     $model = $this->getModel('Event', 'MatukioModel');
     $eventId = JFactory::getApplication()->input->getInt('event_id', 0);
     $locationId = JFactory::getApplication()->input->getInt('location_id', 0);
     $view = $this->getView('Map', 'html', 'MatukioView');
     if (!empty($eventId)) {
         $event = $model->getItem($eventId);
         $view->event = $event;
     } else {
         $view->event = null;
     }
     if (!empty($locationId)) {
         $view->location = MatukioHelperUtilsEvents::getLocation($locationId);
     } else {
         $view->location = null;
     }
     $view->display();
 }
 /**
  * Generates the file and outputs it as $filetype
  *
  * @return  string
  */
 public function downloadFile()
 {
     $my = JFactory::getUser();
     $daten = trim(JFactory::getApplication()->input->get('a6d5dgdee4cu7eho8e7fc6ed4e76z', ''));
     $cid = substr($daten, 40);
     $dat = substr($daten, 0, 40);
     $kurs = MatukioHelperUtilsEvents::getEventRecurring($cid);
     $datfeld = MatukioHelperUtilsEvents::getEventFileArray($kurs);
     for ($i = 0; $i < count($datfeld[0]); $i++) {
         if (sha1(md5($datfeld[0][$i])) == $dat and ($datfeld[2][$i] == 0 or $my->id > 0 and $datfeld[2][$i] > 0)) {
             $datname = $datfeld[0][$i];
             $datcode = "file" . ($i + 1) . "code";
             $daten = base64_decode($kurs->{$datcode});
             $datext = array_pop(explode(".", strtolower($datname)));
             header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
             header("Pragma: public");
             header("Content-Type: application/{$datext}");
             header("Content-Disposition: inline; filename=\"{$datname}\"");
             header("Content-Length: " . strlen($daten));
             echo $daten;
             exit;
         }
     }
 }
 /**
  * Rates an event
  *
  * @throws  Exception if user is not logged in
  * @return  void / redirect
  */
 public function rate()
 {
     // Check if user is logged in
     if (JFactory::getUser()->id == 0) {
         throw new Exception("COM_MATUKIO_NO_ACCESS");
     }
     $msg = JText::_("COM_MATUKIO_RATING_SUCCESSFULL");
     $mainframe = JFactory::getApplication();
     jimport('joomla.mail.helper');
     $my = JFactory::getuser();
     $database = JFactory::getDBO();
     $cid = JFactory::getApplication()->input->getInt('cid', 0);
     $grade = JFactory::getApplication()->input->getInt('grade', 0);
     $text = JFactory::getApplication()->input->get('text', '');
     $text = str_replace(array("\"", "\\'"), "", $text);
     $text = JMailHelper::cleanBody($text);
     $database->setQuery("UPDATE #__matukio_bookings SET grade='" . $grade . "', comment='" . $text . "' WHERE semid='" . $cid . "' AND userid='" . $my->id . "'");
     if (!$database->execute()) {
         JError::raiseError(500, $database->getError());
         exit;
     }
     $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid='" . $cid . "'");
     $rows = $database->loadObjectList();
     $zaehler = 0;
     $wertung = 0;
     foreach ($rows as $row) {
         if ($row->grade > 0) {
             $wertung = $wertung + $row->grade;
             $zaehler++;
         }
     }
     if ($zaehler > 0) {
         $geswert = round($wertung / $zaehler);
     } else {
         $geswert = 0;
     }
     $database->setQuery("UPDATE #__matukio SET grade='{$geswert}' WHERE id='{$cid}'");
     if (!$database->execute()) {
         JError::raiseError(500, $database->getError());
         $msg = "COM_MATUKIO_RATING_FAILED " . $database->getError();
     }
     if (MatukioHelperSettings::getSettings('sendmail_owner', 1) > 0) {
         $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid='{$cid}' AND userid='{$my->id}'");
         $buchung = $database->loadObject();
         // Load event (use model function)
         $emodel = JModelLegacy::getInstance('Event', 'MatukioModel');
         $row = $emodel->getItem($cid);
         $publisher = JFactory::getuser($row->publisher);
         $body = "\n<head>\n<style type=\"text/css\">\n<!--\nbody {\nfont-family: Verdana, Tahoma, Arial;\nfont-size:12pt;\n}\n-->\n</style></head><body>";
         $body .= "<p><div style=\"font-size: 10pt\">" . JTEXT::_('COM_MATUKIO_RECEIVED_RATING') . "</div>";
         $body .= "<p><div style=\"font-size: 10pt\">" . JTEXT::_('COM_MATUKIO_RATING') . ":</div>";
         $htxt = str_replace('SEM_POINTS', $grade, JTEXT::_('COM_MATUKIO_SEM_POINTS_6'));
         $body .= "<div style=\"border: 1px solid #A0A0A0; width: 100%; padding: 5px;\">" . $htxt . "</div>";
         $body .= "<p><div style=\"font-size: 10pt\">" . JTEXT::_('COM_MATUKIO_COMMENT') . ":</div>";
         $body .= "<div style=\"border: 1px solid #A0A0A0; width: 100%; padding: 5px;\">" . htmlspecialchars($text) . "</div>";
         $body .= "<p><div style=\"font-size: 10pt\">" . JTEXT::_('COM_MATUKIO_AVARAGE_SCORE') . ":</div>";
         $htxt = str_replace('SEM_POINTS', $geswert, JTEXT::_('COM_MATUKIO_SEM_POINTS_6'));
         $body .= "<div style=\"border: 1px solid #A0A0A0; width: 100%; padding: 5px;\">" . $htxt . "</div>";
         $body .= "<p>" . MatukioHelperUtilsEvents::getEmailBody($row, $buchung, $my);
         $sender = $mainframe->getCfg('fromname');
         $from = $mainframe->getCfg('mailfrom');
         $replyname = $my->name;
         $replyto = $my->email;
         $email = $publisher->email;
         $subject = JTEXT::_('COM_MATUKIO_EVENT');
         if ($row->semnum != "") {
             $subject .= " " . $row->semnum;
         }
         $subject .= ": " . $row->title;
         $subject = JMailHelper::cleanSubject($subject);
         $mailer = JFactory::getMailer();
         $mailer->sendMail($from, $sender, $email, $subject, $body, 1, null, null, null, $replyto, $replyname);
     }
     $link = "index.php?option=com_matukio&tmpl=component&s=" . MatukioHelperUtilsBasic::getRandomChar() . "&view=rateevent&cid=" . $cid;
     $this->setRedirect($link, $msg);
 }
 * @license    GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.framework');
$api = 'http://maps.googleapis.com/maps/api/js?sensor=false';
$uri = JURI::getInstance();
if ($uri->isSSL()) {
    $api = 'https://maps.googleapis.com/maps/api/js?sensor=false';
}
$document = JFactory::getDocument();
$document->addScript($api);
$location = null;
if (!empty($this->event)) {
    $locobj = null;
    if ($this->event->place_id > 0) {
        $locobj = MatukioHelperUtilsEvents::getLocation($this->event->place_id);
    }
    $location = $this->event->gmaploc;
    if (empty($location) && ($locobj != null && !empty($locobj->gmaploc))) {
        $location = $locobj->gmaploc;
    }
} elseif (!empty($this->location)) {
    $location = $this->location->gmaploc;
} else {
    throw new Exception("No location found");
}
$script = "window.addEvent('domready', function() {\r\n\r\ngeocoder = new google.maps.Geocoder();\r\n        var myOptions = {\r\n            zoom:8,\r\n            mapTypeId:google.maps.MapTypeId.ROADMAP\r\n        };\r\n        var map = new google.maps.Map(document.getElementById('map_canvas'),\r\n            myOptions);\r\n        var address = '" . preg_replace("#\n|\r#", ' ', str_replace('<br />', ',', $location)) . "';\r\n        geocoder.geocode( { 'address': address}, function(results, status) {\r\n          if (status == google.maps.GeocoderStatus.OK) {\r\n            map.setCenter(results[0].geometry.location);\r\n            var marker = new google.maps.Marker({\r\n                map: map,\r\n                position: results[0].geometry.location\r\n            });\r\n\r\n            var infowindow = new google.maps.InfoWindow({\r\n                content: address\r\n            });\r\n\r\n            google.maps.event.addListener(marker, 'click', function() {\r\n              infowindow.open(map,marker);\r\n            });\r\n\r\n          } else {\r\n            alert('Geocode was not successful for the following reason: ' + status);\r\n          }\r\n        });\r\n\r\n});";
$document->addScriptDeclaration($script);
?>

<div id="map_canvas" style="width:570px; height:370px"></div>
 /**
  * Removes an or multiple events
  *
  * @throws  Exception - If db queries fail
  * @return void
  */
 public function remove()
 {
     $cid = JFactory::getApplication()->input->get('cid', array(), 'array');
     $db = JFactory::getDBO();
     if (count($cid)) {
         $cids = implode(',', $cid);
         // Notify users
         if (MatukioHelperSettings::_("notify_participants_delete", 1)) {
             $db->setQuery("SELECT * FROM #__matukio_bookings WHERE id IN (" . $cids . ")");
             $bookings = $db->loadObjectList();
             if ($db->getErrorNum()) {
                 throw new Exception($db->getErrorMsg(), 42);
             }
             foreach ($bookings as $b) {
                 $event = MatukioHelperUtilsEvents::getEventRecurring($b->semid);
                 MatukioHelperUtilsEvents::sendBookingConfirmationMail($event, $b->id, 4);
             }
         }
         // Delete events
         $query = "DELETE FROM #__matukio_recurring where id IN (" . $cids . ")";
         $db->setQuery($query);
         if (!$db->execute()) {
             throw new Exception($db->getErrorMsg(), 42);
         }
         // Delete old bookings
         $db->setQuery("DELETE FROM #__matukio_bookings WHERE semid IN (" . $cids . ")");
         if (!$db->execute()) {
             throw new Exception($db->getErrorMsg(), 42);
         }
     }
     $msg = JText::_("COM_MATUKIO_DELETE_SUCCESS");
     $this->setRedirect('index.php?option=com_matukio&view=recurring', $msg);
 }
 public static function generateCSVFile($backend, $cid = 0, $bookings = null, $kurs = null)
 {
     $db = JFactory::getDbo();
     // Load event only if we are not in the backend / or got an whole event to print
     if (!$backend) {
         $kurs = MatukioHelperUtilsEvents::getEventRecurring($cid);
     }
     $tmpl = MatukioHelperTemplates::getTemplate("export_csv");
     if (!empty($kurs)) {
         $db->setQuery("SELECT a.*, cc.*, a.id AS sid, a.name AS aname, a.email AS aemail FROM #__matukio_bookings AS a " . "LEFT JOIN #__users AS cc ON cc.id = a.userid WHERE a.semid = '" . $kurs->id . "' AND (a.status = 0 OR a.status = 1) ORDER BY a.id");
     } elseif (count($bookings)) {
         $db->setQuery("SELECT a.*, cc.*, a.id AS sid, a.name AS aname, a.email AS aemail FROM #__matukio_bookings AS a " . "LEFT JOIN #__users AS cc ON cc.id = a.userid WHERE a.id IN (" . implode(",", $bookings) . ") ORDER BY a.id");
     } else {
         throw new Exception("No data supplied (bookings / event)");
     }
     $bookings = $db->loadObjectList();
     if ($db->getErrorNum()) {
         throw new Exception($db->stderr());
     }
     $csvdata = MatukioHelperTemplates::getCSVHeader($tmpl, $kurs);
     $csvdata .= MatukioHelperTemplates::getCSVData($tmpl, $bookings, $kurs);
     return $csvdata;
 }
} else {
    $cid = JFactory::getApplication()->input->getInt('cid', 0);
    $uid = JFactory::getApplication()->input->getInt('booking_id', 0);
    if (!empty($cid)) {
        $link = JRoute::_('index.php?option=com_matukio&view=event&id=' . $cid);
    } else {
        $link = JRoute::_('index.php?option=com_matukio&view=eventlist');
    }
    if (empty($cid) && empty($uid)) {
        $this->setRedirect($link, "COM_MATUKIO_NO_ID");
        return;
    }
    $msg = JText::_("COM_MATUKIO_BOOKING_ANNULATION_SUCESSFULL");
    $database = JFactory::getDBO();
    $user = JFactory::getuser();
    MatukioHelperUtilsEvents::sendBookingConfirmationMail($cid, $user->id, 2, true);
    if (!empty($uid)) {
        $database->setQuery("DELETE FROM #__matukio_bookings WHERE id = '" . $uid . "'");
    } else {
        if ($user->id == 0) {
            JError::raiseError(403, "COM_MATUKIO_NO_ACCESS");
            return;
        } else {
            $database->setQuery("DELETE FROM #__matukio_bookings WHERE semid = " . $cid . " AND userid = '" . $user->id . "'");
        }
    }
    if (!$database->execute()) {
        JError::raiseError(500, $database->getError());
        $msg = JText::_("COM_MATUKIO_BOOKING_ANNULATION_FAILED") . " " . $database->getErrror();
    }
    $this->setRedirect($link, $msg);
}
?>
		</div>
	</div>
	<div id="mat_bottom">
		<?php 
// Kontaktformular
if (MatukioHelperSettings::getSettings("sendmail_contact", 1)) {
    echo MatukioHelperUtilsEvents::getEmailWindow(MatukioHelperUtilsBasic::getComponentImagePath(), $this->event->id, 1, "modern");
}
// Kalender
if (MatukioHelperSettings::getSettings('frontend_usericsdownload', 1) > 0) {
    echo MatukioHelperUtilsEvents::getCalendarButton($this->event);
}
// Print Overview (normally always allowed)
echo MatukioHelperUtilsEvents::getPrintWindow(2, $this->event->id, '', 'b', "modern");
// Participants (if allowed)
if (MatukioHelperSettings::getSettings('frontend_userviewteilnehmer', 0) == 2 and $this->user->id > 0 or MatukioHelperSettings::getSettings('frontend_userviewteilnehmer', 0) == 1) {
    $htxt = "&nbsp";
    if ($this->event->nrbooked > 0) {
        $viewteilnehmerlink = JRoute::_("index.php?option=com_matukio&view=participants&cid=" . $this->event->id . "&art=0");
        echo " <a href=\"" . $viewteilnehmerlink . "\"><span class=\"mat_button\" style=\"cursor:pointer;\"\n                                        title=\"" . JTEXT::_('COM_MATUKIO_BOOKINGS') . "\">" . "<img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "0004.png\" border=\"0\" align=\"absmiddle\">&nbsp;" . JTEXT::_('COM_MATUKIO_PARTICIPANTS') . "</span></a>";
    }
}
// Book
if (($this->user->id or MatukioHelperSettings::getSettings('booking_unregistered', 1) == 1) and $this->event->cancelled == 0 and $this->event->nrbooked > 0 and (count($buchopt[2]) == 0 or count($buchopt[2]) > 0 && MatukioHelperSettings::getSettings('frontend_usermehrereplaetze', 1) != 0)) {
    $bookinglink = JRoute::_("index.php?option=com_matukio&view=bookevent&cid=" . $this->event->id . ":" . JFilterOutput::stringURLSafe($this->event->title));
    echo " <a title=\"" . JTEXT::_('COM_MATUKIO_BOOK') . "\" href=\"" . $bookinglink . "\"><span class=\"mat_book\" type=\"button\"><img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "1116.png\" border=\"0\" align=\"absmiddle\">&nbsp;" . JTEXT::_('COM_MATUKIO_BOOK') . "</span></a>";
}
// Aenderungen speichern Veranstalter  , not really implemented here
if ($this->art == 3 and $usrid != 0 and ($this->event->nrbooked > 1 or $zfleer == 0)) {
			<tfoot>
			<tr>
				<td colspan="16"><?php 
echo $this->pagination->getListFooter();
?>
</td>
			</tr>
			</tfoot>
			<tbody>
			<?php 
foreach ($this->items as $i => $l) {
    $checked = JHTML::_('grid.id', $i, $l->id);
    $published = JHTML::_('grid.published', $l, $i);
    $link = JRoute::_('index.php?option=com_matukio&controller=eventlist&task=editEvent&id=' . $l->id);
    $curdate = MatukioHelperUtilsDate::getCurrentDate();
    $booked = MatukioHelperUtilsEvents::calculateBookedPlaces($l)->booked;
    $status_img = MatukioHelperUtilsBasic::getStatusImage($l);
    $available_img = MatukioHelperUtilsBasic::getAvailableImage($l, $booked);
    $bookable_image = MatukioHelperUtilsBasic::getBookableImage($l);
    $rating_image = MatukioHelperUtilsBasic::getRatingImage($l);
    // Triggers publish / unpublish
    $published_image = MatukioHelperUtilsBasic::getPublishedImage($l, $i);
    // Triggers canceld / active
    $cancel_image = MatukioHelperUtilsBasic::getCancelImage($l, $i);
    $title = strlen($l->title) < 70 ? $l->title : substr($l->title, 0, 67) . "...";
    $category = strlen($l->category) < 25 ? $l->title : substr($l->category, 0, 22) . "...";
    $begin = JHTML::_('date', $l->begin, MatukioHelperSettings::getSettings('date_format_without_time', 'd-m-Y')) . ", " . JHTML::_('date', $l->begin, MatukioHelperSettings::getSettings('time_format', 'H:i'));
    $end = JHTML::_('date', $l->end, MatukioHelperSettings::getSettings('date_format_without_time', 'd-m-Y')) . ", " . JHTML::_('date', $l->end, MatukioHelperSettings::getSettings('time_format', 'H:i'));
    $bplaces = '<a href="index.php?option=com_matukio&view=bookings&event_id=' . $l->id . '" value="' . $booked . '">' . $booked . "</a>";
    ?>
				<tr class="<?php 
Example #11
0
 /**
  * OLD Booking method for old form
  *
  * @todo move into a nice function for both backend / Frontend / old and new form
  * @return mixed
  */
 public function bookevent()
 {
     $database = JFactory::getDBO();
     $my = JFactory::getUser();
     $id = JFactory::getApplication()->input->getInt('cid', 0);
     $uid = JFactory::getApplication()->input->getInt('uid', 0);
     $catid = JFactory::getApplication()->input->getInt('catid', 0);
     $nrbooked = JFactory::getApplication()->input->getInt('nrbooked', 0);
     $name = JFactory::getApplication()->input->get('name', '', 'string');
     $email = JFactory::getApplication()->input->get('email', '', 'string');
     $dispatcher = JDispatcher::getInstance();
     // Edit own booking
     $booking_id = JFactory::getApplication()->input->getInt('booking_id', 0);
     // AGBs
     $veragb = JFactory::getApplication()->input->get('veragb', 0, 'string');
     $isWaitlist = false;
     $reason = "";
     // Load event (use model function)
     $emodel = JModelLegacy::getInstance('Event', 'MatukioModel');
     $row = $emodel->getItem($id);
     $usrid = $my->id;
     $art = 2;
     if ($uid > 0) {
         $usrid = $uid;
         $art = 4;
     }
     $sqlid = $usrid;
     if ($name != "" and $email != "" or $usrid == 0) {
         $usrid = 0;
         $sqlid = -1;
     }
     // Pruefung ob Buchung erfolgreich durchfuehrbar
     $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid='{$id}' AND userid='{$sqlid}'");
     $temp = $database->loadObjectList();
     if (!empty($booking_id)) {
         $temp = null;
     }
     $gebucht = MatukioHelperUtilsEvents::calculateBookedPlaces($row);
     $gebucht = $gebucht->booked;
     $allesok = 1;
     $ueber1 = JTEXT::_('COM_MATUKIO_BOOKING_WAS_SUCCESSFULL');
     $pflichtfeld = false;
     $fields = MatukioHelperUtilsEvents::getAdditionalFieldsFrontend($row);
     for ($i = 0; $i < 20; $i++) {
         $test = $fields[0][$i];
         if (!empty($test)) {
             $res = explode("|", $test);
             if (trim($res[1]) == "1") {
                 $value = JFactory::getApplication()->input->get("zusatz" . ($i + 1), '', 'string');
                 if (empty($value)) {
                     $pflichtfeld = true;
                 }
             }
         }
     }
     if ($my->id > 0) {
         $name = $my->name;
         $email = $my->email;
     }
     // }
     if (empty($name) || empty($email)) {
         $allesok = 0;
         $ueber1 = JTEXT::_('COM_MATUKIO_BOOKING_WAS_NOT_SUCCESSFULL');
         $reason = JTEXT::_('COM_MATUKIO_NO_NAME_OR_EMAIL');
     } elseif ($pflichtfeld) {
         $allesok = 0;
         $ueber1 = JTEXT::_('COM_MATUKIO_BOOKING_WAS_NOT_SUCCESSFULL');
         $reason = JTEXT::_('COM_MATUKIO_REQUIRED_ADDITIONAL_FIELD_EMPTY');
     } elseif (count($temp) > 0) {
         $allesok = 0;
         $ueber1 = JTEXT::_('COM_MATUKIO_BOOKING_WAS_NOT_SUCCESSFULL');
         $reason = JTEXT::_('COM_MATUKIO_REGISTERED_FOR_THIS_EVENT');
     } elseif (MatukioHelperUtilsDate::getCurrentDate() > $row->booked) {
         $allesok = 0;
         $ueber1 = JTEXT::_('COM_MATUKIO_BOOKING_WAS_NOT_SUCCESSFULL');
         $reason = JTEXT::_('COM_MATUKIO_EXCEEDED');
     } elseif ($row->maxpupil - $gebucht - $nrbooked < 0 && $row->stopbooking == 1) {
         $allesok = 0;
         $ueber1 = JTEXT::_('COM_MATUKIO_BOOKING_WAS_NOT_SUCCESSFULL');
         $reason = JTEXT::_('COM_MATUKIO_MAX_PARTICIPANT_NUMBER_REACHED');
     } elseif ($row->maxpupil - $gebucht - $nrbooked < 0 && $row->stopbooking == 0) {
         $allesok = 2;
         $ueber1 = JTEXT::_('COM_MATUKIO_ADDED_WAITLIST');
         $reason = JTEXT::_('COM_MATUKIO_YOU_ARE_BOOKED_ON_THE_WAITING_LIST');
         $isWaitlist = true;
     } elseif (MatukioHelperSettings::getSettings('agb_text', '') != "" && $veragb != "1") {
         $allesok = 0;
         $ueber1 = JTEXT::_('COM_MATUKIO_BOOKING_WAS_NOT_SUCCESSFULL');
         $reason = JTEXT::_('COM_MATUKIO_AGB_NOT_ACCEPTED');
     }
     if ($art == 4) {
         $allesok = 1;
         $ueber1 = JTEXT::_('COM_MATUKIO_BOOKING_WAS_SUCCESSFULL');
     }
     $link = JRoute::_(MatukioHelperRoute::getEventRoute($row->id, $catid), false);
     $msg = "";
     $neu = "";
     // Alles in Ordnung
     if ($allesok > 0) {
         // Buchung eintragen
         $neu = JTable::getInstance('bookings', 'Table');
         if (!$neu->bind(JRequest::get('post'))) {
             return JError::raiseError(500, $database->stderr());
         }
         if (!empty($booking_id)) {
             $neu->id = $booking_id;
         }
         $neu->semid = $id;
         $neu->userid = $usrid;
         // Hmm really do that?
         $neu->name = $name;
         $neu->email = $email;
         $neu->bookingdate = MatukioHelperUtilsDate::getCurrentDate();
         $neu->name = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->name);
         $neu->email = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->email);
         $neu->zusatz1 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz1);
         $neu->zusatz2 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz2);
         $neu->zusatz3 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz3);
         $neu->zusatz4 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz4);
         $neu->zusatz5 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz5);
         $neu->zusatz6 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz6);
         $neu->zusatz7 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz7);
         $neu->zusatz8 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz8);
         $neu->zusatz9 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz9);
         $neu->zusatz10 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz10);
         $neu->zusatz11 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz11);
         $neu->zusatz12 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz12);
         $neu->zusatz13 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz13);
         $neu->zusatz14 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz14);
         $neu->zusatz15 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz15);
         $neu->zusatz16 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz16);
         $neu->zusatz17 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz17);
         $neu->zusatz18 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz18);
         $neu->zusatz19 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz19);
         $neu->zusatz20 = MatukioHelperUtilsBasic::cleanHTMLfromText($neu->zusatz20);
         // Set booking status to active @since 3.1
         $neu->status = MatukioHelperUtilsBooking::$ACTIVE;
         if (!empty($row->fees)) {
             $neu->payment_method = "cash";
             $payment_brutto = $row->fees * $neu->nrbooked;
             $coupon_code = $neu->coupon_code;
             if (!empty($coupon_code)) {
                 $cdate = new DateTime();
                 $db = JFactory::getDBO();
                 $query = $db->getQuery(true);
                 $query->select('*')->from('#__matukio_booking_coupons')->where('code = ' . $db->quote($coupon_code) . ' AND published = 1 AND published_up < ' . $db->quote($cdate->format('Y-m-d H:i:s')) . " AND published_down > " . $db->quote($cdate->format('Y-m-d H:i:s')));
                 $db->setQuery($query);
                 $coupon = $db->loadObject();
                 if (!empty($coupon)) {
                     if ($coupon->procent == 1) {
                         // Get a procent value
                         $payment_brutto = round($payment_brutto * ((100 - $coupon->value) / 100), 2);
                     } else {
                         $payment_brutto = $payment_brutto - $coupon->value;
                     }
                 } else {
                     // Perhaps delete this invalid field, or display an error?! TODO
                 }
             }
             $neu->payment_brutto = $payment_brutto;
         }
         $results = $dispatcher->trigger('onBeforeSaveBooking', $neu, $row);
         // Set status since @3.1
         if ($isWaitlist) {
             // We book to the waitlist, let's set the booking like that then
             $neu->status = MatukioHelperUtilsBooking::$WAITLIST;
         } elseif (empty($row->fees)) {
             // We set the status to active because no payment is done.. so no reason to not confirm them
             $neu->status = MatukioHelperUtilsBooking::$ACTIVE;
         } elseif (MatukioHelperSettings::_("booking_always_active", 0)) {
             // We check if the booking always active setting is set - if yes the booking is always!! active (except waitlist delete etc.)
             $neu->status = MatukioHelperUtilsBooking::$ACTIVE;
         } else {
             // We set the status to pending - this is going to be overwritten by the payment API (if paid etc.)
             $neu->status = MatukioHelperUtilsBooking::$PENDING;
         }
         if (!$neu->check()) {
             JError::raiseError(500, $database->stderr());
             exit;
         }
         if (!$neu->store()) {
             JError::raiseError(500, $database->stderr());
             exit;
         }
         $neu->checkin();
         $ueber1 = JText::_("COM_MATUKIO_BOOKING_WAS_SUCCESSFULL");
         if ($usrid == 0) {
             $usrid = $neu->id * -1;
         }
         if (MatukioHelperSettings::getSettings("oldbooking_redirect_after", "bookingpage") == "bookingpage") {
             $link = JRoute::_(MatukioHelperRoute::getEventRoute($row->id, $catid, 1, $neu->id), false);
         } elseif (MatukioHelperSettings::getSettings("oldbooking_redirect_after", "bookingpage") == "eventpage") {
             $link = JRoute::_(MatukioHelperRoute::getEventRoute($row->id, $catid, 0, $neu->id), false);
         } else {
             // Eventlist overview
             $link = JRoute::_("index.php?option=com_matukio&view=eventlist");
         }
         if ($art == 4) {
             MatukioHelperUtilsEvents::sendBookingConfirmationMail($row, $neu->id, 8);
         } else {
             MatukioHelperUtilsEvents::sendBookingConfirmationMail($row, $neu->id, 1);
         }
     } else {
         $link = JRoute::_(MatukioHelperRoute::getEventRoute($row->id, $catid), false);
     }
     $this->setRedirect($link, $ueber1 . " " . $reason);
 }
?>

		<?php 
if (MatukioHelperSettings::getSettings('frontend_usericsdownload', 1) == 1) {
    // ICS Download
    $href = JURI::ROOT() . "index.php?tmpl=component&option=" . JFactory::getApplication()->input->get('option') . "&view=ics&format=raw";
    ?>
			<span class="mat_button" style="cursor:pointer;" type="button"
			      onClick="window.open('<?php 
    echo $href;
    ?>
');"><img src="<?php 
    echo MatukioHelperUtilsBasic::getComponentImagePath();
    ?>
3316.png" border="0" align="absmiddle">
				<?php 
    echo JTEXT::_('COM_MATUKIO_DOWNLOAD_CALENDER_FILE');
    ?>
             </span>
		<?php 
}
?>

		<?php 
// Print Button
echo MatukioHelperUtilsEvents::getPrintWindow(0 + 2, '', '', 'b');
?>
	</div>
</div>
<!-- End Matukio by compojoom.com -->
 /**
  * Displays the form
  *
  * @param   string  $tpl  - The tmpl
  *
  * @return  mixed|object
  */
 public function display($tpl = null)
 {
     $params = JComponentHelper::getParams('com_matukio');
     $menuitemid = JFactory::getApplication()->input->get('Itemid');
     if ($menuitemid) {
         $site = new JSite();
         $menu = $site->getMenu();
         $menuparams = $menu->getParams($menuitemid);
         $params->merge($menuparams);
     }
     // Hardcode in Dirk's matukio-mvc.php task
     $art = JFactory::getApplication()->input->getInt('art', 0);
     $order_by = $params->get("orderby", "a.begin");
     $database = JFactory::getDBO();
     $dateid = JFactory::getApplication()->input->getInt('dateid', 1);
     $catid = JFactory::getApplication()->input->getInt('catid', 0);
     $uuid = JFactory::getApplication()->input->get('uuid', '', 'string');
     if (empty($catid)) {
         $catid = $params->get('startcat', 0);
     }
     $search = JFactory::getApplication()->input->get('search', '', 'string');
     $search = str_replace("'", "", $search);
     $search = str_replace("\"", "", $search);
     $limit = JFactory::getApplication()->input->getInt('limit', MatukioHelperSettings::getSettings('event_showanzahl', 10));
     $limitstart = JFactory::getApplication()->input->getInt('limitstart', 0);
     $my = JFactory::getuser();
     $groups = implode(',', $my->getAuthorisedViewLevels());
     if ($art == 1) {
         if ($my->id == 0 && empty($uuid)) {
             JError::raiseError("403", JTEXT::_('COM_MATUKIO_NOT_LOGGED_IN'));
         }
     }
     // Check if user is logged in and allowed to edit his OWN events
     if ($art == 2) {
         if (!JFactory::getUser()->authorise('core.edit.own', 'com_matukio')) {
             return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
         }
     }
     switch ($art) {
         default:
         case "0":
             $navioben = explode(" ", MatukioHelperSettings::getSettings('frontend_topnavshowmodules', 'SEM_NUMBER SEM_SEARCH SEM_CATEGORIES SEM_RESET'));
             break;
         case "1":
             $navioben = explode(" ", MatukioHelperSettings::getSettings('frontend_topnavbookingmodules', 'SEM_NUMBER SEM_SEARCH SEM_TYPES SEM_RESET'));
             break;
         case "2":
             $navioben = explode(" ", MatukioHelperSettings::getSettings('frontend_topnavoffermodules', 'SEM_NUMBER SEM_SEARCH SEM_TYPES SEM_RESET'));
             break;
     }
     // Old event form
     if ($this->getLayout() != "modern" || $my->id == 0) {
         $ret = MatukioHelperUtilsEvents::getEventList($art, $search, $dateid, $catid, $order_by, $my, $navioben, $limitstart, $limit, "old");
         $events = $ret[0];
         $total = $ret[1];
         switch ($art) {
             case "0":
                 $anztyp = array(JTEXT::_('COM_MATUKIO_EVENTS'), 0);
                 break;
             case "1":
                 // Show booked events
                 $anztyp = array(JTEXT::_('COM_MATUKIO_MY_BOOKINGS'), 1);
                 break;
             case "2":
                 // Show offered events
                 $anztyp = array(JTEXT::_('COM_MATUKIO_MY_OFFERS'), 2);
                 break;
         }
         $pageNav = MatukioHelperUtilsEvents::cleanSiteNavigation($total, $limit, $limitstart);
         $this->rows = $events;
         $this->pageNav = $pageNav;
     }
     // Modern Layout - merge that someday :/
     if ($this->getLayout() == "modern") {
         // Tabs
         if ($my->id > 0) {
             // Just set it to the default
             $anztyp = array(JTEXT::_('COM_MATUKIO_EVENTS'), 0);
             // Normal events view
             $ret = MatukioHelperUtilsEvents::getEventList(0, $search, $dateid, $catid, $order_by, $my, $navioben, $limitstart, $limit, "modern");
             $allEvents = $ret[0];
             $total = $ret[1];
             $this->pageNavAllEvents = MatukioHelperUtilsEvents::cleanSiteNavigation($total, $limit, $limitstart);
             $this->allEvents = $allEvents;
             // My Bookings
             $bookedEvents = MatukioHelperUtilsEvents::getEventList(1, $search, $dateid, $catid, $order_by, $my, $navioben, 0, 1000, "modern");
             $this->mybookedEvents = $bookedEvents[0];
             // My offers
             if (JFactory::getUser()->authorise('core.edit.own', 'com_matukio')) {
                 $editEvents = MatukioHelperUtilsEvents::getEventList(2, $search, $dateid, $catid, $order_by, $my, $navioben, 0, 1000, "modern");
                 $this->myofferEvents = $editEvents[0];
             }
         } else {
             // Not logged in user - we can take rows from above
             $this->allEvents = $events;
             $this->pageNavAllEvents = $pageNav;
         }
     }
     // Kursauswahl erstellen
     $allekurse = array();
     $allekurse[] = JHTML::_('select.option', '0', JTEXT::_('COM_MATUKIO_ALL_EVENTS'));
     $allekurse[] = JHTML::_('select.option', '1', JTEXT::_('COM_MATUKIO_CURRENT_EVENTS'));
     $allekurse[] = JHTML::_('select.option', '2', JTEXT::_('COM_MATUKIO_OLD_EVENTS'));
     $selectclass = $this->getLayout() == "modern" ? "mat_inputbox" : "sem_inputbox22";
     $datelist = JHTML::_('select.genericlist', $allekurse, "dateid", "class=\"" . $selectclass . " chzn-single\" size=\"1\"\r\n                onchange=\"changeStatus();\"", "value", "text", $dateid);
     $categories[] = JHTML::_('select.option', '0', JTEXT::_('COM_MATUKIO_ALL_CATS'));
     $database->setQuery("SELECT id AS value, title AS text FROM #__categories WHERE extension='" . JFactory::getApplication()->input->get('option') . "' AND access in (" . $groups . ") AND published = 1 ORDER BY lft");
     $categs = array_merge($categories, (array) $database->loadObjectList());
     $clist = JHTML::_('select.genericlist', $categs, "catid", "class=\"" . $selectclass . " chzn-single\" size=\"1\"\r\n                onchange=\"changeCategoryEventlist();\" style=\"width: 180px;\"", "value", "text", $catid);
     $listen = array($datelist, $dateid, $clist, $catid);
     // Navigationspfad erweitern
     MatukioHelperUtilsBasic::expandPathway($anztyp[0], JRoute::_("index.php?option=com_matukio&view=eventlist"));
     $ue_title = $params->get('title', 'COM_MATUKIO_EVENTS_OVERVIEW');
     $this->art = $art;
     $this->search = $search;
     $this->limit = $limit;
     $this->limitstart = $limitstart;
     $this->total = $total;
     $this->datelist = $datelist;
     $this->dateid = $dateid;
     $this->clist = $clist;
     $this->catid = $catid;
     $this->title = $ue_title;
     $this->order_by = $order_by;
     parent::display($tpl);
 }
 /**
  * Confirms (notfies organizer + participants) an event
  *
  * @param   object  $event  - An recurring event
  *
  * @return  bool
  * @throws  Exception on Error
  */
 public static function confirmRecurringEvent($event)
 {
     // First update event
     $db = JFactory::getDbo();
     if (MatukioHelperSettings::_("booking_confirmation", 1)) {
         // Notify participants and organizer over the event is taking place
         $db->setQuery("SELECT * FROM #__matukio_bookings WHERE semid = " . $event->id);
         $rows = $db->loadObjectList();
         if ($db->getErrorNum()) {
             throw new Exception($db->getErrorMsg(), 42);
         }
         foreach ($rows as $row) {
             MatukioHelperUtilsEvents::sendBookingConfirmationMail($event, $row->id, 12);
         }
     }
     return true;
 }
Example #15
0
}
$kurs = null;
// Load event only if we are not in the backend / or got an whole event to print
if (!$backend) {
    $kurs = MatukioHelperUtilsEvents::getEventRecurring($this->cid);
}
if (!isset($this->cid)) {
    $this->cid = 0;
}
if (!isset($this->bookings)) {
    $this->bookings = null;
}
$konvert = MatukioHelperSettings::getSettings('csv_export_charset', 'UTF-8');
header("Content-Encoding: " . $konvert);
header("Content-Type: text/csv; charset=" . $konvert);
if (!empty($kurs)) {
    header("Content-Disposition: attachment; filename=\"" . $kurs->title . ".csv\"");
} else {
    $filename = "bookings-" . JHTML::_('date', 'now', MatukioHelperSettings::getSettings('date_format_without_time', 'd-m-Y')) . ".csv";
    header("Content-Disposition: attachment; filename=\"" . $filename . "\"");
}
header('Pragma: no-cache');
if ($konvert == "UTF-8") {
    // It does not help, as far as we know
    // $csvdata = chr(239) . chr(187) . chr(191);
}
$csvdata .= MatukioHelperUtilsEvents::generateCSVFile($backend, $this->cid, $this->bookings, $kurs);
$konvert = MatukioHelperSettings::getSettings('csv_export_charset', 'UTF-8');
$csvdata = iconv("UTF-8", $konvert, $csvdata);
echo $csvdata;
exit;
Example #16
0
 /**
  * Imports events from a ics file
  *
  * @throws  Exception
  *
  * @return  void
  */
 public function importics()
 {
     $input = JFactory::getApplication()->input;
     // Let's start uploading the file
     $file = JRequest::getVar('ics_file', null, 'files', 'array');
     $catid = $input->getInt("caid", 0);
     if (empty($file)) {
         throw new Exception("COM_MATUKIO_NO_FILE");
     }
     if (empty($catid)) {
         throw new Exception("COM_MATUKIO_PLEASE_SELECT_A_CATEGORY");
     }
     jimport('joomla.filesystem.file');
     $count = 0;
     if (!strtolower(JFile::getExt($file['name'])) == 'ics') {
         throw new Exception("COM_MATUKIO_NO_ICS_FILE");
     }
     $ar = $this->icsToArray($file['tmp_name']);
     var_dump($ar);
     $user_id = JFactory::getUser()->id;
     // Go through the events saved in the file
     foreach ($ar as $e) {
         if ($e['BEGIN'] == 'VEVENT') {
             $new = MatukioHelperUtilsEvents::getEventEditTemplate();
             // Our real events
             $new->publisher = $user_id;
             $new->title = $e['SUMMARY'];
             $new->shortdesc = $e['SUMMARY'];
             $new->place = $e['LOCATION'];
             $new->description = $e['DESCRIPTION'];
             $new->begin = date("Y-m-d H:i:s", strtotime($e['DTSTART']));
             $new->end = date("Y-m-d H:i:s", strtotime($e['DTEND']));
             $new->booked = $new->begin;
             $new->catid = $catid;
             $new->updated = date("Y-m-d H:i:s");
             $new->publishdate = date("Y-m-d H:i:s");
             // Save new event
             $tab = JTable::getInstance('Matukio', 'Table');
             if (!$tab->bind($new)) {
                 throw new Exception($tab->getError(), 42);
             }
             if (!$tab->check()) {
                 throw new Exception($tab->getError(), 42);
             }
             if (!$tab->store()) {
                 throw new Exception($tab->getError(), 42);
             }
             $tab->checkin();
             // Save date in rec dates
             MatukioHelperRecurring::saveRecurringDateForEvent($tab);
             $count++;
         }
     }
     $msg = JText::_("COM_MATUKIO_ICS_IMPORT_SUCCESSFULLY") . " " . $count;
     $link = 'index.php?option=com_matukio&view=import';
     $this->setRedirect($link, $msg);
 }
 /**
  * Displays the event form
  *
  * @param   string  $tpl  - The template
  *
  * @throws  Exception
  * @return  void
  */
 public function display($tpl = null)
 {
     $input = JFactory::getApplication()->input;
     $model = $this->getModel();
     $art = $input->getInt('art', 0);
     $database = JFactory::getDBO();
     $dateid = $input->getInt('dateid', 1);
     // Event id
     $cid = $input->getInt('id', 0);
     // Booking id!!
     $uid = $input->getInt('uid', 0);
     $uuid = $input->get('uuid', '');
     $dispatcher = JDispatcher::getInstance();
     $booking = "";
     $user = JFactory::getUser();
     if ($art == 1) {
         // Updated 2.2.4 to show the cancel booking button if logged in!
         $booking = MatukioHelperUtilsBooking::getBooking($uid, $cid);
     }
     // Fix if uid / booking not found or booking as not registered user
     if (empty($booking)) {
         $art = 0;
     }
     // Category id
     $catid = $input->getInt('catid', 0);
     $search = $input->get('search', '', 'string');
     $limit = $input->getInt('limit', 5);
     // TODO Pagination should be updated to Joomla Framework
     $limitstart = $input->getInt('limitstart', 0);
     $params = JComponentHelper::getParams('com_matukio');
     $menuitemid = $input->get('Itemid');
     if ($menuitemid) {
         $site = new JSite();
         $menu = $site->getMenu();
         $menuparams = $menu->getParams($menuitemid);
         $params->merge($menuparams);
     }
     $menu_cid = $params->get('eventId', 0);
     if (empty($cid)) {
         if (empty($menu_cid)) {
             JError::raiseError('404', JTEXT::_("COM_MATUKIO_NO_ID"));
         } else {
             $cid = $menu_cid;
         }
     }
     $row = $model->getItem($cid, true);
     if ($art == 3) {
         if ($uid > 0) {
             $database->setQuery("SELECT * FROM #__matukio_bookings WHERE id='" . $uid . "'");
             $temp = $database->loadObjectList();
             $userid = $temp[0]->userid;
             if ($userid == 0) {
                 $uid = $uid * -1;
             } else {
                 $uid = $userid;
             }
         }
     } else {
         if ($uid > 0) {
             $database->setQuery("SELECT * FROM #__matukio_bookings WHERE id='{$uid}'");
             $temp = $database->loadObjectList();
             if ($temp[0]->userid != 0 || $art != 1) {
                 $uid = $temp[0]->userid;
             } else {
                 $uid = $uid * -1;
             }
         }
     }
     if ($art == 0) {
         // Hits erhoehen
         $database->setQuery("UPDATE #__matukio_recurring SET hits=hits+1 WHERE id='{$cid}'");
         if (!$database->execute()) {
             throw new Exception("COM_MATUKIO_ERROR_ADDING_HIT" . ":" . $row->getError());
         }
         // Ausgabe des Kurses
         // MatukioHelperUtilsBasic::expandPathway(JTEXT::_('COM_MATUKIO_EVENTS'), JRoute::_("index.php?option=com_matukio"));
     } elseif ($art == 1 or $art == 2) {
         if ($user->id > 0) {
             MatukioHelperUtilsBasic::expandPathway(JTEXT::_('COM_MATUKIO_MY_BOOKINGS'), JRoute::_("index.php?option=com_matukio&view=eventlist&art=1"));
         }
     } else {
         MatukioHelperUtilsBasic::expandPathway(JTEXT::_('COM_MATUKIO_MY_OFFERS'), JRoute::_("index.php?option=com_matukio&view=eventlist&art=2"));
     }
     // Add category link to breadcrumb
     MatukioHelperUtilsBasic::expandPathway($row->category, JRoute::_("index.php?option=com_matukio&view=eventlist&art=" . $art . "&catid=" . $row->catid . ":" . JFilterOutput::stringURLSafe($row->category)));
     // Add event to breadcrumb
     MatukioHelperUtilsBasic::expandPathway($row->title, "");
     $ueberschrift = array(JTEXT::_('COM_MATUKIO_DESCRIPTION'), $row->shortdesc);
     if (empty($row)) {
         JError::raiseError('404', JTEXT::_("COM_MATUKIO_NO_ID"));
         return;
     }
     $locobj = null;
     if ($row->place_id > 0) {
         $locobj = MatukioHelperUtilsEvents::getLocation($row->place_id);
     }
     $title = JFactory::getDocument()->getTitle();
     JFactory::getDocument()->setTitle($title . " - " . JText::_($row->title));
     JPluginHelper::importPlugin('content');
     $this->jevent = new stdClass();
     $results = $dispatcher->trigger('onContentAfterDisplay', array('com_matukio.event', &$row, &$params, 0));
     $this->jevent->afterDisplayContent = trim(implode("\n", $results));
     $this->id = $cid;
     $this->art = $art;
     $this->event = $row;
     $this->uid = $uid;
     $this->uuid = $uuid;
     $this->search = $search;
     $this->catid = $catid;
     $this->limit = $limit;
     $this->limitstart = $limitstart;
     $this->dateid = $dateid;
     $this->ueberschrift = $ueberschrift;
     $this->booking = $booking;
     $this->user = $user;
     $this->location = $locobj;
     parent::display($tpl);
 }
 /**
  * Displays the templates view
  *
  * @param   string  $tpl  - Differen template
  *
  * @return  mixed|void
  */
 public function display($tpl = null)
 {
     $database = JFactory::getDBO();
     $startjahr = 2007;
     $stats = array();
     $mstats = array();
     $temp = array();
     $Monate = array(JTEXT::_('JANUARY'), JTEXT::_('FEBRUARY'), JTEXT::_('MARCH'), JTEXT::_('APRIL'), JTEXT::_('MAY'), JTEXT::_('JUNE'), JTEXT::_('JULY'), JTEXT::_('AUGUST'), JTEXT::_('SEPTEMBER'), JTEXT::_('OCTOBER'), JTEXT::_('NOVEMBER'), JTEXT::_('DECEMBER'));
     $stats[0] = new stdClass();
     $stats[0]->courses = 0;
     $stats[0]->bookings = 0;
     $stats[0]->certificated = 0;
     $stats[0]->hits = 0;
     $stats[0]->maxpupil = 0;
     $stats[0]->year = JTEXT::_('COM_MATUKIO_COMMON_PERIOD');
     for ($i = 0, $n = 12; $i < $n; $i++) {
         $month = $i + 1;
         $database->setQuery("SELECT a.*, r.* FROM #__matukio_recurring AS r\n\t\t\t\tLEFT JOIN #__matukio AS a ON r.event_id = a.id\n\t\t\t\tWHERE MONTH(r.begin)='{$month}' AND pattern = ''");
         $rows = $database->loadObjectList();
         $bookings = 0;
         $certificated = 0;
         $hits = 0;
         $maxpupil = 0;
         foreach ($rows as $row) {
             $gebucht = MatukioHelperUtilsEvents::calculateBookedPlaces($row);
             $bookings = $bookings + $gebucht->booked;
             $certificated = $certificated + $gebucht->certificated;
             $hits = $hits + $row->hits;
             $maxpupil = $maxpupil + $row->maxpupil;
         }
         $temp[$i] = new stdClass();
         $temp[$i]->courses = count($rows);
         $stats[0]->courses += $temp[$i]->courses;
         $temp[$i]->bookings = $bookings;
         $stats[0]->bookings += $temp[$i]->bookings;
         $temp[$i]->certificated = $certificated;
         $stats[0]->certificated += $temp[$i]->certificated;
         $temp[$i]->hits = $hits;
         $stats[0]->hits += $temp[$i]->hits;
         $temp[$i]->maxpupil = $maxpupil;
         $stats[0]->maxpupil += $temp[$i]->maxpupil;
         $temp[$i]->year = $Monate[$i];
     }
     $mstats[0] = $temp;
     $zaehler = 0;
     for ($i = 0, $n = 25; $i < $n; $i++) {
         $aktjahr = $startjahr + $i;
         $database->setQuery("SELECT COUNT(*) AS courses FROM #__matukio_recurring AS r\n\t\t\t\tLEFT JOIN #__matukio AS a ON r.event_id = a.id\n\t\t\t\tWHERE YEAR(r.begin)='{$aktjahr}' AND a.pattern = ''");
         $rows = $database->loadObjectList();
         if ($rows[0]->courses == 0) {
             continue;
         }
         $temp = array();
         $zaehler++;
         $stats[$zaehler] = new stdClass();
         $stats[$zaehler]->courses = 0;
         $stats[$zaehler]->bookings = 0;
         $stats[$zaehler]->certificated = 0;
         $stats[$zaehler]->hits = 0;
         $stats[$zaehler]->maxpupil = 0;
         $stats[$zaehler]->year = $aktjahr;
         for ($l = 0, $m = 12; $l < $m; $l++) {
             $month = $l + 1;
             $database->setQuery("SELECT a.*, r.* FROM #__matukio_recurring AS r\n\t\t\t\t\tLEFT JOIN #__matukio AS a ON r.event_id = a.id\n\t\t\t\t\tWHERE MONTH(r.begin)='{$month}' AND YEAR(r.begin)='{$aktjahr}' AND pattern = ''");
             $rows = $database->loadObjectList();
             $bookings = 0;
             $certificated = 0;
             $hits = 0;
             $maxpupil = 0;
             foreach ($rows as $row) {
                 $gebucht = MatukioHelperUtilsEvents::calculateBookedPlaces($row);
                 $bookings = $bookings + $gebucht->booked;
                 $certificated = $certificated + $gebucht->certificated;
                 $hits = $hits + $row->hits;
                 $maxpupil = $maxpupil + $row->maxpupil;
             }
             $temp[$l] = new stdClass();
             $temp[$l]->courses = count($rows);
             $stats[$zaehler]->courses += $temp[$l]->courses;
             $temp[$l]->bookings = $bookings;
             $stats[$zaehler]->bookings += $temp[$l]->bookings;
             $temp[$l]->certificated = $certificated;
             $stats[$zaehler]->certificated += $temp[$l]->certificated;
             $temp[$l]->hits = $hits;
             $stats[$zaehler]->hits += $temp[$l]->hits;
             $temp[$l]->maxpupil = $maxpupil;
             $stats[$zaehler]->maxpupil += $temp[$l]->maxpupil;
             $temp[$l]->year = $Monate[$l];
         }
         $mstats[$zaehler] = $temp;
     }
     $this->stats = $stats;
     $this->mstats = $mstats;
     $this->addToolbar();
     parent::display($tpl);
 }
    switch ($el) {
        case "SEM_NUMBER":
            $html .= "<input type=\"hidden\" name=\"limit\" value=\"" . $this->limit . "\">";
            break;
        case "SEM_SEARCH":
            $html .= "<input type=\"hidden\" name=\"search\" value=\"" . $this->search . "\">";
            break;
        case "SEM_CATEGORIES":
            $html .= "<input type=\"hidden\" name=\"catid\" value=\"" . $this->catid . "\">";
            break;
        case "SEM_TYPES":
            $html .= "<input type=\"hidden\" name=\"dateid\" value=\"" . $this->dateid . "\">";
            break;
    }
}
if ($this->art == 0) {
    $html .= "<input type=\"hidden\" name=\"dateid\" id=\"dateid\" value=\"" . $this->dateid . "\">";
} elseif ($this->art == 1) {
    $html .= "<input type=\"hidden\" name=\"catid\" id=\"catid\" value=\"" . $this->catid . "\">";
} elseif ($this->art == 2) {
    $html .= "<input type=\"hidden\" name=\"catid\" id=\"catid\" value=\"" . $this->catid . "\">";
}
$html .= MatukioHelperUtilsEvents::getHiddenFormElements($this->art, "", "", "", $this->limitstart, 0, "", -1);
$html .= " <input type=\"hidden\" name=\"art\" id=\"hidden_art\" value=\"" . $this->art . "\">";
echo $html;
echo MatukioHelperUtilsBasic::getCopyright();
?>
</form>
</div>
<!-- End Matukio by compojoom.com -->
Example #20
0
<?php

/**
 * @package    Matukio
 * @author     Yves Hoppe <*****@*****.**>
 * @date       29.01.14
 *
 * @copyright  Copyright (C) 2008 - 2014 compojoom.com . All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die('Restricted access');
$database = JFactory::getDBO();
if (!empty($this->uuid)) {
    $database->setQuery("SELECT * FROM #__matukio_bookings WHERE uuid='" . $this->uuid . "'");
}
$booking = $database->loadObject();
$kurs = MatukioHelperUtilsEvents::getEventRecurring($booking->semid);
$tmpl_code = MatukioHelperTemplates::getTemplate("ticket")->value;
// Parse language strings
$tmpl_code = MatukioHelperTemplates::replaceLanguageStrings($tmpl_code);
$replaces = MatukioHelperTemplates::getReplaces($kurs, $booking);
foreach ($replaces as $key => $replace) {
    $tmpl_code = str_replace($key, $replace, $tmpl_code);
}
$subject = "TICKET";
MatukioHelperPDF::generateTicket($booking, $tmpl_code, $subject);
exit;
 /**
  * Shows the form
  *
  * @param   string  $tpl  - The tmpl
  *
  * @return  bool|mixed|object
  */
 public function display($tpl = NULL)
 {
     $database = JFactory::getDBO();
     $my = JFactory::getuser();
     $dateid = JFactory::getApplication()->input->getInt('dateid', 1);
     $catid = JFactory::getApplication()->input->getInt('catid', 0);
     $search = JFactory::getApplication()->input->get('search', '', 'string');
     $limit = JFactory::getApplication()->input->getInt('limit', 5);
     $limitstart = JFactory::getApplication()->input->getInt('limitstart', 0);
     $cid = JFactory::getApplication()->input->getInt('cid', 0);
     $uid = JFactory::getApplication()->input->getInt('uid', 0);
     $todo = JFactory::getApplication()->input->get('todo', 'print_eventlist');
     // print_eventlist, print_booking, print_myevents, print
     $rows = null;
     $status = null;
     $headertext = null;
     $neudatum = MatukioHelperUtilsDate::getCurrentDate();
     if ($limitstart < 0) {
         $limitstart = 0;
     }
     $ttlimit = "";
     if ($limit > 0) {
         $ttlimit = "\nLIMIT {$limitstart}, {$limit}";
     }
     /**
      * 65O9805443904 =    public ?!
      * 653O875032490 =    Meine Angebote
      * 6530387504345 =  Meine Buchungen / Buchungsbestätigung ?!
      *
      * 3728763872762 =
      * csv
      */
     $where = array();
     $where[] = "a.pattern = ''";
     $where[] = "a.published = '1'";
     switch ($todo) {
         case "print_eventlist":
             $navioben = explode(" ", MatukioHelperSettings::getSettings('frontend_topnavshowmodules', 'SEM_NUMBER SEM_SEARCH SEM_CATEGORIES SEM_RESET'));
             break;
         case "print_booking":
             $navioben = explode(" ", MatukioHelperSettings::getSettings('frontend_topnavbookingmodules', 'SEM_NUMBER SEM_SEARCH SEM_CATEGORIES SEM_RESET'));
             break;
         case "print_myevents":
             $navioben = explode(" ", MatukioHelperSettings::getSettings('frontend_topnavoffermodules', 'SEM_NUMBER SEM_SEARCH SEM_CATEGORIES SEM_RESET'));
             break;
         case "print_teilnehmerliste":
             $navioben = "";
             break;
     }
     if ($todo != "print_teilnehmerliste" && $todo != "csvlist" && $todo != "certificate" && $todo != "invoice") {
         if (in_array('SEM_TYPES', $navioben)) {
             switch ($dateid) {
                 case "1":
                     $where[] = "a.end > '{$neudatum}'";
                     break;
                 case "2":
                     $where[] = "a.end <= '{$neudatum}'";
                     break;
             }
         }
     }
     switch ($todo) {
         default:
         case "print_eventlist":
             if (!in_array('SEM_TYPES', $navioben)) {
                 $where[] = "r.end > '{$neudatum}'";
             }
             if ((isset($_GET["catid"]) or in_array('SEM_CATEGORIES', $navioben)) and $catid > 0) {
                 $where[] = "a.catid ='{$catid}'";
             }
             $headertext = JTEXT::_('COM_MATUKIO_EVENTS');
             if ($cid) {
                 $where[] = "r.id= '{$cid}'";
                 $headertext = JTEXT::_('COM_MATUKIO_EVENT');
             }
             $database->setQuery("SELECT a.*, r.*, cc.title AS category FROM #__matukio_recurring AS r" . "\nLEFT JOIN #__matukio AS a ON r.event_id = a.id" . "\nLEFT JOIN #__categories AS cc ON cc.id = a.catid" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . "\nAND (r.semnum LIKE'%{$search}%' OR a.teacher LIKE '%{$search}%' OR a.title LIKE '%{$search}%'" . " OR a.shortdesc LIKE '%{$search}%' OR a.description LIKE '%{$search}%')");
             $rows = $database->loadObjectList();
             // Abzug der Kurse, die wegen Ausbuchung nicht angezeigt werden sollen
             if (!$cid) {
                 $abid = array();
                 foreach ($rows as $row) {
                     if ($row->stopbooking == 2) {
                         $gebucht = MatukioHelperUtilsEvents::calculateBookedPlaces($row);
                         if ($row->maxpupil - $gebucht->booked < 1) {
                             $abid[] = $row->id;
                         }
                     }
                 }
                 if (count($abid) > 0) {
                     $abid = implode(',', $abid);
                     $where[] = "r.id NOT IN ({$abid})";
                 }
             }
             $database->setQuery("SELECT a.*, r.*, cc.title AS category FROM #__matukio_recurring AS r" . "\nLEFT JOIN #__matukio AS a ON r.event_id = a.id" . "\nLEFT JOIN #__categories AS cc" . "\nON cc.id = a.catid" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . "\nAND (a.semnum LIKE'%{$search}%' OR a.teacher LIKE '%{$search}%' OR a.title LIKE '%{$search}%' OR a.shortdesc LIKE '%{$search}%' OR a.description LIKE '%{$search}%')" . "\nORDER BY r.begin" . $ttlimit);
             $rows = $database->loadObjectList();
             $status = array();
             $paid = array();
             $abid = array();
             for ($i = 0, $n = count($rows); $i < $n; $i++) {
                 $row =& $rows[$i];
                 $gebucht = MatukioHelperUtilsEvents::calculateBookedPlaces($row);
                 $gebucht = $gebucht->booked;
                 if (MatukioHelperUtilsDate::getCurrentDate() > $row->booked or $row->maxpupil - $gebucht < 1 and $row->stopbooking == 1 or $my->id == $row->publisher and MatukioHelperSettings::getSettings('booking_ownevents', 1) == 0) {
                     $status[$i] = JTEXT::_('COM_MATUKIO_UNBOOKABLE');
                 } elseif ($row->maxpupil - $gebucht < 1 && $row->stopbooking == 0) {
                     $status[$i] = JTEXT::_('COM_MATUKIO_BOOKING_ON_WAITLIST');
                 } elseif ($row->maxpupil - $gebucht < 1 && $row->stopbooking == 2) {
                     $abid[] = $row->id;
                 } else {
                     $status[$i] = JTEXT::_('COM_MATUKIO_NOT_EXCEEDED');
                 }
                 $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid='{$row->id}' AND userid='{$my->id}'");
                 $temp = $database->loadObjectList();
                 if (count($temp) > 0) {
                     $status[$i] = JTEXT::_('COM_MATUKIO_ALREADY_BOOKED');
                     if ($temp[0]->paid == 1) {
                         $rows[$i]->fees = $rows[$i]->fees . " - " . JTEXT::_('COM_MATUKIO_PAID');
                     }
                 }
                 $rows[$i]->codepic = "";
             }
             break;
             // My bookings ?!
         // My bookings ?!
         case "print_booking":
             $headertext = JTEXT::_('COM_MATUKIO_MY_BOOKINGS') . " - " . $my->name;
             if (in_array('SEM_CATEGORIES', $navioben) and $catid > 0) {
                 $where[] = "a.catid ='{$catid}'";
             }
             $where[] = "cc.userid = '" . $my->id . "'";
             if ($cid) {
                 $where[] = "cc.semid = '" . $cid . "'";
                 $headertext = JTEXT::_('COM_MATUKIO_BOOKING_CONFIRMATION') . " - " . $my->name;
             }
             $database->setQuery("SELECT a.*, r.*, cat.title AS category, cc.bookingdate AS bookingdate, cc.id AS bookid, cc.status AS bookingstatus\r\n\t\t\t\t\tFROM #__matukio_recurring AS r\r\n\t\t\t\t\tLEFT JOIN #__matukio AS a ON r.event_id = a.id\r\n\t\t\t\t\tLEFT JOIN #__matukio_bookings AS cc ON cc.semid = r.id\r\n\t\t\t\t\tLEFT JOIN #__categories AS cat ON cat.id = a.catid" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . "\nAND (r.semnum LIKE'%{$search}%' OR a.teacher LIKE '%{$search}%' OR a.title LIKE '%{$search}%' OR a.shortdesc LIKE '%{$search}%'\r\n                        OR a.description LIKE '%{$search}%')" . "\nORDER BY r.begin" . $ttlimit);
             $rows = $database->loadObjectList();
             $status = array();
             for ($i = 0, $n = count($rows); $i < $n; $i++) {
                 $row =& $rows[$i];
                 $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid = '{$row->id}' ORDER BY id");
                 $temps = $database->loadObjectList();
                 $status[$i] = MatukioHelperUtilsBooking::getBookingStatusName($row->bookingstatus);
                 $rows[$i]->codepic = $row->bookid;
                 if ($temps[0]->paid == 1) {
                     $rows[$i]->fees = $rows[$i]->fees . " - " . JTEXT::_('COM_MATUKIO_PAID');
                 }
             }
             break;
             // My events ?!
         // My events ?!
         case "print_myevents":
             if (in_array('SEM_CATEGORIES', $navioben) and $catid > 0) {
                 $where[] = "a.catid ='{$catid}'";
             }
             $where[] = "a.publisher = '" . $my->id . "'";
             $database->setQuery("SELECT a.*, r.* cat.title AS category FROM #__matukio_recurring AS r\r\n\t\t\t \t    LEFT JOIN #__matukio AS a ON r.eventid = a.id\r\n\t\t\t\t\tLEFT JOIN #__categories AS cat ON cat.id = a.catid" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . "\nAND (r.semnum LIKE'%{$search}%' OR a.teacher LIKE '%{$search}%' OR a.title LIKE '%{$search}%' OR a.shortdesc LIKE '%{$search}%' OR a.description LIKE '%{$search}%')" . "\nORDER BY r.begin" . $ttlimit);
             $rows = $database->loadObjectList();
             $status = array();
             $headertext = JTEXT::_('COM_MATUKIO_MY_OFFERS') . " - " . $my->name;
             for ($i = 0, $n = count($rows); $i < $n; $i++) {
                 $row =& $rows[$i];
                 $status[$i] = MatukioHelperUtilsBooking::getBookingStatusName($row->bookingstatus);
                 $rows[$i]->codepic = "";
             }
             break;
         case "print_teilnehmerliste":
             // TODO implement userchecking
             $art = JFactory::getApplication()->input->getInt('art', 0);
             $this->art = $art;
             if ($art == 1) {
                 $this->setLayout("signaturelist");
             } else {
                 $this->setLayout("participants");
             }
             break;
         case "csvlist":
             // TODO implement userchecking
             $art = JFactory::getApplication()->input->getInt('art', 0);
             $this->art = $art;
             $this->cid = $cid;
             $this->setLayout("csv");
             break;
         case "certificate":
             // TODO implement userchecking
             $art = JFactory::getApplication()->input->getInt('art', 0);
             $uid = JFactory::getApplication()->input->getInt('uid', 0);
             $this->art = $art;
             $this->uid = $uid;
             $this->setLayout("certificate");
             break;
         case "invoice":
             // TODO implement userchecking
             $art = JFactory::getApplication()->input->getInt('art', 0);
             $uid = JFactory::getApplication()->input->getInt('uid', 0);
             $this->art = $art;
             $this->uid = $uid;
             $this->setLayout("invoice");
             break;
     }
     $this->rows = $rows;
     $this->status = $status;
     $this->headertext = $headertext;
     parent::display($tpl);
 }
?>
<script type="text/javascript">
	Joomla.submitbutton = function(task)
	{
		if (task == 'cancel' || jQuery('#adminForm').validationEngine('validate'))
		{
			Joomla.submitform(task, document.getElementById('adminForm'));
		}
	}
</script>
	<div class="box-info full">
		<form action="index.php" method="post" name="adminForm" id="adminForm" class="form-horizontal" enctype="multipart/form-data" role="form">

			<?php 
// Use the function, the code should be moved here some time
echo MatukioHelperUtilsEvents::getEventEdit($this->event, 2);
?>
			<div class="clr clear"></div>

			<input type="hidden" name="option" value="com_matukio" />

			<input type="hidden" name="controller" value="eventlist" />
			<input type="hidden" name="model" value="event" />
			<input type="hidden" name="view" value="event" />
			<input type="hidden" name="task" value="" />

			<input type="hidden" name="published" value="<?php 
echo $this->event->published;
?>
" />
			<input type="hidden" name="id" value="<?php 
Example #23
0
					</tr>
					<tr>
						<td class="key" width="200px">
							<label for="catid" title="<?php 
echo JText::_('COM_MATUKIO_CATEGORY');
?>
">
								<?php 
echo JText::_('COM_MATUKIO_CATEGORY');
?>
:
							</label>
						</td>
						<td>
							<?php 
$catlist = MatukioHelperUtilsEvents::getCategoryListArray(0);
echo $catlist[0];
?>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<div align="right">
								<input type="submit" class="mat_button btn btn-primary"
								       value="<?php 
echo JText::_("COM_MATUKIO_IMPORT");
?>
" />
							</div>
						</td>
					</tr>
            $fees_list = MatukioHelperFees::getOverrideFees($this->event->different_fees_override);
        }
        // We have just a single ticket so we just show a drop down list and set ticket_fee to array obj 0
        echo "<table class=\"mat_table table\">\n";
        echo '<tr>';
        echo '<td class="key" width="150px">';
        echo JText::_("COM_MATUKIO_TICKET_TYPE");
        echo " <span class=\"mat_req\">*</span>";
        echo '</td>';
        echo '<td>';
        echo '<select id="ticket_fees0" name="ticket_fees[0]" class="sem_inputbox chzn-single ticket_fees" size="1">';
        echo '<option value="0" selected="selected" discvalue="0" discount="1" percent="1">- ' . JText::_("COM_MATUKIO_NORMAL") . ' -</option>';
        foreach ($fees_list as $f) {
            $disc_text = $f->discount ? '-' : '+';
            if (!$f->percent) {
                $fval = MatukioHelperUtilsEvents::getFormatedCurrency($f->value, MatukioHelperSettings::getSettings('currency_symbol', '$'));
            } else {
                $fval = $f->value . " %";
            }
            echo '<option value="' . $f->id . '" discvalue="' . $f->value . '" percent="' . $f->percent . '" discount="' . $f->discount . '">' . JText::_($f->title) . ' (' . $disc_text . $fval . ")" . '</option>';
        }
        echo '</select>';
        if ($buchopt[4] <= 0) {
            echo " *" . JText::_("COM_MATUKIO_ON_WAITLIST");
        }
        echo '</td>';
        echo '</tr>';
        echo "</table>";
    }
}
?>
				</th>
			</tr>
			</thead>
			<tbody>
			<?php 
foreach ($this->items as $i => $item) {
    $link = JRoute::_('index.php?option=com_matukio&controller=recurring&task=edit&id=' . $item->id);
    $link_event = JRoute::_('index.php?option=com_matukio&controller=eventlist&task=editEvent&id=' . $item->eventid);
    $begin = JHTML::_('date', $item->begin, MatukioHelperSettings::getSettings('date_format_without_time', 'd-m-Y')) . ", " . JHTML::_('date', $item->begin, MatukioHelperSettings::getSettings('time_format', 'H:i'));
    $end = JHTML::_('date', $item->end, MatukioHelperSettings::getSettings('date_format_without_time', 'd-m-Y')) . ", " . JHTML::_('date', $item->end, MatukioHelperSettings::getSettings('time_format', 'H:i'));
    // Triggers publish / unpublish
    $published_image = MatukioHelperUtilsBasic::getPublishedImageRecurring($item, $i);
    // Triggers canceld / active
    $cancel_image = MatukioHelperUtilsBasic::getCancelImageRecurring($item, $i);
    // Booked places link
    $booked = MatukioHelperUtilsEvents::calculateBookedPlacesRecurring($item)->booked;
    $status_img = MatukioHelperUtilsBasic::getStatusImage($item);
    $available_img = MatukioHelperUtilsBasic::getAvailableImage($item, $booked);
    $bookable_image = MatukioHelperUtilsBasic::getBookableImage($item);
    $rating_image = MatukioHelperUtilsBasic::getRatingImage($item);
    $bplaces = '<a href="index.php?option=com_matukio&view=bookings&event_id=' . $item->id . '" value="' . $booked . '">' . $booked . "</a>";
    ?>
				<tr class="row<?php 
    echo $i % 2;
    ?>
">
					<td>
						<?php 
    echo $this->pagination->getRowOffset($i);
    ?>
					</td>
Example #26
0
		<?php 
}
?>

		<?php 
// Navigation (Categories, search, reset, limitbox etc.
// Check if need the navigation divs or if it should be hidden
if (MatukioHelperSettings::getSettings('navi_eventlist_number', 1) == 1 || MatukioHelperSettings::getSettings('navi_eventlist_search', 1) == 1 || MatukioHelperSettings::getSettings('navi_eventlist_categories', 1) == 1 || MatukioHelperSettings::getSettings('navi_eventlist_types', 1) == 1 || MatukioHelperSettings::getSettings('navi_eventlist_reset', 1) == 1) {
    ?>
			<div class="mat_navigation">
				<div class="mat_navigation_inner">
					<?php 
    $disp = MatukioHelperSettings::getSettings('navi_eventlist_number', 1) == 0 ? " style = \"display: none;\"" : "";
    // Number
    echo '<div class="mat_nav_element" id="limit_holder"' . $disp . '>';
    echo JTEXT::_('COM_MATUKIO_DISPLAY') . ":&nbsp;" . MatukioHelperUtilsEvents::getLimitboxSiteNav(1, $this->limit, "eventlist", "modern");
    echo '</div>';
    ?>

					<?php 
    if (MatukioHelperSettings::getSettings('navi_eventlist_search', 1)) {
        // Search
        ?>
						<div class="mat_nav_element" id="search_holder">
							<input class="mat_inputbox input" type="text" name="search" id="search_field" size="20"
							       value="<?php 
        echo $this->search;
        ?>
"
							       onChange="searchEventlist();" onkeypress="return event.keyCode!=13"
							       style="width: 100px;"/>
 /**
  * Gets the upcoming events
  *
  * @param   object  $events  - The events
  * @param   object  $user    - The user
  *
  * @return  string - The html code
  */
 public static function getUpcomingEventsHTML($events, $user)
 {
     JHTML::_('stylesheet', 'media/com_matukio/css/upcoming.css');
     $html = "";
     if (count($events)) {
         $dispatcher = JDispatcher::getInstance();
         JPluginHelper::importPlugin('content');
         $params = JComponentHelper::getParams('com_matukio');
         foreach ($events as $event) {
             $buchopt = MatukioHelperUtilsEvents::getEventBookableArray(0, $event, $user->id);
             // Link
             $eventid_l = $event->id . ':' . JFilterOutput::stringURLSafe($event->title);
             $catid_l = $event->catid . ':' . JFilterOutput::stringURLSafe(MatukioHelperCategories::getCategoryAlias($event->catid));
             $link = JRoute::_(MatukioHelperRoute::getEventRoute($eventid_l, $catid_l), false);
             // Event image   -- TODO Add / Check for category image
             $linksbild = MatukioHelperUtilsBasic::getComponentImagePath() . "2601.png";
             if ($event->image != "" and MatukioHelperSettings::getSettings('event_image', 1) == 1) {
                 $linksbild = MatukioHelperUtilsBasic::getEventImagePath(1) . $event->image;
             }
             $hot = $event->hot_event ? " " : "";
             $top = $event->top_event ? " mat_top_event" : "";
             // Starting Row
             $html .= '<div class="mat_single_event' . $hot . $top . '">';
             $html .= '	<div class="mat_event_header">';
             $html .= '		<div class="mat_event_header_inner">';
             $html .= '			<div class="mat_event_header_line">';
             $html .= '				<div class="mat_event_image">';
             $html .= '					<img src="' . $linksbild . '" alt="' . $event->title . '" align="absmiddle" />';
             $html .= '				</div>';
             $html .= '				<div class="mat_event_title">';
             $html .= '					<h2><a href="' . $link . '" title="' . $event->title . '">' . $event->title . '</a></h2>';
             $html .= '				</div>';
             $html .= '			</div>';
             $html .= '			<div class="mat_event_location">';
             $begin = JHTML::_('date', $event->begin, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i'));
             $location = $event->place;
             $locobj = null;
             if ($event->place_id > 0) {
                 $locobj = MatukioHelperUtilsEvents::getLocation($event->place_id);
                 $placelink = JRoute::_("index.php?option=com_matukio&view=location&id=" . $locobj->id . ":" . JFilterOutput::stringURLSafe($locobj->title));
                 $location = '<a href="' . $placelink . '">' . $locobj->location . '</a>';
             }
             if (MatukioHelperSettings::getSettings('show_timezone', '1')) {
                 $begin .= " (GMT " . JHTML::_('date', $event->booked, 'P') . ")";
             }
             if ($event->webinar == 1) {
                 $locimg = MatukioHelperUtilsBasic::getComponentImagePath() . "webinar.png";
                 $html .= '<h4><img src="' . $locimg . '" title="' . JText::_("COM_MATUKIO_WEBINAR") . '" style="width: 22px; vertical-align:middle" /> ' . $location . " " . JText::_("COM_MATUKIO_AT") . " " . $begin . '</h4>';
             } else {
                 // TODO add map link
                 $locimg = MatukioHelperUtilsBasic::getComponentImagePath() . "home.png";
                 $html .= '<h4><img src="' . $locimg . '" title="' . JText::_("COM_MATUKIO_FIELDS_CITY") . '" style="width: 22px; vertical-align:middle" /> ' . $location . " " . JText::_("COM_MATUKIO_AT") . " " . $begin . '</h4>';
             }
             $html .= '			</div>';
             $html .= '		</div>';
             $html .= '	</div>';
             $html .= '	<div class="mat_event_description">';
             $html .= $event->shortdesc;
             $html .= '</div>';
             $html .= '	<div class="mat_event_footer">';
             $html .= '		<div class="mat_event_footer_inner">';
             $html .= '			<div class="mat_event_infoline">';
             $catlink = JRoute::_("index.php?option=com_matukio&view=eventlist&art=0&catid=" . $event->catid . ":" . JFilterOutput::stringURLSafe($event->category));
             $html .= '<a href="' . $catlink . '">' . JTEXT::_($event->category) . '</a>';
             // Infoline
             $gebucht = MatukioHelperUtilsEvents::calculateBookedPlaces($event);
             if (MatukioHelperSettings::getSettings('event_showinfoline', 1) == 1) {
                 $html .= " | ";
                 // Veranstaltungsnummer anzeigen
                 if ($event->semnum != "") {
                     $html .= JTEXT::_('COM_MATUKIO_NUMBER') . ": " . $event->semnum . " | ";
                 }
                 $html .= JTEXT::_('COM_MATUKIO_BOOKABLE') . ": " . $buchopt[4];
             }
             // Seminarleiter anzeigen
             if ($event->teacher != "") {
                 $html .= " | " . $event->teacher;
             }
             // Fees
             if ($event->fees > 0) {
                 $html .= " | ";
                 $gebuehr = MatukioHelperUtilsEvents::getFormatedCurrency($event->fees);
                 $currency = MatukioHelperSettings::getSettings('currency_symbol', '$');
                 if ($currency == '€') {
                     $html .= JTEXT::_('COM_MATUKIO_FEES') . ': ' . $gebuehr . " " . $currency;
                 } else {
                     $html .= JTEXT::_('COM_MATUKIO_FEES') . ': ' . $currency . " " . $gebuehr;
                 }
             }
             $html .= '</div>';
             $html .= '			<div class="mat_event_footer_buttons" align="right">';
             // Detail Link
             $html .= " <a title=\"" . $event->title . "\" href=\"" . $link . "\">" . "<span class=\"mat_button\"><img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "0012.png\" border=\"0\" align=\"absmiddle\">&nbsp;" . JTEXT::_('COM_MATUKIO_EVENT_DETAILS') . "</span></a> ";
             // Booking Link
             if (($user->id != 0 || MatukioHelperSettings::getSettings('booking_unregistered', 1) == 1) && MatukioHelperSettings::getSettings('oldbookingform', 0) != 1) {
                 if ($event->nrbooked > 0) {
                     $bookinglink = JRoute::_("index.php?option=com_matukio&view=bookevent&cid=" . $event->id . ":" . JFilterOutput::stringURLSafe($event->title));
                     $html .= " <a title=\"" . JTEXT::_('COM_MATUKIO_BOOK') . "\" href=\"" . $bookinglink . "\"><span class=\"mat_button mat_book\" type=\"button\"><img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "1116.png\" border=\"0\" align=\"absmiddle\">&nbsp;" . JTEXT::_('COM_MATUKIO_BOOK') . "</span></a>";
                 }
             }
             $html .= '				<br />';
             $results = $dispatcher->trigger('onContentAfterButton', array('com_matukio.upcomingevent', &$event, &$params, 0));
             $html .= trim(implode("\n", $results));
             $html .= '			</div>';
             $html .= '		</div>';
             $html .= '	</div>';
             $html .= ' </div>';
         }
     }
     return $html;
 }
								<?php 
echo JText::_('COM_MATUKIO_TAX');
?>
							</td>
							<td>
								+ <?php 
echo MatukioHelperUtilsEvents::getFormatedCurrency($this->booking->payment_tax, MatukioHelperSettings::getSettings('currency_symbol', '$'));
?>
							</td>
						</tr>
						<tr>
							<td align="left" class="key">
								<?php 
echo JText::_('COM_MATUKIO_TOTAL_AMOUNT');
?>
							</td>
							<td>
								= <?php 
echo MatukioHelperUtilsEvents::getFormatedCurrency($this->booking->payment_brutto, MatukioHelperSettings::getSettings('currency_symbol', '$'));
?>
							</td>
						</tr>
					</table>
				</div>
		</form>
		</div>
	</div>

	<div class="clr"></div>
<?php 
echo MatukioHelperUtilsBasic::getCopyright();
                    $single_fee = $single_fee + $single_fee * ($value[$i] / 100);
                }
            }
        }
        $total += $places[$i] * $single_fee;
    }
    // Substract coupon code (if any)
    if (!empty($coupon_code)) {
        // Get coupon value
        $cdate = new DateTime();
        $db = JFactory::getDBO();
        $query = $db->getQuery(true);
        $query->select('*')->from('#__matukio_booking_coupons')->where('code = ' . $db->quote($coupon_code) . ' AND published = 1 AND (published_up < ' . $db->quote($cdate->format('Y-m-d H:i:s')) . ' OR published_up = ' . $db->quote("0000-00-00 00:00:00") . ') ' . 'AND (published_down > ' . $db->quote($cdate->format('Y-m-d H:i:s')) . ' OR published_down = ' . $db->quote("0000-00-00 00:00:00") . ')');
        $db->setQuery($query);
        $coupon = $db->loadObject();
        if (!empty($coupon)) {
            if ($coupon->procent == 1) {
                // Get a procent value
                $total = round($total * ((100 - $coupon->value) / 100), 2);
            } else {
                $total = $total - $coupon->value;
            }
        }
    }
    echo MatukioHelperUtilsEvents::getFormatedCurrency($total, MatukioHelperSettings::getSettings('currency_symbol', '$'));
} elseif ($task == 'generate_recurring') {
    MatukioHelperRecurring::printGenerateRecurring();
} elseif ($task == 'get_override_fee_edit_row') {
    MatukioHelperFees::printDifferentFeesRow();
}
jexit();
            if (MatukioHelperSettings::getSettings('frontend_ratingsystem', 0) > 0) {
                $hinttext = JTEXT::_('COM_MATUKIO_RATING') . "::" . htmlspecialchars($row->comment);
                $htxt = "<img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "240" . $row->grade . ".png\" class=\"editlinktip hasTip\" title=\"" . $hinttext . "\">";
                $html .= MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'c', '', "sem_row");
            }
        }
        $html .= MatukioHelperUtilsEvents::getTableCell("<img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . $bild . "\" border=\"0\" alt=\"" . $altbild . "\">", 'd', 'c', '', "sem_row");
        $html .= "\n</tr>";
    }
} else {
    $spalten = 3;
    if ($this->art == 2) {
        $spalten = 9;
    }
    $html .= "\n<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_NO_BOOKING_FOUND'), 'd', 'l', '', 'sem_row', $spalten) . "</tr>";
}
$html .= MatukioHelperUtilsEvents::getTableHeader('e');
// Hidden fields
if ($this->kurs->nrbooked <= 1 || MatukioHelperSettings::getSettings('frontend_usermehrereplaetze', 1) < 1) {
    $html .= "<input type=\"hidden\" name=\"nrbooked\" value=\"1\" />";
}
$html .= MatukioHelperUtilsEvents::getHiddenFormElements($zurueck[$this->art], $this->catid, $this->search, $this->limit, $this->limitstart, $this->kurs->id, $this->dateid, -1);
// Farbbeschreibungen anzeigen
$html .= MatukioHelperUtilsEvents::getColorDescriptions(JTEXT::_('COM_MATUKIO_PARTICIPANT_ASSURED'), JTEXT::_('COM_MATUKIO_WAITLIST'), JTEXT::_('COM_MATUKIO_NO_SPACE_AVAILABLE'), 1);
// Anzeige Funktionsknoepfe unten
if (MatukioHelperSettings::getSettings('event_buttonposition', 2) > 0) {
    $html .= MatukioHelperUtilsEvents::getTableHeader(4) . "<tr>" . MatukioHelperUtilsEvents::getTableCell($knopfunten, 'd', 'c', '100%', 'sem_nav_d') . "</tr>" . MatukioHelperUtilsEvents::getTableHeader('e');
}
echo $html;
echo "</table>";
echo "</form>";