Ejemplo n.º 1
0
 /**
  * Generates the
  *
  * @param   string  $booking      - The booking
  * @param   string  $text         - The text
  * @param   string  $subject      - The subject
  * @param   string  $destination  - Where should the generated file been send
  *
  * @return  string
  */
 public static function generateTicket($booking, $text, $subject, $destination = "D")
 {
     $fn = "ticket-" . MatukioHelperUtilsBooking::getBookingId($booking->id) . ".pdf";
     // Check if PDF was already created
     if (JFile::exists($fn)) {
         return $fn;
     }
     $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor('Matukio by compojoom.com');
     $pdf->SetTitle($subject);
     $pdf->SetSubject($subject);
     $pdf->SetKeywords('Ticket, Matukio, compojoom');
     // remove default header/footer
     $pdf->setPrintHeader(false);
     $pdf->setPrintFooter(false);
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // add a page
     $pdf->AddPage();
     $pdf->writeHTML($text, true, false, true, false, '');
     // Close and output PDF document
     // This method has several options, check the source code documentation for more information.
     return $pdf->Output($fn, $destination);
 }
Ejemplo n.º 2
0
 public static function getEmailBody($row, $buchung, $user)
 {
     $gebucht = self::calculateBookedPlaces($row);
     $gebucht = $gebucht->booked;
     $freieplaetze = $row->maxpupil - $gebucht;
     if ($freieplaetze < 0) {
         $freieplaetze = 0;
     }
     $body = "<p>\n<table cellpadding=\"2\" border=\"0\" width=\"100%\">";
     if (count($buchung) > 0) {
         $body .= "\n<tr><td><b>" . JTEXT::_('COM_MATUKIO_NAME') . "</b>: </td><td>" . $buchung->name . " (" . $user->name . ")" . "</td></tr>";
         $body .= "\n<tr><td><b>" . JTEXT::_('COM_MATUKIO_EMAIL') . "</b>: </td><td>" . $user->email . "</td></tr>";
     }
     if (count($buchung) > 0) {
         $body .= "\n<tr><td><b>" . JTEXT::_('COM_MATUKIO_BOOKING_ID') . "</b>: </td><td>" . MatukioHelperUtilsBooking::getBookingId($buchung->id) . "</td></tr>";
         $body .= "\n<tr><td colspan=\"2\"><hr></td></tr>";
         $body .= "\n<tr><td colspan=\"2\"><b>" . JTEXT::_('COM_MATUKIO_ADDITIONAL_INFO') . "</b></td></tr>";
         $zusfeld = self::getAdditionalFieldsFrontend($row);
         $zusbuch = self::getAdditionalFieldsFrontend($buchung);
         for ($i = 0; $i < count($zusfeld[0]); $i++) {
             if ($zusfeld[0][$i] != "") {
                 $zusart = explode("|", $zusfeld[0][$i]);
                 $body .= "\n<tr><td>" . $zusart[0] . ": </td><td>" . $zusbuch[0][$i] . "</td></tr>";
             }
         }
         if ($row->nrbooked > 1) {
             $body .= "\n<tr><td>" . JTEXT::_('COM_MATUKIO_BOOKED_PLACES') . ": </td><td>" . $buchung->nrbooked . "</td></tr>";
         }
     }
     $body .= "\n<tr><td colspan=\"2\"><hr></td></tr>";
     $body .= "\n<tr><td colspan=\"2\"><b>" . $row->title . "</b></td></tr>";
     $body .= "\n<tr><td colspan=\"2\">" . $row->shortdesc . "</td></tr>";
     if ($row->semnum != "") {
         $body .= "\n<tr><td>" . JTEXT::_('COM_MATUKIO_NUMBER') . ": </td><td>" . $row->semnum . "</td></tr>";
     }
     if ($row->showbegin > 0) {
         $body .= "\n<tr><td>" . JTEXT::_('COM_MATUKIO_BEGIN') . ": </td><td>" . JHTML::_('date', $row->begin, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')) . "</td></tr>";
     }
     if ($row->showend > 0) {
         $body .= "\n<tr><td>" . JTEXT::_('COM_MATUKIO_END') . ": </td><td>" . JHTML::_('date', $row->end, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')) . "</td></tr>";
     }
     if ($row->showbooked > 0) {
         $body .= "\n<tr><td>" . JTEXT::_('COM_MATUKIO_CLOSING_DATE') . ": </td><td>" . JHTML::_('date', $row->booked, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')) . "</td></tr>";
     }
     if ($row->teacher != "") {
         $body .= "\n<tr><td>" . JTEXT::_('COM_MATUKIO_TUTOR') . ": </td><td>" . $row->teacher . "</td></tr>";
     }
     if ($row->target != "") {
         $body .= "\n<tr><td>" . JTEXT::_('COM_MATUKIO_TARGET_GROUP') . ": </td><td>" . $row->target . "</td></tr>";
     }
     $body .= "\n<tr><td>" . JTEXT::_('COM_MATUKIO_CITY') . ": </td><td>" . $row->place . "</td></tr>";
     if (MatukioHelperSettings::getSettings('event_showinfoline', 1) > 0) {
         $body .= "\n<tr><td>" . JTEXT::_('COM_MATUKIO_MAX_PARTICIPANT') . ": </td><td>" . $row->maxpupil . "</td></tr>";
     }
     if ($row->fees > 0) {
         $body .= "\n<tr><td>" . JTEXT::_('COM_MATUKIO_FEES') . ": </td><td>" . MatukioHelperSettings::getSettings('currency_symbol', '$') . " " . $buchung->payment_brutto;
         if (MatukioHelperSettings::getSettings('frontend_usermehrereplaetze', 1) > 0) {
             // $body .= " " . JTEXT::_('COM_MATUKIO_PRO_PERSON');
         }
         $body .= "</td></tr>";
     }
     if ($row->description != "") {
         $body .= "\n<tr><td colspan=\"2\">" . self::getCleanedMailText($row->description) . "</td></tr>";
     }
     $body .= "</table><p>";
     $htxt = str_replace('SEM_HOMEPAGE', "<a href=\"" . JURI::root() . "\">" . JURI::root() . "</a>", JTEXT::_('COM_MATUKIO_FOR_MORE_INFO_VISIT'));
     $body .= $htxt . "</body>";
     return $body;
 }
Ejemplo n.º 3
0
echo $this->success_url;
?>
"/>

	<input type="hidden" name="custom"
	       value="<?php 
echo MatukioHelperUtilsBooking::getBookingId($this->booking->id);
?>
"/>

	<input type="hidden" name="item_number" value="<?php 
echo $this->item_number;
?>
"/>
	<input type="hidden" name="item_name" value="<?php 
echo $this->event->title . ' - [' . MatukioHelperUtilsBooking::getBookingId($this->booking->id) . ']';
?>
"/>

	<input type="hidden" name="currency_code" value="<?php 
echo $this->currency;
?>
"/>

	<?php 
if (!empty($this->tax_amount)) {
    ?>
  */ ?>
		<input type="hidden" name="amount" value="<?php 
    echo $this->net_amount;
    ?>
Ejemplo n.º 4
0
 */
defined('_JEXEC') or die('Restricted access');
$mainconfig = JFactory::getConfig();
$filename = $this->events[0]->title;
//var_dump($this->events);
if (count($this->events) > 1) {
    $filename = $mainconfig->get('sitename') . " - Events";
}
$icsdata = "BEGIN:VCALENDAR\n";
$icsdata .= "VERSION:2.0\n";
$icsdata .= "PRODID:" . MatukioHelperUtilsBasic::getSitePath() . "\n";
$icsdata .= "METHOD:PUBLISH\n";
foreach ($this->events as $event) {
    $user = JFactory::getuser($event->publisher);
    $icsdata .= "BEGIN:VEVENT\n";
    $icsdata .= "UID:" . MatukioHelperUtilsBooking::getBookingId($event->id) . "\n";
    $icsdata .= "ORGANIZER;CN=\"" . $user->name . "\":MAILTO:" . $user->email . "\n";
    $icsdata .= "SUMMARY:" . JText::_($event->title) . "\n";
    if ($event->webinar == 1) {
        $location = JText::_("COM_MATUKIO_WEBINAR");
    } elseif ($event->place_id != 0) {
        $locobj = MatukioHelperUtilsEvents::getLocation($event->place_id);
        $location = $locobj->location;
    } else {
        $location = $event->place;
    }
    $icsdata .= "LOCATION:" . str_replace("(\r\n|\n|\r)", ", ", $location) . "\n";
    $icsdata .= "DESCRIPTION:" . str_replace("(\r\n|\n|\r)", " ", $event->shortdesc) . "\n";
    $icsdata .= "CLASS:PUBLIC\n";
    $icsdata .= "DTSTART:" . strftime("%Y%m%dT%H%M%S", JFactory::getDate($event->begin)->toUnix()) . "\n";
    $icsdata .= "DTEND:" . strftime("%Y%m%dT%H%M%S", JFactory::getDate($event->end)->toUnix()) . "\n";
Ejemplo n.º 5
0
						<tr class="success">
							<td colspan="2"><?php 
echo JText::_("COM_MATUKIO_INFORMATIONS");
?>
</td>
						</tr>
						<tr>
							<td width="100" align="left" class="key">
								<?php 
echo JText::_('COM_MATUKIO_BOOKING_ID');
?>
							</td>
							<td>
								<?php 
if (!empty($this->booking->id)) {
    echo MatukioHelperUtilsBooking::getBookingId($this->booking->id) . " (" . $this->booking->id . ")";
}
?>
							</td>
						</tr>
						<tr>
							<td align="left" class="key">
								<?php 
echo JText::_('COM_MATUKIO_BOOKING_DATE');
?>
							</td>
							<td>
								<?php 
echo $this->booking->bookingdate;
?>
							</td>
for ($i = 0; $i < count($this->mybookedEvents); $i++) {
    $event = $this->mybookedEvents[$i];
    // Hack for multiple bookings with the same event
    if (empty($cureventid)) {
        $cureventid = $event->id;
    } else {
        if ($cureventid != $event->id) {
            // Reset
            $bcount = 0;
            $cureventid = $event->id;
        }
    }
    // Check if we are able to book
    $buchopt = MatukioHelperUtilsEvents::getEventBookableArray(1, $event, $user->id);
    $link = JRoute::_("index.php?option=com_matukio&view=booking&uuid=" . $buchopt[2][$bcount]->uuid);
    $booking_id = MatukioHelperUtilsBooking::getBookingId($buchopt[2][$bcount]->id);
    // Image
    // Todo Update Sometime
    $zusimage = "";
    $zusbild = 0;
    $linksbild = MatukioHelperUtilsBasic::getComponentImagePath() . "2701.png";
    $zusimage = MatukioHelperUtilsBasic::getComponentImagePath() . "2606.png";
    if ($user->id == 0) {
        $zusimage = "";
    }
    if ($event->cancelled == 1) {
        $linksbild = MatukioHelperUtilsBasic::getComponentImagePath() . "2604.png";
        $zusimage = MatukioHelperUtilsBasic::getComponentImagePath() . "2200.png";
    }
    if ($event->image != "" and MatukioHelperSettings::getSettings('event_image', 1) == 1) {
        $linksbild = MatukioHelperUtilsBasic::getEventImagePath(1) . $event->image;
Ejemplo n.º 7
0
    echo $invoice_image;
    ?>
				</td>
				<td>
					<?php 
    echo $l->comment;
    ?>
				</td>
				<td style="text-align: center">
					<?php 
    echo $bstatus;
    ?>
				</td>
				<td>
					<?php 
    echo MatukioHelperUtilsBooking::getBookingId($l->id) . " (" . $l->id . ")";
    ?>
				</td>
			</tr>
			<?php 
    $i++;
}
?>

	</table>
	</div>
	</div>
	<table>
		</tbody>
		<tfoot>
		<tr>
 /**
  * Generates the E-Mail booking info text
  *
  * @param   object  $event    - The event
  * @param   object  $booking  - The booking
  * @param   string  $name     - The name
  *
  * @return  string
  */
 public static function getEmailBookingInfoTEXT($event, $booking, $name)
 {
     $html = '\\n';
     $html .= JTEXT::_('COM_MATUKIO_BOOKING_NUMBER') . ":\t\t" . MatukioHelperUtilsBooking::getBookingId($booking->id) . "\n";
     if ($booking->nrbooked > 1) {
         $html .= JTEXT::_('COM_MATUKIO_BOOKED_PLACES') . ":\t\t" . $booking->nrbooked . "\n";
     }
     if (MatukioHelperSettings::getSettings('oldbookingform', 0) == 1) {
         if ($booking->userid == 0) {
             $user = JFactory::getUser(0);
             $user->name = $booking->name;
             $user->email = $booking->email;
         } else {
             $user = JFactory::getuser($booking->userid);
         }
         $html .= JTEXT::_('COM_MATUKIO_NAME') . ":\t\t" . $name . " (" . $user->name . ")" . "\n";
         $html .= JTEXT::_('COM_MATUKIO_EMAIL') . ":\t\t" . $booking->email . "\n";
     } else {
         // New booking form fields
         $fields = MatukioHelperUtilsBooking::getBookingFields();
         $fieldvals = explode(";", $booking->newfields);
         $value = array();
         foreach ($fieldvals as $val) {
             $tmp = explode("::", $val);
             if (count($tmp) > 1) {
                 $value[$tmp[0]] = $tmp[1];
             } else {
                 $value[$tmp[0]] = "";
             }
         }
         foreach ($fields as $field) {
             if ($field->type != "spacer" && $field->type != "spacertext") {
                 if (!empty($value[$field->id])) {
                     $html .= JTEXT::_($field->label) . ":\t\t" . $value[$field->id] . "\n";
                 } else {
                     $html .= JTEXT::_($field->label) . ":\t\t" . "\n";
                 }
             }
         }
     }
     $html .= '</table></p>';
     return $html;
 }
Ejemplo n.º 9
0
 if ($freieplaetze < 0) {
     $freieplaetze = 0;
 }
 $html .= MatukioHelperUtilsEvents::getTableHeader(4, "sem_list");
 $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell($row->title, 'd', 'c', '100%', 'sem_list_head', 2) . "</tr>";
 $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell($row->shortdesc, 'd', 'l', '100%', 'sem_list_row', 2) . "</tr>";
 if ($row->semnum != "") {
     $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_NUMBER') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell($row->semnum, 'd', 'l', '90%', 'sem_list_row') . "</tr>";
 }
 $htxt = $this->status[$i];
 if ($row->nrbooked < 1) {
     $htxt = JTEXT::_('COM_MATUKIO_CANNOT_BOOK_ONLINE');
 }
 $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_STATUS') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '', 'sem_list_row') . "</tr>";
 if ($row->codepic != "") {
     $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_BOOKING_ID') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell(MatukioHelperUtilsBooking::getBookingId($row->codepic), 'd', 'l', '', 'sem_list_row') . "</tr>";
 }
 if ($row->showbegin > 0) {
     $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_BEGIN') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell(JHTML::_('date', $row->begin, MatukioHelperSettings::getSettings('date_format_small', 'd-m-Y, H:i')), 'd', 'l', '', 'sem_list_row') . "</tr>";
 }
 if ($row->showend > 0) {
     $html .= "<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_END') . ":", 'd', 'l', '', 'sem_list_row') . MatukioHelperUtilsEvents::getTableCell(JHTML::_('date', $row->end), 'd', 'l', '', 'sem_list_row') . "</tr>";
 }
 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>";
Ejemplo n.º 10
0
$html .= "\n<title>" . $mainconfig->get('config.sitename') . " - " . JTEXT::_('COM_MATUKIO_EVENTS') . "</title>";
$html .= "\n<link>" . JURI::root() . "index.php?tmpl=component&amp;option=" . JFactory::getApplication()->input->get('option') . "&amp;view=eventlist</link>";
$html .= "\n<description>" . $mainconfig->get('config.sitename') . " - Events" . "</description>";
$html .= "\n<language>" . $sprache->getTag() . "</language>";
$html .= "\n<copyright>" . $mainconfig->get('config.fromname') . "</copyright>";
$html .= "\n<ttl>60</ttl>";
$html .= "\n<pubDate>" . date("r") . "</pubDate>";
foreach ($this->rows as $row) {
    $user = JFactory::getuser($row->publisher);
    $cancelled = "";
    if ($row->cancelled == 1) {
        $cancelled = " - " . JTEXT::_('COM_MATUKIO_CANCELLED');
    }
    $html .= "\n<item>";
    $html .= "\n<title>" . $row->title . $cancelled . "</title>";
    $html .= "\n<description>" . JTEXT::_('COM_MATUKIO_BEGIN') . ": " . JHTML::_('date', $row->begin, MatukioHelperSettings::getSettings('date_format_small', 'd-m-Y, H:i')) . " - " . $row->shortdesc . "</description>";
    $eventid_l = $row->id . ':' . JFilterOutput::stringURLSafe($row->title);
    $catid_l = $row->catid . ':' . JFilterOutput::stringURLSafe(MatukioHelperCategories::getCategoryAlias($row->catid));
    $link = JRoute::_(MatukioHelperRoute::getEventRoute($eventid_l, $catid_l), true, 2);
    $html .= "\n<link>" . $link . "</link>";
    if (MatukioHelperSettings::getSettings('frontend_showownerdetails', 1) > 0) {
        $html .= "\n<author>" . $user->name . ", " . $user->email . "</author>";
    }
    $html .= "\n<guid>" . MatukioHelperUtilsBooking::getBookingId($row->id) . "</guid>";
    $html .= "\n<category>" . $row->category . "</category>";
    $html .= "\n<pubDate>" . date("r", strtotime($row->publishdate)) . "</pubDate>";
    $html .= "\n</item>";
}
$html .= "\n</channel>";
$html .= "\n</rss>";
echo $html;
Ejemplo n.º 11
0
    $html .= "\n<tr>" . MatukioHelperUtilsEvents::getTableCell(JText::_('COM_MATUKIO_NAME') . ':', 'd', 'l', '20%', 'sem_rowd') . MatukioHelperUtilsEvents::getTableCell($nametemp, 'd', 'l', '80%', 'sem_rowd') . "</tr>";
}
$html .= "\n<tr>" . MatukioHelperUtilsEvents::getTableCell(JText::_('COM_MATUKIO_TITLE') . ':', 'd', 'l', '20%', 'sem_rowd') . MatukioHelperUtilsEvents::getTableCell(JText::_($this->event->title), 'd', 'l', '80%', 'sem_rowd') . "</tr>";
// Veranstaltungsnummer anzeigen
if ($this->event->semnum != "") {
    $html .= "\n<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_NUMBER') . ':', 'd', 'l', '20%', 'sem_rowd') . MatukioHelperUtilsEvents::getTableCell($this->event->semnum, 'd', 'l', '80%', 'sem_rowd') . "</tr>";
}
// Status anzeigen
$htxt = $buchopt[1];
if ($this->event->nrbooked < 1) {
    $htxt = JTEXT::_('COM_MATUKIO_CANNOT_BOOK_ONLINE');
}
$html .= "\n<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_STATUS') . ':', 'd', 'l', '20%', 'sem_rowd') . MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_rowd') . "</tr>";
// Buchungs-ID anzeigen
if (count($buchopt[2]) > 0) {
    $html .= "\n<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_BOOKING_ID') . ':', 'd', 'l', '20%', 'sem_rowd') . MatukioHelperUtilsEvents::getTableCell(MatukioHelperUtilsBooking::getBookingId($buchopt[2][0]->id), 'd', 'l', '80%', 'sem_rowd') . "</tr>";
}
// Falls abgesagt Formatierung aendern
$htx1 = "";
$htx2 = "";
if ($this->event->cancelled == 1) {
    $htx1 = "\n<span class=\"sem_cancelled\">" . JTEXT::_('COM_MATUKIO_CANCELLED') . " </span>(<del>";
    $htx2 = "</del>)";
}
// Beginn anzeigen
if ($this->event->showbegin > 0) {
    $html .= "\n<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_BEGIN') . ':', 'd', 'l', '20%', 'sem_rowd') . MatukioHelperUtilsEvents::getTableCell($htx1 . JHTML::_('date', $this->event->begin, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')) . MatukioHelperUtilsDate::getTimezone($this->event->begin) . $htx2, 'd', 'l', '80%', 'sem_rowd') . "</tr>";
}
// Ende anzeigen
if ($this->event->showend > 0) {
    $html .= "\n<tr>" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_END') . ':', 'd', 'l', '20%', 'sem_rowd') . MatukioHelperUtilsEvents::getTableCell($htx1 . JHTML::_('date', $this->event->end, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')) . MatukioHelperUtilsDate::getTimezone($this->event->end) . $htx2, 'd', 'l', '80%', 'sem_rowd') . "</tr>";