<?php

use WpBookingEvent\Factory as FactoryAlias;
use WpBookingEvent\Html\ToolBar;
use WpBookingEvent\Html\WpBookingEventHtmlBackend as WpBookingEventHtmlBackendAlias;
use WpBookingEvent\Utilities\Utility as UtilityAlias;

$doc = FactoryAlias::getDocument();
WpBookingEventHtmlBackendAlias::load_jquery_library('icheck');
ToolBar::setTitle("List Event");
WpBookingEventHtmlBackendAlias::load_jquery_library('datatables');
?>
<?php ?>
    <form action="<?php echo(UtilityAlias::getBackendGoToLink("event.form")) ?>" name="admin-form" method="post">
        <div class="view-list-event">
            <table id="example" class="display table">
                <thead>
                    <tr>
                        <th class="nowrap"></th>
                        <th class="nowrap"><?php esc_attr_e('Name','wpbookingevent') ?></th>
                        <th class="nowrap"><?php esc_attr_e('Total order','wpbookingevent') ?></th>
                        <th class="hidden-md-up nowrap"><?php esc_attr_e('Min max', 'wpbookingevent') ?></th>
                        <th class="nowrap"><?php esc_attr_e('Booking opens','wpbookingevent') ?> </th>
                        <th class="nowrap"><?php esc_attr_e('Booking close','wpbookingevent') ?></th>
                        <th class="nowrap"><?php esc_attr_e('Status','wpbookingevent') ?></th>
                        <th class="nowrap"><?php esc_attr_e('ID','wpbookingevent') ?></th>
                        <th class="nowrap"></th>
                    </tr>
                </thead>
                <tbody>
                    <?php $i = 0; ?>
                    <?php foreach ($this->list as $item) { ?>
                        <?php
                            $item->index = $i;
                            $this->item = $item;
                            $this->loadTemplate('list_item');
                            $i++;
                        ?>
                    <?php } ?>
                </tbody>
            </table>
        </div>
        <input type="hidden" name="task" value="">
    </form>
<?php
$doc->addLessStyleSheet('admin/app/assets/less/view_list_event.less');
$doc->addScriptApplySelector('.view-list-event', 'view_list_event', array(

), "admin/app/assets/js/view_list_event.js");
?>