<?php 
$wp_customize->add_section( 'roland_achivements_section', array(
	'capability'            => 'edit_theme_options',
	'priority'              => 4,
	'title'                 => __( 'Our Achivements', 'roland' ),
	'description'           => __( 'Our Achivements section', 'roland' ),
	'panel'                 => 'roland_front_option'
) );

// Enable Achivement Section
$wp_customize->add_setting( 'roland_achivements_enable',
  array(
    'default'           => '',
    'sanitize_callback'     => 'roland_sanitize_checkbox'
  )
);

$wp_customize->add_control( 'roland_achivements_enable',
  array(
    'label'         => esc_html__( 'Show Achivement Section', 'roland' ),
    'section'       => 'roland_achivements_section',
    'type'          => 'checkbox',
    'priority'      => 1,
  )
);


// Add Image
$wp_customize->add_setting('roland_achv_image', array(
    'transport'         => 'refresh',
    'width'         => 1200,
    'height'         => 385,
	'sanitize_callback'     => 'roland_sanitize_image'
));

$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'roland_achv_image', array(
    'label'             => __('Upload achivement image', 'roland'),
    'section'           => 'roland_achivements_section',
    'settings'          => 'roland_achv_image',
)));    


//	CTA Title
$wp_customize->add_setting( 'roland_achive_title', array(
    'capability'            => 'edit_theme_options',
    'default'               => '',
    'sanitize_callback'     => 'sanitize_text_field'
) );

$wp_customize->add_control( 'roland_achive_title', array(
    'label'                 =>  __( 'Achivement Title Line 1', 'roland' ),
    'section'               => 'roland_achivements_section',
    'type'                  => 'text',
    'settings'              => 'roland_achive_title',
) );

//	CTA Content
$wp_customize->add_setting( 'roland_achive_title_two', array(
    'capability'            => 'edit_theme_options',
    'default'               => '',
    'sanitize_callback'     => 'sanitize_text_field'
) );

$wp_customize->add_control( 'roland_achive_title_two', array(
    'label'                 =>  __( 'Achivement Title Line 2', 'roland' ),
    'section'               => 'roland_achivements_section',
    'type'                  => 'text',
    'settings'              => 'roland_achive_title_two',
) );


// Counter Foreach
$roland_counter_icon_arrays =  array(
	'1'=>'icofont-ui-handicapped', '2'=>'icofont-doctor', '3'=>'icofont-calendar', '4'=>'icofont-badge'	
);
foreach($roland_counter_icon_arrays as $roland_key => $roland_counter_icon){


$wp_customize->add_setting( 'roland_counter_icon_'.$roland_key, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'sanitize_text_field'
) );

$wp_customize->add_control( 'roland_counter_icon_'.$roland_key, array(
	/* translators: %s: Description */ 
    'label'                 =>   sprintf( __( 'Type Achivement Icon %s', 'roland' ), $roland_key ),
    'section'               => 'roland_achivements_section',
    'type'                  => 'text',
    'settings' => 'roland_counter_icon_'.$roland_key,
	'description'           => sprintf( __( 'For team icon,  You can use font awesome icon: Eg: %1$s. %2$s See more here %3$s', 'roland' ), $roland_counter_icon,'<a href="'.esc_url('https://icofont.com/icons').'">','</a>'),
) );

$wp_customize->add_setting( 'roland_counter_'.$roland_key, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'sanitize_text_field'
) );
$wp_customize->add_control( 'roland_counter_'.$roland_key, array(
	/* translators: %s: Description */ 
    'label'                 =>   sprintf( __( 'Achivement number %s', 'roland' ), $roland_key ),
    'section'               => 'roland_achivements_section',
    'type'                  => 'text',
    'settings' => 'roland_counter_'.$roland_key,
) );

$wp_customize->add_setting( 'roland_counter_field_'.$roland_key, array(
	    'capability'            => 'edit_theme_options',
	    'default'               => '',
	    'sanitize_callback'     => 'sanitize_text_field'
) );

$wp_customize->add_control( 'roland_counter_field_'.$roland_key, array(
	/* translators: %s: Description */ 
    'label'                 =>   sprintf( __( 'Achivement value %s', 'roland' ), $roland_key ),
    'section'               => 'roland_achivements_section',
    'type'                  => 'text',
    'settings' => 'roland_counter_field_'.$roland_key,
) );

}