<?php

use WpBookingHotel\Factory;
use WpBookingHotel\Filesystem\Folder;
use WpBookingHotel\Html\WpBookingHotelHtmlWooPanel as WpBookingHotelHtmlWooPanelAlias;
use WpBookingHotel\Utilities\Utility;

WpBookingHotelHtmlWooPanelAlias::load_jquery_library('icheck');
WpBookingHotelHtmlWooPanelAlias::load_jquery_library('loading_js');
WpBookingHotelHtmlWooPanelAlias::load_jquery_library('confirm');
WpBookingHotelHtmlWooPanelAlias::load_jquery_library('validate');

$list_folder_payment_path = WPBOOKINGHOTEL_PATH_ROOT . "/lib/payments";
$folders = Folder::folders($list_folder_payment_path);
?>
<div id="view-payment-block" class="view-payment-form">
    <div class="block-alert"></div>
    <form action="" method="post" name="admin_woopanel-form" enctype="multipart/form-data">
        <div class="form-select-payment">
            <div class="form-input-info-header">
                <h4 class="modal-title"><?php esc_html_e('List payments','wpbookinghotel') ?></h4>
            </div>
            <div class="form-input-info-body">
                <ul class="list-folder-payment">
                    <?php foreach ($folders as $folder) { ?>
                        <li>
                            <input type="radio" name="radio-select" id="<?php echo (esc_attr($folder)) ?>" value="<?php echo (esc_attr($folder)) ?>" />
                            <label for="<?php echo (esc_attr($folder)) ?>"><?php echo (esc_html($folder)) ?></label>
                        </li>
                    <?php } ?>
                </ul>
            </div>
            <div class="form-input-info-footer">
                <a href="<?php echo(Utility::getBackendWooPanelGoToLink("payment.list")) ?>" class="btn-cancel" ><?php esc_attr_e('Cancel','wpbookinghotel')?></a>
                <button type="submit" class="btn btn-primary btn-payment-modal-now"><?php esc_html_e('Submit','wpbookinghotel') ?></span></button>
            </div>
        </div>
        <input type="hidden" name="payment">
        <input type="hidden" name="task" value="payment.ajax_create_payment_by_payment_name">
    </form>
</div>
<?php
$doc = Factory::getDocument();
$doc->addLessStyleSheet('admin_woopanel/app/assets/less/view_payment_form.less');
$doc->addStyleSheet('frontend/app/assets/nb-font-icon/nb-font-icon.css');
$doc->addScriptApplySelector('.view-payment-form', 'view_form_payment', array(
), "admin_woopanel/app/assets/js/view_form_payment.js");
