<?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 Appointments");
WpBookingEventHtmlBackendAlias::load_jquery_library('datatables');
//echo "<pre>";
//print_r($this->list, false);
//echo "</pre>";
//die;
?>
<form action="<?php echo(UtilityAlias::getBackendGoToLink("appointment.form")) ?>" name="admin-form" method="post">
    <div class="view-list-appointment">
        <div class="wrapper-table-appointment">
            <table id="example" class="display table">
                <thead>
                    <tr class="header table-info">
                        <th><?php esc_attr_e('Customer','wpbookingevent')?></th>
                        <th><?php esc_attr_e('Information','wpbookingevent')?></th>
                        <th><?php esc_attr_e('Payment','wpbookingevent')?></th>
                        <th><?php esc_attr_e('Status','wpbookingevent')?></th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($this->list as $item) { ?>
                            <tr class="row-item-order" data-order_id="<?php esc_html_e($item->id) ?>">
                                <td><?php esc_html_e($item->customer->customer_full_name) ?></td>
                                <td>
                                    <p><?php esc_html_e($item->customer->email) ?></p>
                                    <p>Phone:<?php esc_html_e($item->customer->mobile) ?></p>
                                </td>
                                <td><?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($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>
                            </tr>
                    <?php } ?>
                </tbody>
            </table>
        </div>
    </div>
</form>
<?php
$doc->addLessStyleSheet('admin/app/assets/less/list_view_appointment.less');
$doc->addScriptApplySelector('.view-list-appointment', 'list_view_appointment', array(

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