当前位置: 首页>>代码示例>>PHP>>正文


PHP em_get_my_bookings_url函数代码示例

本文整理汇总了PHP中em_get_my_bookings_url函数的典型用法代码示例。如果您正苦于以下问题:PHP em_get_my_bookings_url函数的具体用法?PHP em_get_my_bookings_url怎么用?PHP em_get_my_bookings_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了em_get_my_bookings_url函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: output

 function output($format, $target = "html")
 {
     preg_match_all("/(#@?_?[A-Za-z0-9]+)({([^}]+)})?/", $format, $placeholders);
     foreach ($this->get_tickets() as $EM_Ticket) {
         /* @var $EM_Ticket EM_Ticket */
         break;
     }
     //Get first ticket for single ticket placeholders
     $output_string = $format;
     $replaces = array();
     foreach ($placeholders[1] as $key => $result) {
         $replace = '';
         $full_result = $placeholders[0][$key];
         switch ($result) {
             case '#_BOOKINGID':
                 $replace = $this->booking_id;
                 break;
             case '#_RESPNAME':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGNAME':
                 $replace = $this->get_person()->get_name();
                 break;
             case '#_RESPEMAIL':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGEMAIL':
                 $replace = $this->get_person()->user_email;
                 break;
             case '#_RESPPHONE':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGPHONE':
                 $replace = $this->get_person()->phone;
                 break;
             case '#_BOOKINGSPACES':
                 $replace = $this->get_spaces();
                 break;
             case '#_BOOKINGDATE':
                 $replace = $this->timestamp ? date_i18n(get_option('dbem_date_format'), $this->timestamp) : 'n/a';
                 break;
             case '#_BOOKINGTIME':
                 $replace = $this->timestamp ? date_i18n(get_option('dbem_time_format'), $this->timestamp) : 'n/a';
                 break;
             case '#_BOOKINGDATETIME':
                 $replace = $this->timestamp ? date_i18n(get_option('dbem_date_format') . ' ' . get_option('dbem_time_format'), $this->timestamp) : 'n/a';
                 break;
             case '#_BOOKINGLISTURL':
                 $replace = em_get_my_bookings_url();
                 break;
             case '#_COMMENT':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGCOMMENT':
                 $replace = $this->booking_comment;
                 break;
                 $replace = $this->get_price(true);
                 //if there's tax, it'll be added here
                 break;
             case '#_BOOKINGPRICEWITHOUTTAX':
                 $replace = $this->format_price($this->get_price() - $this->get_price_taxes());
                 break;
             case '#_BOOKINGPRICETAX':
                 $replace = $this->get_price_taxes(true);
                 break;
             case '#_BOOKINGPRICEWITHTAX':
             case '#_BOOKINGPRICE':
                 $replace = $this->get_price(true);
                 break;
             case '#_BOOKINGTICKETNAME':
                 $replace = $EM_Ticket->name;
                 break;
             case '#_BOOKINGTICKETDESCRIPTION':
                 $replace = $EM_Ticket->description;
                 break;
             case '#_BOOKINGTICKETPRICEWITHTAX':
                 $replace = $this->format_price($EM_Ticket->get_price_without_tax() * (1 + $this->get_tax_rate() / 100));
                 break;
             case '#_BOOKINGTICKETPRICEWITHOUTTAX':
                 $replace = $EM_Ticket->get_price_without_tax(true);
                 break;
             case '#_BOOKINGTICKETTAX':
                 $replace = $this->format_price($EM_Ticket->get_price_without_tax() * ($this->get_tax_rate() / 100));
                 break;
             case '#_BOOKINGTICKETPRICE':
                 $replace = $EM_Ticket->get_price(true);
                 break;
             case '#_BOOKINGTICKETS':
                 ob_start();
                 em_locate_template('emails/bookingtickets.php', true, array('EM_Booking' => $this));
                 $replace = ob_get_clean();
                 break;
             case '#_BOOKINGSUMMARY':
                 ob_start();
                 em_locate_template('emails/bookingsummary.php', true, array('EM_Booking' => $this));
                 $replace = ob_get_clean();
                 break;
             default:
                 $replace = $full_result;
                 break;
//.........这里部分代码省略.........
开发者ID:aivar11,项目名称:events-manager,代码行数:101,代码来源:em-booking.php

示例2: get_option

// We are firstly checking if the user has already booked a ticket at this event, if so offer a link to view their bookings.
$EM_Booking = $EM_Event->get_bookings()->has_booking();
?>

	<?php 
if (is_object($EM_Booking) && !get_option('dbem_bookings_double')) {
    //Double bookings not allowed
    ?>

		<p>
			<?php 
    echo get_option('dbem_bookings_form_msg_attending');
    ?>

			<a href="<?php 
    echo em_get_my_bookings_url();
    ?>
"><?php 
    echo get_option('dbem_bookings_form_msg_bookings_link');
    ?>
</a>
		</p>
	<?php 
} elseif (!$EM_Event->event_rsvp) {
    //bookings not enabled
    ?>

		<p><?php 
    echo get_option('dbem_bookings_form_msg_disabled');
    ?>
</p>
开发者ID:pcco,项目名称:portal-redesign,代码行数:31,代码来源:bookingform.php

示例3: output

 function output($format, $target = "html")
 {
     preg_match_all("/(#@?_?[A-Za-z0-9]+)({([^}]+)})?/", $format, $placeholders);
     foreach ($this->get_tickets() as $EM_Ticket) {
         break;
     }
     //Get first ticket for single ticket placeholders
     $output_string = $format;
     $replaces = array();
     foreach ($placeholders[1] as $key => $result) {
         $replace = '';
         $full_result = $placeholders[0][$key];
         switch ($result) {
             case '#_BOOKINGID':
                 $replace = $this->booking_id;
                 break;
             case '#_RESPNAME':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGNAME':
                 $replace = $this->get_person()->get_name();
                 break;
             case '#_RESPEMAIL':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGEMAIL':
                 $replace = $this->get_person()->user_email;
                 break;
             case '#_RESPPHONE':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGPHONE':
                 $replace = $this->get_person()->phone;
                 break;
             case '#_BOOKINGSPACES':
                 $replace = $this->get_spaces();
                 break;
             case '#_BOOKINGLISTURL':
                 $replace = em_get_my_bookings_url();
                 break;
             case '#_COMMENT':
                 //Depreciated
             //Depreciated
             case '#_BOOKINGCOMMENT':
                 $replace = $this->booking_comment;
                 break;
             case '#_BOOKINGPRICEWITHTAX':
                 $replace = em_get_currency_symbol(true) . " " . number_format($this->get_price(false, false, true), 2);
                 break;
             case '#_BOOKINGPRICEWITHOUTTAX':
                 $replace = em_get_currency_symbol(true) . " " . number_format($this->get_price(false, false, false), 2);
                 break;
             case '#_BOOKINGPRICETAX':
                 $replace = em_get_currency_symbol(true) . " " . number_format($this->get_price(false, false, false) * (get_option('dbem_bookings_tax') / 100), 2);
                 break;
             case '#_BOOKINGPRICE':
                 $replace = em_get_currency_symbol(true) . " " . number_format($this->get_price(), 2);
                 break;
             case '#_BOOKINGTICKETNAME':
                 $replace = $EM_Ticket->name;
                 break;
             case '#_BOOKINGTICKETDESCRIPTION':
                 $replace = $EM_Ticket->description;
                 break;
             case '#_BOOKINGTICKETPRICEWITHTAX':
                 $replace = em_get_currency_symbol(true) . " " . number_format($EM_Ticket->get_price(false, true), 2);
                 break;
             case '#_BOOKINGTICKETPRICEWITHOUTTAX':
                 $replace = em_get_currency_symbol(true) . " " . number_format($EM_Ticket->get_price(false, false), 2);
                 break;
             case '#_BOOKINGTICKETTAX':
                 $replace = em_get_currency_symbol(true) . " " . number_format($EM_Ticket->get_price(false, false) * (get_option('dbem_bookings_tax') / 100), 2);
                 break;
             case '#_BOOKINGTICKETPRICE':
                 $replace = em_get_currency_symbol(true) . " " . number_format($EM_Ticket->get_price(), 2);
                 break;
             case '#_BOOKINGTICKETS':
                 ob_start();
                 em_locate_template('emails/bookingtickets.php', true, array('EM_Booking' => $this));
                 $replace = ob_get_clean();
                 break;
             default:
                 $replace = $full_result;
                 break;
         }
         $replaces[$full_result] = apply_filters('em_booking_output_placeholder', $replace, $this, $full_result, $target);
     }
     //sort out replacements so that during replacements shorter placeholders don't overwrite longer varieties.
     krsort($replaces);
     foreach ($replaces as $full_result => $replacement) {
         $output_string = str_replace($full_result, $replacement, $output_string);
     }
     //run event output too, since this is never run from within events and will not infinitely loop
     $output_string = $this->get_event()->output($output_string, $target);
     return apply_filters('em_booking_output', $output_string, $this, $format, $target);
 }
开发者ID:rajankz,项目名称:webspace,代码行数:96,代码来源:em-booking.php

示例4: email

 /**
  * @param EM_Booking $EM_Booking
  * @param EM_Event $event
  * @return boolean
  */
 function email()
 {
     global $EM_Mailer;
     //FIXME ticket logic needed
     $EM_Event = $this->get_event();
     //We NEED event details here.
     //Make sure event matches booking, and that booking used to be approved.
     if (!($this->status == 0 && $this->previous_status > 0) || $this->previous_status == 4) {
         $contact_id = $EM_Event->owner != "" ? $EM_Event->owner : get_option('dbem_default_contact_person');
         $contact_subject = get_option('dbem_bookings_contact_email_subject');
         $contact_body = get_option('dbem_bookings_contact_email_body');
         if (get_option('dbem_bookings_approval') == 0 && $this->status < 2 || $this->status == 1) {
             $booker_subject = get_option('dbem_bookings_email_confirmed_subject');
             $booker_body = get_option('dbem_bookings_email_confirmed_body');
         } elseif ($this->status == 0 || $this->previous_status == 4) {
             $booker_subject = get_option('dbem_bookings_email_pending_subject');
             $booker_body = get_option('dbem_bookings_email_pending_body');
         } elseif ($this->status == 2) {
             $booker_subject = get_option('dbem_bookings_email_rejected_subject');
             $booker_body = get_option('dbem_bookings_email_rejected_body');
         } elseif ($this->status == 3) {
             $booker_subject = get_option('dbem_bookings_email_cancelled_subject');
             $booker_body = get_option('dbem_bookings_email_cancelled_body');
             $contact_subject = get_option('dbem_contactperson_email_cancelled_subject');
             $contact_body = get_option('dbem_contactperson_email_cancelled_body');
         }
         // email specific placeholders
         $placeholders = array('#_RESPNAME' => '#_BOOKINGNAME', '#_RESPEMAIL' => '#_BOOKINGEMAIL', '#_RESPPHONE' => '#_BOOKINGPHONE', '#_COMMENT' => '#_BOOKINGCOMMENT', '#_RESERVEDSPACES' => '#_BOOKEDSPACES', '#_BOOKINGNAME' => $this->person->display_name, '#_BOOKINGEMAIL' => $this->person->user_email, '#_BOOKINGPHONE' => $this->person->phone, '#_BOOKINGSPACES' => $this->get_spaces(), '#_BOOKINGLISTURL' => em_get_my_bookings_url(), '#_BOOKINGCOMMENT' => $this->comment);
         foreach ($placeholders as $key => $value) {
             $contact_subject = str_replace($key, $value, $contact_subject);
             $contact_body = str_replace($key, $value, $contact_body);
             $booker_subject = str_replace($key, $value, $booker_subject);
             $booker_body = str_replace($key, $value, $booker_body);
         }
         $booker_subject = $EM_Event->output($booker_subject, 'email');
         $booker_body = $EM_Event->output($booker_body, 'email');
         //Send to the person booking
         if (!$this->email_send($booker_subject, $booker_body, $this->person->user_email)) {
             return false;
         }
         //Send admin/contact emails
         if ((get_option('dbem_bookings_approval') == 0 || $this->status == 0 || $this->status == 3) && (get_option('dbem_bookings_contact_email') == 1 || get_option('dbem_bookings_notify_admin') != '')) {
             //Only gets sent if this is a pending booking, unless approvals are disabled.
             $contact_subject = $EM_Event->output($contact_subject, 'email');
             $contact_body = $EM_Event->output($contact_body, 'email');
             if (get_option('dbem_bookings_contact_email') == 1) {
                 if (!$this->email_send($contact_subject, $contact_body, $EM_Event->contact->user_email) && current_user_can('activate_plugins')) {
                     $this->errors[] = __('Confirmation email could not be sent to contact person. Registrant should have gotten their email (only admin see this warning).', 'dbem');
                     return false;
                 }
             }
             if (get_option('dbem_bookings_notify_admin') != '' && preg_match('/^[_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,3}$/', get_option('dbem_bookings_notify_admin'))) {
                 if (!$this->email_send($contact_subject, $contact_body, get_option('dbem_bookings_notify_admin'))) {
                     $this->errors[] = __('Confirmation email could not be sent to admin. Registrant should have gotten their email (only admin see this warning).', 'dbem');
                     return false;
                 }
             }
         }
         return true;
     }
     return false;
     //TODO need error checking for booking mail send
 }
开发者ID:hypenotic,项目名称:slowfood,代码行数:68,代码来源:em-booking.php

示例5: array_push

for ($i = 1; $i <= 10; $i++) {
    $booking_spaces = !empty($_POST['booking_spaces']) && $_POST['booking_spaces'] == $i ? 'selected="selected"' : '';
    array_push($booked_places_options, "<option value='{$i}' {$booking_spaces}>{$i}</option>");
}
$EM_Tickets = $EM_Event->get_bookings()->get_tickets();
?>
<div id="em-booking">
	<a name="em-booking"></a>
	<?php 
// We are firstly checking if the user has already booked a ticket at this event, if so offer a link to view their bookings.
?>
	<?php 
if ($EM_Event->get_bookings()->has_booking()) {
    ?>
		<p><?php 
    echo sprintf(__('You are currently attending this event. <a href="%s">Manage my bookings</a>', 'dbem'), em_get_my_bookings_url());
    ?>
</p>
	<?php 
} elseif ($EM_Event->start < current_time('timestamp')) {
    ?>
		<p><?php 
    _e('Bookings are closed for this event.', 'dbem');
    ?>
</p>
	<?php 
} else {
    ?>
		<?php 
    echo $EM_Notices;
    ?>
开发者ID:hypenotic,项目名称:slowfood,代码行数:31,代码来源:bookingform.php

示例6: array_push

for ($i = 1; $i <= 10; $i++) {
    $booking_spaces = !empty($_POST['booking_spaces']) && $_POST['booking_spaces'] == $i ? 'selected="selected"' : '';
    array_push($booked_places_options, "<option value='{$i}' {$booking_spaces}>{$i}</option>");
}
$EM_Tickets = $EM_Event->get_bookings()->get_tickets();
?>
<div id="em-booking">
	<a name="em-booking"></a>
	<?php 
// We are firstly checking if the user has already booked a ticket at this event, if so offer a link to view their bookings.
?>
	<?php 
if ($EM_Booking = $EM_Event->get_bookings()->has_booking()) {
    ?>
		<p><?php 
    echo apply_filters('em_my_bookings_booked_message', sprintf(__('You are currently attending this event. <a href="%s">Manage my bookings</a>', 'dbem'), em_get_my_bookings_url()), $EM_Booking);
    ?>
</p>
	<?php 
} elseif (!$EM_Event->rsvp) {
    ?>
		<p><?php 
    _e('Online bookings are not available for this event.', 'dbem');
    ?>
</p>
	<?php 
} elseif ($EM_Event->start < current_time('timestamp')) {
    ?>
		<p><?php 
    _e('Bookings are closed for this event.', 'dbem');
    ?>
开发者ID:hypenotic,项目名称:slowfood,代码行数:31,代码来源:bookingform.php


注:本文中的em_get_my_bookings_url函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。