Example #1
0
 private function previewForm()
 {
     require_once WPBDP_PATH . 'core/view-submit-listing.php';
     if (wpbdp()->has_module('featuredlevels')) {
         wpbdp_admin()->messages[] = _x('This is a preview of the form as it will appear during "Submit a Listing". The users may not see all fields from "Manage Form Fields" because you have "Featured Levels" active and this is showing the base level.', 'formfields-preview', 'WPBDM');
     }
     $html = '';
     $html .= wpbdp_admin_header(_x('Form Preview', 'form-fields admin', 'WPBDM'), 'formfields-preview', array(array(_x('← Return to "Manage Form Fields"', 'form-fields admin', 'WPBDM'), esc_url(remove_query_arg('action')))));
     $html .= wpbdp_admin_notices();
     $controller = new WPBDP_Submit_Listing_Page(0, true);
     $html .= $controller->preview_listing_fields_form();
     $html .= wpbdp_admin_footer();
     echo $html;
 }
Example #2
0
 public function dispatch()
 {
     global $wpdb;
     $api = wpbdp_payments_api();
     switch (wpbdp_getv($_REQUEST, 'action')) {
         case 'approve':
             if ($trans = $api->get_transaction($_GET['id'])) {
                 $trans->processed_on = current_time('mysql');
                 $trans->processed_by = 'admin';
                 $trans->status = 'approved';
                 $api->save_transaction($trans);
             }
             wpbdp_admin()->messages[] = _x('The transaction has been approved.', 'admin', 'WPBDM');
             break;
         case 'reject':
             if ($trans = $api->get_transaction($_GET['id'])) {
                 $trans->processed_on = current_time('mysql');
                 $trans->processed_by = 'admin';
                 $trans->status = 'rejected';
                 $api->save_transaction($trans);
             }
             wpbdp_admin()->messages[] = _x('The transaction has been rejected.', 'admin', 'WPBDM');
             break;
         case 'delete':
             $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->prefix}wpbdp_payments WHERE id = %d", $_GET['id']));
             wpbdp_admin()->messages[] = _x('The transaction has been deleted.', 'admin', 'WPBDM');
             break;
         default:
             break;
     }
     $_SERVER['REQUEST_URI'] = remove_query_arg(array('action', 'id'), $_SERVER['REQUEST_URI']);
     $this->clear_transactions();
     $this->transactions_table();
 }