<?php

/**
 * @var array $fields
 * @var string $rule_id
 * @var string $action
 */
?>
<div id="koin-installment-rule" class="koin-general-settings koin-installment-rule">
    <a href="<?php echo $product_id ? get_edit_post_link($product_id, '') : 'admin.php?page=wc-koin-official-installments'; ?>">
        &larr;
    </a>
    <form action="admin.php?page=wc-koin-official-installments" method="POST">
        <input type="hidden" name="page" value="wc-koin-official-settings">
        <input type="hidden" name="action" value="<?php echo esc_attr($action); ?>">
        <?php if (isset($product_id)): ?>
            <input type="hidden" name="product_id" value="<?php echo esc_attr($product_id); ?>">
        <?php endif; ?>
        <input type="hidden" name="rule_id" value="<?php echo esc_attr($rule_id); ?>">
        <?php wp_nonce_field('save_koin_settings', 'koin_settings_nonce'); ?>
        <?php woocommerce_admin_fields($fields); ?>
        <?php submit_button(__('Save Changes', 'wc-koin-official')); ?>
    </form>
</div>
