<?php
defined( 'ABSPATH' ) || exit( 'No Access!' );

$popup_image = $options->get_option( 'popup-image' );
$top_image = $options->get_option( 'top-image' );
?>
<div class="irk-settings-area irk-settings-ads">
    <h2 class="irk-settings-title">
        <span class="irk-title-icon"><span uk-icon="bell"></span></span>
        <strong><?php _e( 'Advertisement', 'irk' ); ?></strong>
    </h2>
    <div class="uk-margin">
        <label class="uk-form-label"><?php _e( 'PopUp advertisement', 'irk' ); ?></label>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="popup-ads" value="1" <?php echo checked( $options->get_option( 'popup-ads' ), 1 ); ?>>
				<?php _e( 'Active', 'irk' ); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <div class="irk-upload-file-wrapper">
                <img src="<?php echo intval($popup_image) ? wp_get_attachment_url( $popup_image ) : IRK_IMG_URI.'dot.png'; ?>" class="irk-image" alt="image">
                <input type="hidden" name="popup-image" value="<?php echo esc_attr( $popup_image ); ?>">
                <br>
                <button class="uk-button uk-button-primary irk-upload-file"><?php _e('Select image', 'irk'); ?></button>
                <button class="uk-button uk-button-default irk-remove" data-default="<?php echo IRK_IMG_URI.'dot.png'; ?>"><?php _e('Remove image', 'irk'); ?></button>
            </div>
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="popup-url" value="<?php echo esc_attr( $options->get_option( 'popup-url' ) ); ?>" placeholder="<?php _e( 'URL', 'irk' ); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="popup-xfn" value="<?php echo esc_attr( $options->get_option( 'popup-xfn' ) ); ?>" placeholder="<?php _e( 'XFN', 'irk' ); ?>">
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="popup-target" value="1" <?php echo checked( $options->get_option( 'popup-target' ), 1 ); ?>>
				<?php _e( 'Open link in new tab', 'irk' ); ?>
            </label>
        </div>
        <div class="irk-description">
            <span uk-icon="info"></span>
			<?php _e( 'Show once for each user every 24 hours.', 'irk' ); ?>
        </div>
    </div>
    <div class="uk-margin">
        <label class="uk-form-label"><?php _e( 'Top advertisement', 'irk' ); ?></label>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="top-ads" value="1" <?php echo checked( $options->get_option( 'top-ads' ), 1 ); ?>>
				<?php _e( 'Active', 'irk' ); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <div class="irk-upload-file-wrapper">
                <img src="<?php echo intval($top_image) ? wp_get_attachment_url( $top_image ) : IRK_IMG_URI.'dot.png'; ?>" class="irk-image" alt="image">
                <input type="hidden" name="top-image" value="<?php echo esc_attr( $top_image ); ?>">
                <br>
                <button class="uk-button uk-button-primary irk-upload-file"><?php _e('Select image', 'irk'); ?></button>
                <button class="uk-button uk-button-default irk-remove" data-default="<?php echo IRK_IMG_URI.'dot.png'; ?>"><?php _e('Remove image', 'irk'); ?></button>
            </div>
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="top-url" value="<?php echo esc_attr( $options->get_option( 'top-url' ) ); ?>" placeholder="<?php _e( 'URL', 'irk' ); ?>">
        </div>
        <div class="uk-margin-small">
            <input type="text" class="uk-input" name="top-xfn" value="<?php echo esc_attr( $options->get_option( 'top-xfn' ) ); ?>" placeholder="<?php _e( 'XFN', 'irk' ); ?>">
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="top-target" value="1" <?php echo checked( $options->get_option( 'top-target' ), 1 ); ?>>
				<?php _e( 'Open link in new tab', 'irk' ); ?>
            </label>
        </div>
    </div>
</div>