function custom_pdf()
 {
     setup_regis_details($_REQUEST['regis_id']);
     if (!epl_check_token()) {
         exit(epl__('You have reached this page in error.'));
     }
     $data['content'] = apply_filters('epl_custom_admin_pdf_content', 'No Content');
     $data['vars'] = apply_filters('epl_custom_admin_pdf_vars', array());
     $view = apply_filters('epl_custom_admin_pdf_view_file', '');
     if ($view == '') {
         return '';
     }
     $i = $this->load_view($view, $data, true);
     $this->epl->epl_util->make_pdf($i, false, true, false, 'portrait');
     exit;
 }
            <th>Transaction ID</th>

            <th>Status</th>
        </tr>
    </thead>
    <?php 
global $regis_details, $post, $epl_fields, $event_details;
$total_due = 0;
$total_paid = 0;
if ($regis_list->have_posts()) {
    while ($regis_list->have_posts()) {
        $total_att = 0;
        $zebra = $zebra == 'odd' ? 'even' : 'odd';
        $regis_list->the_post();
        //setup_event_details();
        setup_regis_details(get_the_ID());
        $payment_method = isset($regis_details['_epl_payment_method']) && $regis_details['_epl_payment_method'] != '' ? $epl_fields['epl_regis_payment_fields']['_epl_payment_method']['options'][$regis_details['_epl_payment_method']] : '';
        $total_due += $regis_details['_epl_grand_total'];
        $total_paid += $regis_details['_epl_payment_amount'];
        foreach ((array) $regis_details['_epl_events'] as $event_id => $totals) {
            setup_event_details($event_id);
            $data['event_name'] = $event_details['post_title'];
            $data['quantity'] = $totals['_att_quantity']['total'][$event_id];
            // echo "<tr><td>{$event_details['post_title']}</td><td class='qty'>{$data['quantity']}</td></tr>";
            $total_att += $totals['_att_quantity']['total'][$event_id];
        }
        ?>

            <tr class="fin <?php 
        echo $zebra;
        ?>
 function update_payment_data($args = array())
 {
     global $epl_fields, $regis_details;
     $this->epl->load_config('regis-fields');
     if (EPL_IS_ADMIN) {
         $_epl_payment_data = epl_get_element('_epl_payment_data', $_POST, array());
     } else {
         $_epl_payment_data = epl_get_element('_epl_payment_data', $regis_details, array());
     }
     $defaults = $this->epl_util->remove_array_vals(array_flip(array_keys($epl_fields['epl_regis_payment_fields'])));
     $args = wp_parse_args($args, $defaults);
     if (!isset($args['post_ID'])) {
         return false;
     }
     $post_ID = intval($args['post_ID']);
     update_post_meta($post_ID, '_epl_regis_status', epl_get_element('_epl_regis_status', $args, $this->current_data[$this->regis_id]['_epl_regis_status']));
     update_post_meta($post_ID, '_epl_waitlist_status', epl_get_element('_epl_waitlist_status', $args, $this->current_data[$this->regis_id]['_epl_regis_status']));
     if (isset($args['_epl_payment_amount']) && $args['_epl_payment_amount'] == '') {
         if (empty($_epl_payment_data)) {
             //$_epl_payment_data[time()] = array_merge($defaults, $regis_details);
         }
         update_post_meta($post_ID, '_epl_payment_data', $_epl_payment_data);
         return false;
     }
     $tmp = array();
     foreach ($defaults as $meta_key => $meta_value) {
         if ($args[$meta_key] == '') {
             $default = isset($epl_fields['epl_regis_payment_fields'][$meta_key]['default_value']) ? $epl_fields['epl_regis_payment_fields'][$meta_key]['default_value'] : '';
             $args[$meta_key] = $default;
         }
         update_post_meta($post_ID, $meta_key, $args[$meta_key]);
         $tmp[$meta_key] = $args[$meta_key];
     }
     //update_post_meta( $post_ID, '_epl_balance_due', $args['_epl_balance_due'] );
     //update_post_meta( $post_ID, '_epl_grand_total', $args['_epl_grand_total'] );
     $_epl_payment_data[time()] = $tmp;
     update_post_meta($post_ID, '_epl_payment_data', $_epl_payment_data);
     if (empty($regis_details)) {
         setup_regis_details($post_ID);
     }
     $regis_details['_epl_payment_data'] = $_epl_payment_data;
     $this->update_regis_status();
     return true;
 }
 function wildcard_lookup($lookup, $limit = 5)
 {
     global $wpdb, $regis_details;
     $lookup = $wpdb->escape($lookup);
     $s_key = explode('-', epl_get_element('s_key', $_REQUEST, false));
     $filter_event_id = $s_key[0];
     $q = $wpdb->get_results("SELECT p.ID, p.post_title,p.post_date,  pm.meta_key, pm.meta_value \n                FROM {$wpdb->postmeta} pm \n                    JOIN {$wpdb->posts} p \n                        ON p.ID = pm.post_id \n                        WHERE meta_key='__epl' \n                        AND p.post_status ='publish' \n                        AND meta_value like '%{$lookup}%' \n                            ORDER BY meta_id DESC LIMIT {$limit}");
     $_r = array();
     $data = array();
     $r = '';
     $available_fields = $this->get_list_of_available_fields();
     foreach ($q as $row) {
         setup_regis_details($row->ID);
         $regis_data = maybe_unserialize($row->meta_value);
         $regis_id = $regis_data['_regis_id'];
         if ($filter_event_id && !isset($regis_data[$regis_id]['_events'][$filter_event_id])) {
             continue;
         }
         $event_id = $filter_event_id;
         setup_event_details($filter_event_id);
         $form_data = maybe_unserialize($regis_data[$regis_id]['_attendee_info']);
         $first_name = $this->get_attendee_form_value('ticket_buyer', 'first_name', $form_data, true);
         $last_name = $this->get_attendee_form_value('ticket_buyer', 'last_name', $form_data);
         $email = $this->get_attendee_form_value('ticket_buyer', 'email', $form_data);
         $found = false;
         switch ($lookup) {
             case stripos($first_name, $lookup) !== false:
                 $found = true;
                 break;
             case stripos($last_name, $lookup) !== false:
                 $found = true;
                 break;
             case stripos($email, $lookup) !== false:
                 $found = true;
                 break;
         }
         //if (!$found) continue;
         $t = $this->get_purchased_tickets($regis_id, $event_id);
         $data['r'] = array('regis_date' => $row->post_date, 'regis_post_id' => $row->ID, 'event_id' => $event_id, 'regis_id' => $regis_id, 'first_name' => $first_name, 'last_name' => $last_name, 'email' => $email, 'form_data' => $form_data, 'available_fields' => $available_fields, 'tickets' => $t, 'regis_status' => get_the_regis_status(), 'regis_user_id' => $regis_details['_epl_regis_user_id']);
         $r .= $this->epl->load_view('admin/user-regis-manager/regis-name-lookup-result-rows', $data, true);
     }
     $data['r'] = $r;
     $r = $this->epl->load_view('admin/user-regis-manager/regis-name-lookup-result-response', $data, true);
     return $r;
     return $this->epl_util->epl_response(array('html' => $r));
 }