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

$checkout_style = $options->get_option('checkout-style');
$optional = $options->get_option('checkout-optional');
$optional = $optional ? $optional : [];
$disabled = $options->get_option('checkout-disabled');
$disabled = $disabled ? $disabled : [];
?>
<div class="irk-settings-area irk-settings-checkout">
    <h2 class="irk-settings-title">
        <span class="irk-title-icon"><span uk-icon="credit-card"></span></span>
        <strong><?php _e('Checkout', 'irk'); ?></strong>
    </h2>
    <div class="uk-margin">
        <label class="uk-form-label"><?php _e('Checkout style', 'irk'); ?></label>
        <div class="uk-margin-small">
            <label>
                <input class="uk-radio" type="radio" name="checkout-style" value="default" <?php checked($checkout_style, 'default'); ?>>
                <?php _e('Default', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-radio" type="radio" name="checkout-style" value="custom" <?php checked($checkout_style, 'custom'); ?>>
                <?php _e('Checkout custom style', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-radio" type="radio" name="checkout-style" value="multistep" <?php checked($checkout_style, 'multistep'); ?>>
                <?php _e('Multistep Checkout', 'irk'); ?>
            </label>
        </div>
    </div>
    <div class="uk-margin">
        <label class="uk-form-label"><?php _e('Optional fields', 'irk'); ?></label>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-optional[first-name]" value="1" <?php echo array_key_exists('first-name', $optional) ? 'checked' : null; ?>>
                <?php _e('First name', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-optional[last-name]" value="1" <?php echo array_key_exists('last-name', $optional) ? 'checked' : null; ?>>
                <?php _e('Last name', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-optional[company]" value="1" <?php echo array_key_exists('company', $optional) ? 'checked' : null; ?>>
                <?php _e('Company', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-optional[country]" value="1" <?php echo array_key_exists('country', $optional) ? 'checked' : null; ?>>
                <?php _e('Country', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-optional[address-1]" value="1" <?php echo array_key_exists('address-1', $optional) ? 'checked' : null; ?>>
                <?php _e('Address 1', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-optional[address-2]" value="1" <?php echo array_key_exists('address-2', $optional) ? 'checked' : null; ?>>
                <?php _e('Address 2', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-optional[city]" value="1" <?php echo array_key_exists('city', $optional) ? 'checked' : null; ?>>
                <?php _e('City', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-optional[state]" value="1" <?php echo array_key_exists('state', $optional) ? 'checked' : null; ?>>
                <?php _e('State', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-optional[postcode]" value="1" <?php echo array_key_exists('postcode', $optional) ? 'checked' : null; ?>>
                <?php _e('Postcode', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-optional[phone]" value="1" <?php echo array_key_exists('phone', $optional) ? 'checked' : null; ?>>
                <?php _e('Phone', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-optional[email]" value="1" <?php echo array_key_exists('email', $optional) ? 'checked' : null; ?>>
                <?php _e('Email', 'irk'); ?>
            </label>
        </div>
    </div>
    <div class="uk-margin">
        <label class="uk-form-label"><?php _e('Disabled fields', 'irk'); ?></label>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-disabled[first-name]" value="1" <?php echo array_key_exists('first-name', $disabled) ? 'checked' : null; ?>>
                <?php _e('First name', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-disabled[last-name]" value="1" <?php echo array_key_exists('last-name', $disabled) ? 'checked' : null; ?>>
                <?php _e('Last name', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-disabled[company]" value="1" <?php echo array_key_exists('company', $disabled) ? 'checked' : null; ?>>
                <?php _e('Company', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-disabled[country]" value="1" <?php echo array_key_exists('country', $disabled) ? 'checked' : null; ?>>
                <?php _e('Country', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-disabled[address-1]" value="1" <?php echo array_key_exists('address-1', $disabled) ? 'checked' : null; ?>>
                <?php _e('Address 1', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-disabled[address-2]" value="1" <?php echo array_key_exists('address-2', $disabled) ? 'checked' : null; ?>>
                <?php _e('Address 2', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-disabled[city]" value="1" <?php echo array_key_exists('city', $disabled) ? 'checked' : null; ?>>
                <?php _e('City', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-disabled[state]" value="1" <?php echo array_key_exists('state', $disabled) ? 'checked' : null; ?>>
                <?php _e('State', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-disabled[postcode]" value="1" <?php echo array_key_exists('postcode', $disabled) ? 'checked' : null; ?>>
                <?php _e('Postcode', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-disabled[phone]" value="1" <?php echo array_key_exists('phone', $disabled) ? 'checked' : null; ?>>
                <?php _e('Phone', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-disabled[email]" value="1" <?php echo array_key_exists('email', $disabled) ? 'checked' : null; ?>>
                <?php _e('Email', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="checkout-disabled[note]" value="1" <?php echo array_key_exists('note', $disabled) ? 'checked' : null; ?>>
                <?php _e('Note', 'irk'); ?>
            </label>
        </div>
    </div>
    <div class="uk-margin">
        <label class="uk-form-label"><?php _e('Cart', 'irk'); ?></label>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="cart-discount" value="1" <?php checked($options->get_option('cart-discount'), 1); ?>>
                <?php _e('Discount amount in cart', 'irk'); ?>
            </label>
        </div>
        <div class="uk-margin-small">
            <label>
                <input class="uk-checkbox" type="checkbox" name="next-shopping" value="1" <?php checked($options->get_option('next-shopping'), 1); ?>>
                <?php _e('Next shopping list', 'irk'); ?>
            </label>
        </div>
    </div>
</div>