/**
  * 		generates HTML for the Registration main meta box
  *		@access public
  *		@return void
  */
 public function _reg_attendees_meta_box()
 {
     global $wpdb;
     $REG = EEM_Registration::instance();
     //get all other registrations on this transaction, and cache
     //the attendees for them so we don't have to run another query using force_join
     $registrations = $REG->get_all(array(array('TXN_ID' => $this->_registration->transaction_ID(), 'REG_ID' => array('!=', $this->_registration->ID())), 'force_join' => array('Attendee')));
     $this->_template_args['attendees'] = array();
     $this->_template_args['attendee_notice'] = '';
     EE_Registry::instance()->load_helper('Array');
     if (empty($registrations) || is_array($registrations) && !EEH_Array::get_one_item_from_array($registrations)) {
         EE_Error::add_error(__('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
         $this->_template_args['attendee_notice'] = EE_Error::get_notices();
     } else {
         $att_nmbr = 1;
         foreach ($registrations as $registration) {
             /* @var $registration EE_Registration */
             $attendee = $registration->attendee() ? $registration->attendee() : EEM_Attendee::instance()->create_default_object();
             $this->_template_args['attendees'][$att_nmbr]['fname'] = $attendee->fname();
             //( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : '';
             $this->_template_args['attendees'][$att_nmbr]['lname'] = $attendee->lname();
             //( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : '';
             $this->_template_args['attendees'][$att_nmbr]['email'] = $attendee->email();
             //( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : '';
             $this->_template_args['attendees'][$att_nmbr]['final_price'] = $registration->price_paid();
             //( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : '';
             $this->_template_args['attendees'][$att_nmbr]['address'] = implode(', ', $attendee->full_address_as_array());
             $this->_template_args['attendees'][$att_nmbr]['att_link'] = self::add_query_args_and_nonce(array('action' => 'edit_attendee', 'post' => $attendee->ID()), REG_ADMIN_URL);
             $att_nmbr++;
         }
         //printr( $attendees, '$attendees  <br /><span style="font-size:10px;font-weight:normal;">( file: '. __FILE__ . ' - line no: ' . __LINE__ . ' )</span>', 'auto' );
         $this->_template_args['event_name'] = $this->_registration->event_obj()->name();
         $this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
         //			$this->_template_args['registration_form_url'] = add_query_arg( array( 'action' => 'edit_registration', 'process' => 'attendees'  ), REG_ADMIN_URL );
     }
     $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_attendees.template.php';
     echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
 }