Website : phonehp.ir
backdoor
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Home
Console
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
nehpir
/
public_html
/
wp-content
/
plugins
/
woocommersa
/
includes
/
API
/
Filename :
HistoryController.php
back
Warning
: Undefined variable $file in
/home/nehpir/public_html/goods.php
on line
545
Copy
<?php namespace WooCommersa\API; if (!defined('ABSPATH')) exit; use WooCommersa\Repositories\HistoryRepository; class HistoryController extends BaseController { private $repository; public function __construct() { $this->repository = new HistoryRepository(); add_action('rest_api_init', [$this, 'register_routes']); } public function register_routes() { register_rest_route($this->namespace, '/history', [ 'methods' => 'GET', 'callback' => [$this, 'get_history'], 'permission_callback' => [$this, 'permissions_check'], ]); register_rest_route($this->namespace, '/history/rollback', [ 'methods' => 'POST', 'callback' => [$this, 'rollback_batch'], 'permission_callback' => [$this, 'permissions_check'], ]); } public function get_history($request) { $params = $request->get_params(); $data = $this->repository->get_history($params); return new \WP_REST_Response([ 'success' => true, 'data' => $data ], 200); } public function rollback_batch($request) { $batch_id = sanitize_text_field($request['batch_id']); $success = $this->repository->rollback($batch_id); if ($success) { return new \WP_REST_Response([ 'success' => true, 'message' => __('عملیات بازگشت با موفقیت انجام شد.', 'woocommersa') ], 200); } else { return new \WP_REST_Response([ 'success' => false, 'message' => __('خطا در انجام عملیات بازگشت یا شناسه معتبر نیست.', 'woocommersa') ], 400); } } }