}
?>

		<?php 
if (!$user->id > 0) {
    // User is not logged in, only show eventlist
    require dirname(__FILE__) . "/modern_eventlist.php";
} else {
    $params['useCookie'] = true;
    $params['startOffset'] = 0;
    $group = 'tabs';
    echo JHtml::_('tabs.start', $group, $params);
    // Panel Eventlist
    echo JHtml::_('tabs.panel', JText::_('COM_MATUKIO_EVENTLIST'), 'eventlist');
    require dirname(__FILE__) . "/modern_eventlist.php";
    echo JHtml::_('tabs.panel', JText::_('COM_MATUKIO_MY_BOOKINGS'), 'mybookings');
    require dirname(__FILE__) . "/modern_bookings.php";
    if (JFactory::getUser()->authorise('core.edit.own', 'com_matukio') && MatukioHelperSettings::getSettings('frontend_ownereditevent', 1)) {
        echo JHtml::_('tabs.panel', JText::_('COM_MATUKIO_MY_OFFERS'), 'myoffers');
        require dirname(__FILE__) . "/modern_offers.php";
    }
    echo JHtml::_('tabs.end');
}
?>
	</form>
	<?php 
echo MatukioHelperUtilsBasic::getCopyright();
?>
</div>
<!-- End Matukio by compojoom.com -->
$tmpl = MatukioHelperTemplates::getParsedExportTemplateHeadding($tmpl, $kurs);
echo "\n<body onload=\" parent.sbox-window.focus(); parent.sbox-window.print(); \">";
echo "<div class=\"compojoom-bootstrap\">";
if (!empty($tmpl->subject)) {
    echo "\n<br /><center><span class=\"sem_list_title\">" . JTEXT::_($tmpl->subject) . "</span></center><br />";
}
/* Header before out of value_text */
if (!empty($kurs)) {
    echo $tmpl->value_text;
}
/* Participants */
// Move to function
$i = 1;
$ptable = "";
foreach ($bookings as $b) {
    // We are in the backend with bookings instead of an event!
    if (empty($cid)) {
        $kurs = MatukioHelperUtilsEvents::getEventRecurring($b->semid);
    }
    $replaces = MatukioHelperTemplates::getReplaces($kurs, $b, $i);
    $participant_line = $tmpl->value;
    foreach ($replaces as $key => $replace) {
        $participant_line = str_replace($key, $replace, $participant_line);
    }
    $ptable .= $participant_line;
    $i++;
}
echo $ptable;
echo "<br />" . MatukioHelperUtilsBasic::getCopyright();
echo "</div>";
echo "</body>";
			</th>
			<th width="33%">
				<?php 
echo "<img src=\"" . $imgpath . "2501.png\" border=\"0\" align=\"absmiddle\" /> " . JTEXT::_('COM_MATUKIO_WAITLIST');
?>
			</th>
			<th width="33%">
				<?php 
echo "<img src=\"" . $imgpath . "2500.png\" border=\"0\" align=\"absmiddle\" /> " . JTEXT::_('COM_MATUKIO_EXCEEDED');
?>
			</th>
		</tr>
		<tr>
			<th width="33%">
				<?php 
echo "<img src=\"" . $imgpath . "2500.png\" border=\"0\" align=\"absmiddle\" /> " . JTEXT::_('COM_MATUKIO_EVENT_HAS_ENDED');
?>
			</th>
			<th width="33%">
				<?php 
echo "<img src=\"" . $imgpath . "2500.png\" border=\"0\" align=\"absmiddle\" /> " . JTEXT::_('COM_MATUKIO_FULLY_BOOKED');
?>
			</th>
			<th width="33%">
			</th>
		</tr>
	</table>
	</div>
<?php 
echo CompojoomHtmlCTemplate::getFooter(MatukioHelperUtilsBasic::getCopyright(false));
    }
    if ($row->showbooked > 0) {
        $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_CLOSING_DATE') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell(JHTML::_('date', $row->booked), 'd', 'l', '', 'sem_list_row') . "</tr>";
    }
    if ($row->teacher != "") {
        $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_TUTOR') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell($row->teacher, 'd', 'l', '', 'sem_list_row') . "</tr>";
    }
    if ($row->target != "") {
        $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_TARGET_GROUP') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell($row->target, 'd', 'l', '', 'sem_list_row') . "</tr>";
    }
    $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_CITY') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell($row->place, 'd', 'l', '', 'sem_list_row') . "</tr>";
    if ($row->nrbooked > 0) {
        $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_MAX_PARTICIPANT') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell($row->maxpupil, 'd', 'l', '', 'sem_list_row') . "</tr>";
        $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_BOOKINGS') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell($gebucht, 'd', 'l', '', 'sem_list_row') . "</tr>";
        $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_BOOKABLE') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell($freieplaetze, 'd', 'l', '', 'sem_list_row') . "</tr>";
    }
    if ($row->fees > 0) {
        $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_FEES') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell(MatukioHelperSettings::getSettings('currency_symbol', '$') . " " . $row->fees, 'd', 'l', '', 'sem_list_row') . "</tr>";
    }
    if ($row->description != "") {
        $row->description = str_replace("images/", "../images/", $row->description);
        $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(MatukioHelperUtilsEvents::getCleanedMailText($row->description), 'd', 'l', '100%', 'sem_list_row', 2) . "</tr>";
    }
    if ($row->codepic != "") {
        $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(MatukioHelperUtilsBooking::getBookingIdCodePicture($row->codepic), 'd', 'c', '100%', 'sem_list_row', 2) . "</tr>";
    }
    $html .= "\n</table><br />";
}
$html .= MatukioHelperUtilsBasic::getCopyright();
$html .= "</div></body></html>";
echo $html;