📋

order_lists(); ?>
';print_r($filter_args);echo ''; $count_foot_left_col = 5; $count_foot_right_col = 3; $now = current_time('Y-m-d H:i:s'); ?>
$status) { ?>

0 ? wp_kses_post(wc_price($rent)) : esc_html__('FREE', 'abp-rentalforge'); ?> 0 ? wp_kses_post(wc_price($ex_price)) : esc_html__('FREE', 'abp-rentalforge'); ?> 0 ? wp_kses_post(wc_price($deposit)) : esc_html__('FREE', 'abp-rentalforge'); ?> 0 ? wp_kses_post(wc_price($total_price)) : esc_html__('FREE', 'abp-rentalforge'); ?>

= 3) { ?>

0) ? wp_kses_post(wc_price($total_rent)) : esc_html__('FREE', 'abp-rentalforge'); ?> 0) ? wp_kses_post(wc_price($total_additional)) : esc_html__('FREE', 'abp-rentalforge'); ?> 0) ? wp_kses_post(wc_price($total_deposit)) : esc_html__('FREE', 'abp-rentalforge'); ?> 0) ? wp_kses_post(wc_price($total_sale)) : esc_html__('FREE', 'abp-rentalforge'); ?>
$limit, 'page_number' => $page_number, 'total' => $total_order, 'style' => 'ajax']); ?>
'', 'msg' => __('Invalid security token.', 'abp-rentalforge')], 403); } if (!current_user_can('manage_options')) { wp_send_json_error(['html' => '', 'msg' => __('Insufficient permissions.', 'abp-rentalforge')], 403); } ob_start(); $filter_args = isset($_POST) ? array_map('sanitize_text_field', wp_unslash($_POST)) : []; $limit = isset($filter_args['page_item']) ? (int)$filter_args['page_item'] : 20; $data_limit = (int)ABPRF_Function::get_option('abprf_per_page_item', 20); $filter_args['page_item'] = $limit > 0 ? $limit : $data_limit; if ($limit > 0 && $data_limit !== $limit) { update_option('abprf_per_page_item', $limit); } $this->order_lists($filter_args); $html = ob_get_clean(); wp_send_json_success(['html' => $html, 'msg' => esc_html__('Order Loaded Successfully !', 'abp-rentalforge')]); } public function item_cancel(): void { if (!check_ajax_referer('abprf_admin_ajax_nonce', 'nonce', false)) { wp_send_json_error(['html' => '', 'msg' => __('Invalid security token.', 'abp-rentalforge')], 403); } if (!current_user_can('manage_options')) { wp_send_json_error(['html' => '', 'msg' => __('Insufficient permissions.', 'abp-rentalforge')], 403); } $item_id = isset($_POST['item_id']) ? sanitize_text_field(wp_unslash($_POST['item_id'])) : ''; if (!empty($item_id)) { global $wpdb; $table_name = $wpdb->prefix . 'abprf_orders'; $booking_lists = ABPRF_Query::get_booking_query(['item_id' => $item_id]); if (!empty($booking_lists) && is_array($booking_lists)) { $value = current($booking_lists); $others = $value['others'] ?? ''; if (!empty($others)) { $others = json_decode($others, true) ?: []; $user_id = get_current_user_id(); $others['cancel_by'] = $user_id; $data = [ 'others' => wp_json_encode($others), 'book_status' => 5, 'order_status' => 'wc-cancelled', 'updated_at' => current_time('Y-m-d H:i:s') ]; $where = ['item_id' => (int)$item_id]; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $wpdb->update($table_name, $data, $where, ['%s', '%s', '%s'], ['%d']); } } wp_send_json_success(['html' => '', 'msg' => esc_html__('Deleted Successfully !', 'abp-rentalforge')]); } wp_send_json_error(['html' => '', 'msg' => esc_html__('Something Error Occurred !', 'abp-rentalforge')]); } } new ABPRF_Orders(); }