403Webshell
Server IP : 62.60.133.156  /  Your IP : 216.73.217.51
Web Server : LiteSpeed
System : Linux linux24.centraldnserver.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64
User : mimradmin ( 1166)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : OFF |  Pkexec : OFF
Directory :  /home/mimradmin/www/wp-content/plugins/persian-woocommerce-shipping/includes/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/mimradmin/www/wp-content/plugins/persian-woocommerce-shipping/includes/class-ajax.php
<?php
/**
 * Developer : MahdiY
 * Web Site  : MahdiY.IR
 * E-Mail    : M@hdiY.IR
 */

defined( 'ABSPATH' ) || exit;

class PWS_Ajax {

	public static function load_cities_callback() {

		if ( ! isset( $_POST['state_id'] ) ) {
			die();
		}

		$state_id = absint( $_POST['state_id'] );

		if ( ! $state_id ) {
			die();
		}

		$cities = PWS()::cities( $state_id );

		$type = isset( $_POST['type'] ) && $_POST['type'] == 'billing' ? 'billing' : 'shipping';

		$term_id = WC()->checkout()->get_value( $type . '_city' );

		if ( intval( $term_id ) == 0 ) {
			$term_id = apply_filters( 'pws_default_city', 0, $type, $state_id );
		}

		printf( "<option value='0'>لطفا شهر خود را انتخاب نمایید </option>" );

		foreach ( $cities as $id => $name ) {
			printf( "<option value='%d' %s>%s</option>", $id, selected( $term_id, $id, false ), $name );
		}

		die();
	}

	public static function load_districts_callback() {

		if ( PWS_Tapin::is_enable() ) {
			die( apply_filters( 'pws_tapin_load_districts', '' ) );
		}

		if ( ! isset( $_POST['city_id'] ) ) {
			die();
		}

		$city_id = absint( $_POST['city_id'] );

		if ( ! $city_id ) {
			die();
		}

		$cities = get_terms( [
			'taxonomy'   => 'state_city',
			'hide_empty' => false,
			'child_of'   => $city_id,
		] );

		if ( is_wp_error( $cities ) ) {
			die();
		}

		$cities = apply_filters( 'pws_districts', $cities, $city_id );

		$type = isset( $_POST['type'] ) && $_POST['type'] == 'billing' ? 'billing' : 'shipping';

		$term_id = WC()->session->get( $type . '_district', 0 );

		if ( intval( $term_id ) == 0 ) {
			$term_id = apply_filters( 'pws_default_district', $city_id, $type, $city_id );
		}

		if ( count( $cities ) ) {
			printf( "<option value='0'>لطفا محله خود را انتخاب نمایید</option>" );
		}

		foreach ( $cities as $city ) {
			$indent = str_repeat( "- ", count( get_ancestors( $city->term_id, 'state_city' ) ) - 2 );
			printf( "<option value='%d' %s>%s</option>", $city->term_id, selected( $term_id, $city->term_id, false ), $indent . $city->name );
		}

		die();
	}

}

Youez - 2016 - github.com/yon3zu