<?php

use WpBookingEvent\Factory as FactoryAlias;
use WpBookingEvent\Html\ToolBar;
use WpBookingEvent\Html\WpBookingEventHtmlBackend as WpBookingEventHtmlBackendAlias;
use WpBookingEvent\Utilities\Utility as UtilityAlias;
use WpBookingEventAdmin\app\Html\HtmlBackend;
use WpBookingEvent\Language\Text;
$doc = FactoryAlias::getDocument();
WpBookingEventHtmlBackendAlias::load_jquery_library('icheck');
WpBookingEventHtmlBackendAlias::load_jquery_library('select2');
WpBookingEventHtmlBackendAlias::load_jquery_library('loading_js');
ToolBar::setTitle("List Orderpackages");
WpBookingEventHtmlBackendAlias::load_jquery_library('datatables');
?>
<?php ?>
<form action="<?php echo(UtilityAlias::getBackendGoToLink("orderpackages.form")) ?>" name="admin-form" method="post">
    <div class="view-list-order-package">
        <div class="wrapper-table-package">
            <table id="example" class="display table"">
                <thead>
                    <tr class="header">
                        <th class="nowrap"></th>
                        <th class="nowrap"><?php esc_attr_e('Package','wpbookingevent') ?></th>
                        <th class="nowrap"><?php esc_attr_e('Customer','wpbookingevent') ?></th>
                        <th class="nowrap"><?php esc_attr_e('Payment','wpbookingevent') ?></th>
                        <th class="nowrap"><?php esc_attr_e('Status','wpbookingevent') ?></th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($this->list as $item) { ?>
                        <tr class="row-item-order table-warning" data-order_id="<?php esc_html_e($item->id) ?>">
                            <td class="sorting_1"><?php echo (HtmlBackend::render_checkbox($item->id)) ?></td>
                            <td class="nowrap"><?php esc_html_e($item->package->name); ?></td>
                            <td class="nowrap"><?php esc_html_e($item->customer->customer_full_name); ?></td>
                            <td class="nowrap"><?php esc_html_e(HtmlBackend::render_price($item->total)); ?></td>
                            <td class="nowrap">
                                <div class="list-order-status">
                                    <select class="order-status">
                                        <?php foreach ($this->list_order_status as $order_status) { ?>
                                            <option <?php echo((isset($item->order_status_id)&&$order_status->id == $item->order_status_id) ? ' selected ' : '') ?>
                                                    value="<?php esc_html_e($order_status->id); ?>"><?php esc_html_e($order_status->title); ?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                            </td>
                            <td>
                                <a href="<?php echo(UtilityAlias::getBackendGoToLink("orderpackages.form",array('id'=>$item->id))) ?>" class="btn btn-primary btn-detail" title="<?php esc_attr_e('Detail','wpbookingevent')?>"><?php esc_attr_e('Detail','wpbookingevent')?></a>
                            </td>
                        </tr>
                    <?php } ?>
                </tbody>
            </table>
        </div>
    </div>
</form>
<?php
$doc->addLessStyleSheet('admin/app/assets/less/list_view_order_package.less');
$doc->addScriptApplySelector('.view-list-order-package', 'list_view_order_package', array(

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