Ejemplo n.º 1
0
function eme_user_profile($user) {
   //$eme_phone=get_user_meta($user,'eme_phone',true);
   $eme_phone=$user->eme_phone;
   $person = eme_get_person_by_wp_id($user->ID);
   // only show future bookings
   $future=1;
   // define a simple template
   $template="#_STARTDATE #_STARTTIME: #_EVENTNAME (#_RESPSPACES places). #_CANCEL_LINK<br />";
   ?>
   <h3><?php _e('Events Made Easy settings', 'eme')?></h3>
   <table class='form-table'>
      <tr>
         <th><label for="eme_phone"><?php _e('Phone number','eme');?></label></th>
         <td><input type="text" name="eme_phone" id="eme_phone" value="<?php echo $eme_phone; ?>" class="regular-text" /> <br />
         <?php _e('The phone number used by Events Made Easy when the user is indicated as the contact person for an event.','eme');?></td>
      </tr>
      <?php if ($person) { ?>
      <tr>
         <th><label for="eme_phone"><?php _e('Future bookings made','eme');?></label></th>
	 <td><?php echo eme_get_bookings_list_for_person($person,$future,$template); ?>
      </tr>
      <?php } ?>
   </table>
   <?php
}
Ejemplo n.º 2
0
function eme_mybooking_list_shortcode($atts)
{
    extract(shortcode_atts(array('template_id' => 0, 'template_id_header' => 0, 'template_id_footer' => 0, 'future' => 1, 'approval_status' => 0), $atts));
    if (is_user_logged_in()) {
        $booker_wp_id = get_current_user_id();
        $person = eme_get_person_by_wp_id($booker_wp_id);
        if ($person) {
            return eme_get_bookings_list_for_person($person, $future, '', $template_id, $template_id_header, $template_id_footer, $approval_status);
        }
    }
}