示例#1
0
					<?php 
_e('Booking Notes', 'dbem');
?>
				</h3>
				<div class="inside">
					<p><?php 
esc_html_e_emp('You can add private notes below for internal reference that only event managers will see.', 'dbem');
?>
</p>
					<?php 
foreach ($EM_Multiple_Booking->get_notes() as $note) {
    $user = new EM_Person($note['author']);
    ?>
					<div>
						<?php 
    echo sprintf(esc_html_x_emp('%1$s - %2$s wrote', '[Date] - [Name] wrote', 'dbem'), date(get_option('date_format'), $note['timestamp']), $user->get_name());
    ?>
: 
						<p style="background:#efefef; padding:5px;"><?php 
    echo nl2br($note['note']);
    ?>
</p> 
					</div>
					<?php 
}
?>
					<form method="post" action="" style="padding:5px;">
						<textarea class="widefat" rows="5" name="booking_note"></textarea>
						<input type="hidden" name="action" value="bookings_add_note" />
						<input type="submit" value="Add Note" />
					</form>
示例#2
0
	<div class='wrap'>
		<div id='icon-users' class='icon32'>
			<br/>
		</div>
  		<h2>
  			<?php 
    echo sprintf(__('Ticket for %s', 'dbem'), "'{$EM_Event->name}'");
    ?>

  			<a href="<?php 
    echo $EM_Event->get_edit_url();
    ?>
" class="button add-new-h2"><?php 
    _e('View/Edit Event', 'dbem');
    ?>
</a>
  			<a href="<?php 
    echo $EM_Event->get_bookings_url();
    ?>
" class="button add-new-h2"><?php 
    _e('View Event Bookings', 'dbem');
    ?>
</a>
  		</h2> 
  		<?php 
    if (!is_admin()) {
        echo $EM_Notices;
    }
    ?>

		<div>
			<table>
				<tr><td><?php 
    echo __('Name', 'dbem');
    ?>
</td><td></td><td><?php 
    echo $EM_Ticket->ticket_name;
    ?>
</td></tr>
				<tr><td><?php 
    echo __('Description', 'dbem');
    ?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td></td><td><?php 
    echo $EM_Ticket->ticket_description ? $EM_Ticket->ticket_description : '-';
    ?>
</td></tr>
				<tr><td><?php 
    echo __('Price', 'dbem');
    ?>
</td><td></td><td><?php 
    echo $EM_Ticket->ticket_price ? $EM_Ticket->ticket_price : '-';
    ?>
</td></tr>
				<tr><td><?php 
    echo __('Spaces', 'dbem');
    ?>
</td><td></td><td><?php 
    echo $EM_Ticket->ticket_spaces ? $EM_Ticket->ticket_spaces : '-';
    ?>
</td></tr>
				<tr><td><?php 
    echo __('Min', 'dbem');
    ?>
</td><td></td><td><?php 
    echo $EM_Ticket->ticket_min ? $EM_Ticket->ticket_min : '-';
    ?>
</td></tr>
				<tr><td><?php 
    echo __('Max', 'dbem');
    ?>
</td><td></td><td><?php 
    echo $EM_Ticket->ticket_max ? $EM_Ticket->ticket_max : '-';
    ?>
</td></tr>
				<tr><td><?php 
    echo __('Start', 'dbem');
    ?>
</td><td></td><td><?php 
    echo $EM_Ticket->ticket_start ? $EM_Ticket->ticket_start : '-';
    ?>
</td></tr>
				<tr><td><?php 
    echo __('End', 'dbem');
    ?>
</td><td></td><td><?php 
    echo $EM_Ticket->ticket_end ? $EM_Ticket->ticket_end : '-';
    ?>
</td></tr>
				<?php 
    do_action('em_booking_admin_ticket_row', $EM_Ticket);
    ?>

			</table>
		</div>
		<div class="icon32" id="icon-bookings"><br></div>
		<h2><?php 
    _e('Bookings', 'dbem');
    ?>
</h2>
		<?php 
    $EM_Bookings_Table = new EM_Bookings_Table();
    $EM_Bookings_Table->status = get_option('dbem_bookings_approval') ? 'needs-attention' : 'confirmed';
    $EM_Bookings_Table->output();
    ?>

		<?php 
    do_action('em_bookings_ticket_footer', $EM_Ticket);
    ?>

	</div>
	<?php 
}
/**
 * Shows a single booking for a single person. 
 */
function em_bookings_single()
{
    global $EM_Booking, $EM_Notices;
    /* @var $EM_Booking EM_Booking */
    //check that user can access this page
    if (is_object($EM_Booking) && !$EM_Booking->can_manage()) {
        ?>

		<div class="wrap"><h2><?php 
        _e('Unauthorized Access', 'dbem');
        ?>
</h2><p><?php 
        _e('You do not have the rights to manage this event.', 'dbem');
        ?>
</p></div>
		<?php 
        return false;
    }
    ?>

	<div class='wrap' id="em-bookings-admin-booking">
		<div class="icon32" id="icon-bookings"><br></div>
  		<h2>
  			<?php 
    _e('Edit Booking', 'dbem');
    ?>

  		</h2>
  		<?php 
    if (!is_admin()) {
        echo $EM_Notices;
    }
    ?>

  		<div id="poststuff" class="metabox-holder">
	  		<div id="post-body">
				<div id="post-body-content">
					<div class="stuffbox">
						<h3>
							<?php 
    _e('Event Details', 'dbem');
    ?>

						</h3>
						<div class="inside">
							<?php 
    $EM_Event = $EM_Booking->get_event();
    $localised_start_date = date_i18n(get_option('dbem_date_format'), $EM_Event->start);
    $localised_end_date = date_i18n(get_option('dbem_date_format'), $EM_Event->end);
    ?>

							<table>
								<tr><td><strong><?php 
    _e('Name', 'dbem');
    ?>
</strong></td><td><a class="row-title" href="<?php 
    echo $EM_Event->get_bookings_url();
    ?>
"><?php 
    echo $EM_Event->event_name;
    ?>
</a></td></tr>
								<tr>
									<td><strong><?php 
    _e('Date/Time', 'dbem');
    ?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></td>
									<td>
										<?php 
    echo $localised_start_date;
    ?>

										<?php 
    echo $localised_end_date != $localised_start_date ? " - {$localised_end_date}" : '';
    ?>

										<?php 
    echo substr($EM_Event->start_time, 0, 5) . " - " . substr($EM_Event->end_time, 0, 5);
    ?>

									</td>
								</tr>
							</table>
							<?php 
    do_action('em_bookings_admin_booking_event', $EM_Event);
    ?>

						</div>
					</div> 		
					<div class="stuffbox">
						<h3>
							<?php 
    _e('Personal Details', 'dbem');
    ?>

						</h3>
						<div class="inside">
							<?php 
    $no_user = get_option('dbem_bookings_registration_disable') && $EM_Booking->get_person()->ID == get_option('dbem_bookings_registration_user');
    ?>

							<div class="em-booking-person-details">
								<?php 
    echo $EM_Booking->get_person()->display_summary();
    ?>

								<?php 
    if ($no_user) {
        ?>

								<input type="button" id="em-booking-person-modify" value="<?php 
        esc_attr_e('Edit Details', 'dbem');
        ?>
" />
								<?php 
    }
    ?>

							</div>
							<?php 
    if ($no_user) {
        ?>

							<form action="" method="post" class="em-booking-person-form">
								<div class="em-booking-person-editor" style="display:none;">
									<?php 
        echo $EM_Booking->get_person_editor();
        ?>

								 	<input type='hidden' name='action' value='booking_modify_person'/>
								 	<input type='hidden' name='booking_id' value='<?php 
        echo $EM_Booking->booking_id;
        ?>
'/>
								 	<input type='hidden' name='event_id' value='<?php 
        echo $EM_Event->event_id;
        ?>
'/>
								 	<input type='hidden' name='_wpnonce' value='<?php 
        echo wp_create_nonce('booking_modify_person_' . $EM_Booking->booking_id);
        ?>
'/>
									<input type="submit" class="em-booking-person-modify-submit" id="em-booking-person-modify-submit" value="<?php 
        _e('Submit Changes', 'dbem');
        ?>
" />
									<input type="button" id="em-booking-person-modify-cancel" value="<?php 
        esc_attr_e('Cancel', 'dbem');
        ?>
" />
								</div>
							</form>	
							<script type="text/javascript">
								jQuery(document).ready( function($){
									$('#em-booking-person-modify').click(function(){
										$('.em-booking-person-details').hide();
										$('.em-booking-person-editor').show();
									});
									$('#em-booking-person-modify-cancel').click(function(){
										$('.em-booking-person-details').show();
										$('.em-booking-person-editor').hide();
									});
								});
							</script>				
							<?php 
    }
    ?>

							<?php 
    do_action('em_bookings_admin_booking_person', $EM_Booking);
    ?>

						</div>
					</div> 	
					<div class="stuffbox">
						<h3>
							<?php 
    _e('Booking Details', 'dbem');
    ?>

						</h3>
						<div class="inside">
							<?php 
    $EM_Event = $EM_Booking->get_event();
    $localised_start_date = date_i18n(get_option('date_format'), $EM_Event->start);
    $localised_end_date = date_i18n(get_option('date_format'), $EM_Event->end);
    $shown_tickets = array();
    ?>

							<div>
								<form action="" method="post" class="em-booking-single-status-info">
									<strong><?php 
    _e('Status', 'dbem');
    ?>
 : </strong>
									<?php 
    echo $EM_Booking->get_status();
    ?>

									<input type="button" class="em-booking-submit-status-modify" id="em-booking-submit-status-modify" value="<?php 
    _e('Change', 'dbem');
    ?>
" />
									<input type="submit" class="em-booking-resend-email" id="em-booking-resend-email" value="<?php 
    _e('Resend Email', 'dbem');
    ?>
" />
								 	<input type='hidden' name='action' value='booking_resend_email'/>
								 	<input type='hidden' name='booking_id' value='<?php 
    echo $EM_Booking->booking_id;
    ?>
'/>
								 	<input type='hidden' name='event_id' value='<?php 
    echo $EM_Event->event_id;
    ?>
'/>
								 	<input type='hidden' name='_wpnonce' value='<?php 
    echo wp_create_nonce('booking_resend_email_' . $EM_Booking->booking_id);
    ?>
'/>
								</form>
								<form action="" method="post" class="em-booking-single-status-edit">
									<strong><?php 
    _e('Status', 'dbem');
    ?>
 : </strong>
									<select name="booking_status">
										<?php 
    foreach ($EM_Booking->status_array as $status => $status_name) {
        ?>

										<option value="<?php 
        echo esc_attr($status);
        ?>
" <?php 
        if ($status == $EM_Booking->booking_status) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo esc_html($status_name);
        ?>
</option>
										<?php 
    }
    ?>

									</select>
									<input type="checkbox" checked="checked" name="send_email" value="1" />
									<?php 
    _e('Send Email', 'dbem');
    ?>

									<input type="submit" class="em-booking-submit-status" id="em-booking-submit-status" value="<?php 
    _e('Submit Changes', 'dbem');
    ?>
" />
									<input type="button" class="em-booking-submit-status-cancel" id="em-booking-submit-status-cancel" value="<?php 
    _e('Cancel', 'dbem');
    ?>
" />
								 	<input type='hidden' name='action' value='booking_set_status'/>
								 	<input type='hidden' name='booking_id' value='<?php 
    echo $EM_Booking->booking_id;
    ?>
'/>
								 	<input type='hidden' name='event_id' value='<?php 
    echo $EM_Event->event_id;
    ?>
'/>
								 	<input type='hidden' name='_wpnonce' value='<?php 
    echo wp_create_nonce('booking_set_status_' . $EM_Booking->booking_id);
    ?>
'/>
									<br /><em><?php 
    _e('<strong>Notes:</strong> Ticket availability not taken into account when approving new bookings (i.e. you can overbook).', 'dbem');
    ?>
</em>
								</form>
							</div>
							<form action="" method="post" class="em-booking-form">
								<table class="em-tickets-bookings-table" cellpadding="0" cellspacing="0">
									<thead>
									<tr>
										<th><?php 
    _e('<!- -:bg- ->Вид билет<!- -:- -><!- -:en- ->Ticket Type<!- -:- ->', 'dbem');
    ?>
</th>
										<th><?php 
    _e('Spaces', 'dbem');
    ?>
</th>			
 /**
  * Gets data from the right location according to the field ID provided. For example, user_email (emails) are retreived from the wp_users table whereas other info is usually taken from wp_usermeta
  * @param string $field_id
  */
 public static function get_user_meta($user_id = false, $field_id, $single = true)
 {
     if (!$user_id) {
         $user_id = get_current_user_id();
     }
     if ($field_id == 'user_email') {
         $WP_User = get_user_by('id', $user_id);
         $return = $WP_User->user_email;
     } elseif ($field_id == 'name') {
         $WP_User = get_user_by('id', $user_id);
         $EM_Person = new EM_Person($WP_User);
         $return = $EM_Person->get_name();
     } else {
         $return = get_user_meta($user_id, $field_id, true);
     }
     return $return;
 }