<?php
/*
Theme Designed By: S O R O U S H M A R K E T
Email: info@soroushmarket.ir
Demo Website: soroushmarket.ir
Author Website: soroushmarket.ir
*/
   // 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 style="background-position: -7px -10px"></div></li>
   
   	<li class="b-img"><div style="background-position: -10px -70px"></div></li>
   
   	<li class="b-img"><div style="background-position: -6px -130px"></div></li>
   
   	<li class="b-img"><div style="background-position: -4px -190px"></div></li>
   
   	<li class="b-img"><div style="background-position: -7px -250px"></div></li>
   
   	<li class="b-img"><div style="background-position: -10px -310px"></div></li>
   
   	<li class="b-img"><div style="background-position: -10px -369px"></div></li>
   
   	<li class="b-img"><div style="background-position: -10px -428px"></div></li>
   
   	<li class="b-img"><div style="background-position: -10px -486px"></div></li>
   
   	<li class="b-img"><div style="background-position: -8px -545px"></div></li>
   
   	<li class="b-img"><div style="background-position: -10px -600px"></div></li>
   
   	<li class="b-img"><div style="background-position: -10px -658px"></div></li>
   
   	<li class="b-img"><div style="background-position: -6px -718px"></div></li>
   
   	<li class="b-img"><div style="background-position: -8px -777px"></div></li>
   
   	<li class="b-img"><div style="background-position: -10px -837px"></div></li>
   
   	<li class="b-img"><div style="background-position: -8px -895px"></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' );?>