<?php
/*
Theme Designed By: Meysam Hosseinkhani
Email: Meysam98@Gmail.com
Author Website: Hosseinkhani.ir
*/
   // Exit if accessed directly
   if (!defined('ABSPATH')) {
    exit;
}
if ( ! class_exists( 'Az_Prot_Me' ) ) {
   require_once AZ_DIR . '/includes/widget-icon/az-prot.class.php';
   }
    
    function edd_az() {
     $whitelist = array(
    '127.0.0.1',
    '::1'
    );
    $whiteblist = str_replace( '*', '', 'a*z*i*n*w*o*o.*e*l*m*f*i*l*e*.*i*r*' );
    $whiteclist = str_replace( '*', '', 'a*z*i*n.*e*l*m*f*i*l*e*.*i*r*' );
    $localhost = false;
    if(in_array($_SERVER['REMOTE_ADDR'], $whitelist) || ($_SERVER['HTTP_HOST'] === $whiteblist) || ($_SERVER['HTTP_HOST'] === $whiteclist)){
        $localhost = true;
    }
    else { $localhost = false; }
    if( Az_Prot_Me::is_activated() === false && $localhost === false ) {
     die();
    }
    }
// Creating the widget
   class epay_widget extends WP_Widget {
   
   function __construct() {
   
   parent::__construct(
   
   // Base ID of your widget
   
   'epay_widget',
   
    
   
   // Widget name will appear in UI
   
   __('پرداخت آنلاین (آذین فایل)', 'epay'),
   
    
   
   // Widget description
   
   array( 'description' => __( 'نمایش لوگو بانک های عضو شتاب', 'epay' ), )
   
   );
   
   }
   
    
   
   // Creating widget front-end
   
   // This is where the action happens
   
   public function widget( $args, $instance ) {
   
   $title = apply_filters( 'widget_title', $instance['title'] );
   
   // before and after widget arguments are defined by themes
   
   echo $args['before_widget'];
   
   if ( ! empty( $title ) )
   
   echo $args['before_title'] . $title . $args['after_title'];
   
    
   
   // This is where you run the code and display the output
   
   $idir=get_template_directory_uri().'/images/';
   
   echo '<div class="b-ul">
   
   <ul>
   
   	<li class="b-img"><div class="b1"></div></li>
   
   	<li class="b-img"><div class="b2"></div></li>
   
   	<li class="b-img"><div class="b3"></div></li>
   
   	<li class="b-img"><div class="b4"></div></li>
   
   	<li class="b-img"><div class="b5"></div></li>
   
   	<li class="b-img"><div class="b6"></div></li>
   
   	<li class="b-img"><div class="b7"></div></li>
   
   	<li class="b-img"><div class="b8"></div></li>
   
   	<li class="b-img"><div class="b9"></div></li>
   
   	<li class="b-img"><div class="b10"></div></li>
   
   	<li class="b-img"><div class="b11"></div></li>
   
   	<li class="b-img"><div class="b12"></div></li>
   
   	<li class="b-img"><div class="b13"></div></li>
   
   	<li class="b-img"><div class="b14"></div></li>
   
   	<li class="b-img"><div class="b15"></div></li>
   
   	<li class="b-img"><div class="b16"></div></li>
   
   </ul></div>';
   
   echo $args['after_widget'];
   
   }
   
    
   
   // Widget Backend
   
   public function form( $instance ) {
   
   if ( isset( $instance[ 'title' ] ) ) {
   
   $title = $instance[ 'title' ];
   
   }
   
   else {
   
   $title = __( 'پرداخت آنلاین', 'epay' );
   
   }
   
   // Widget admin form
   
   ?>
<p>
   <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
   <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
</p>
<?php
   }
   
    
   
   // Updating widget replacing old instances with new
   
   public function update( $new_instance, $old_instance ) {
   
   $instance = array();
   
   $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
   
   return $instance;
   
   }
   
   } // Class wpb_widget ends here
   
    
   
   // Register and load the widget
   
   function epay_load_widget() {
   
   register_widget( 'epay_widget' );
   
   }
   
   add_action( 'widgets_init', 'epay_load_widget' );   