<?php

use WpBookingEvent\Factory;
use WpBookingEvent\Filesystem\Folder;
use WpBookingEvent\Html\WpBookingEventHtmlBackend as WpBookingEventHtmlBackendAlias;

WpBookingEventHtmlBackendAlias::load_jquery_library('icheck');
WpBookingEventHtmlBackendAlias::load_jquery_library('loading_js');

$list_folder_payment_path = WPBOOKINGEVENT_PATH_ROOT . "/lib/payments";
$folders = Folder::folders($list_folder_payment_path);
?>
<div id="view-payment-block" class="view-payment-form">
    <form action="" method="post" name="admin-form" enctype="multipart/form-data">
        <div class="form-select-payment">
            <div class="form-input-info-header">
                <h4 class="modal-title"><?php esc_attr_e('List payments','wpbookingevent') ?></h4>
            </div>
            <div class="form-input-info-body">
                <ul class="list-folder-payment">
                    <?php foreach ($folders as $folder) { ?>
                        <li>
                            <input type="radio" name="payment" id="<?php esc_html_e($folder) ?>" value="<?php esc_html_e($folder) ?>" />
                            <label for="<?php esc_html_e($folder) ?>"><?php esc_html_e($folder) ?></label>
                        </li>
                    <?php } ?>
                </ul>
            </div>
            <div class="form-input-info-footer">
                <button type="submit" class="btn btn-primary btn-payment-modal-now"><?php esc_attr_e('Submit','wpbookingevent') ?></span></button>
            </div>
        </div>
        <input type="hidden" name="task" value="payment.ajax_create_payment_by_payment_name">
    </form>
</div>
<?php
$doc = Factory::getDocument();
$doc->addLessStyleSheet('admin/app/assets/less/view_payment_form.less');
$doc->addScriptApplySelector('.view-payment-form', 'view_form_payment', array(
), "admin/app/assets/js/view_form_payment.js");
