seat_type($post_infos); } else { $this->ticket_type($post_infos); } ?>
__('Invalid security token or Insufficient permissions.', 'abp-transport-booking'), 'type' => 'warn'], 403); } $post_val = fn($key, $default = '') => isset($_POST[$key]) ? sanitize_text_field(wp_unslash($_POST[$key])) : $default; $post_int = fn($key, $default = 0) => isset($_POST[$key]) ? absint($_POST[$key]) : $default; $post_id = $post_int('post_id'); $seat_type = $post_val('type'); $post_infos = ABPTB_Function::get_all_meta($post_id); $post_infos['display_ticket_type'] = $post_val('display_ticket_type'); ob_start(); if ($seat_type == 'sp') { $this->seat_type($post_infos); } else { $this->ticket_type($post_infos); } $html = ob_get_clean(); wp_send_json_success(['html' => $html, 'msg' => __('Ticket Type Switched Successfully...!', 'abp-transport-booking'), 'type' => 'success']); } public function seat_type($post_infos): void { $sp_infos = $post_infos['sp_infos'] ?? []; $display_ticket_type = $post_infos['display_ticket_type'] ?? 'on'; $display_ticket_type = ABPTB_Function::on_off('ticket_type') ? $display_ticket_type : 'off'; $sp_data = ABPTB_Query::get_sp(); $post_id = $post_infos['post_id'] ?? ''; //echo '
';print_r($sp_infos);echo '
'; ?>
sp_item($sp_data, $display_ticket_type, $ticket_info); } } else { $this->sp_item($sp_data, $display_ticket_type); } ?>
*
sp_item($sp_data, $display_ticket_type); ?>
ticket_item($ticket_infos[$key], $key); } else { foreach ($ticket_infos as $key => $ticket_info) { $this->ticket_item($ticket_info, $key); } } } else { $this->ticket_item(); } ?>
* *
ticket_item(); ?>