<?php

use WpBookingEvent\Factory;
use WpBookingEvent\Html\WpBookingEventHtmlBackend;
use WpBookingEvent\Language\Text;
WpBookingEventHtmlBackend::load_jquery_library('icheck');
WpBookingEventHtmlBackend::load_jquery_library('loading_js');
$check_type_form = $this->item;

?>
<?php if ($check_type_form != null) {?>
<div class="view-event-form">
    <form action="" method="post" name="admin-form" enctype="multipart/form-data" value="<?php echo ($check_type_form->id)?>">

        <div>
            <ul class="state-tab nav nav-tabs" role="tablist">
                <li role="presentation" class="active">
                    <a href="#detail" aria-controls="home" role="tab" data-toggle="tab">
                        <?php esc_attr_e('Event detail','wpbookingevent') ?>
                    </a>
                </li>
                <li role="presentation">
                    <a href="#customize" aria-controls="profile" role="tab" data-toggle="tab">
                        <?php esc_attr_e('Customize','wpbookingevent') ?>
                    </a>
                </li>
            </ul>
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="detail">
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo ($this->form->renderField('image')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo($this->form->renderField('name')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <?php echo($this->form->renderField('rates')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <?php
                            $field = $this->form->getField('publish_up');
                            ?>
                            <?php echo($field->input) ?>
                        </div>
                        <div class="col-md-6">
                            <?php
                            $field = $this->form->getField('publish_down');
                            ?>
                            <?php echo($field->input) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-4">
                            <?php echo($this->form->renderField('service_id')) ?>
                        </div>
                        <div class="col-md-4">
                            <?php echo($this->form->renderField('min_allowed_person')) ?>
                        </div>
                        <div class="col-md-4">
                            <?php echo($this->form->renderField('max_allowed_person')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <?php
                            $field = $this->form->getField('location_id');
                            ?>
                            <?php echo($field->input) ?>
                        </div>
                        <div class="col-md-6">
                            <?php echo($this->form->renderField('event_type_id')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo($this->form->renderField('list_employee_id')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo($this->form->renderField('top')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo($this->form->renderField('description')) ?>
                        </div>
                    </div>
                </div>
                <div role="tabpanel" class="tab-pane" id="customize">
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo($this->form->renderField('gallery')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo($this->form->renderField('event_color')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo($this->form->renderField('published')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo($this->form->renderField('test_media')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <?php echo($this->form->renderField('recurring')) ?>
                        </div>
                        <div class="col-md-6">
                            <?php echo($this->form->renderField('duration')) ?>
                        </div>
                    </div>

                </div>
            </div>
        </div>
		<?php echo ($this->form->renderField('id')) ?>
        <input type="hidden" name="task" value="event.save">
    </form>
</div>
<?php } else { ?>
    <div class="view-event-form">
        <form action="" method="post" name="admin-form" enctype="multipart/form-data">

            <div>
                <ul class="state-tab nav nav-tabs" role="tablist">
                    <li role="presentation" class="active">
                        <a href="#detail" aria-controls="home" role="tab" data-toggle="tab">
                            <?php esc_attr_e('Event detail','wpbookingevent') ?>
                        </a>
                    </li>
                    <li role="presentation">
                        <a href="#customize" aria-controls="profile" role="tab" data-toggle="tab">
                            <?php esc_attr_e('Customize','wpbookingevent') ?>
                        </a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="detail">
                        <div class="row">
                            <div class="col-md-12">
                                <?php echo ($this->form->renderField('image')) ?>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <?php echo($this->form->renderField('name')) ?>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <?php echo($this->form->renderField('rates')) ?>
                            </div>
                            <div class="col-md-6">
                                <?php echo($this->form->renderField('tags')) ?>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <?php echo($this->form->renderField('repeat_event')) ?>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-6">
                                <?php
                                $field = $this->form->getField('publish_up');
                                ?>
                                <?php echo($field->input) ?>
                            </div>
                            <div class="col-md-6">
                                <?php
                                $field = $this->form->getField('publish_down');
                                ?>
                                <?php echo($field->input) ?>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3">
                                <?php echo($this->form->renderField('price')) ?>
                            </div>
                            <div class="col-md-3">
                                <?php echo($this->form->renderField('service_id')) ?>
                            </div>
                            <div class="col-md-3">
                                <?php echo($this->form->renderField('min_allowed_person')) ?>
                            </div>
                            <div class="col-md-3">
                                <?php echo($this->form->renderField('max_allowed_person')) ?>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <?php
                                $field = $this->form->getField('location_id');
                                ?>
                                <?php echo($field->input) ?>
                            </div>
                            <div class="col-md-6">
                                <?php echo($this->form->renderField('event_type_id')) ?>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <?php echo($this->form->renderField('list_employee_id')) ?>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <?php echo($this->form->renderField('top')) ?>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <?php echo($this->form->renderField('description')) ?>
                            </div>
                        </div>
                    </div>
                    <div role="tabpanel" class="tab-pane" id="customize">
                        <div class="row">
                            <div class="col-md-12">
                                <?php echo($this->form->renderField('gallery')) ?>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <?php echo($this->form->renderField('event_color')) ?>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <?php echo($this->form->renderField('published')) ?>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <?php echo($this->form->renderField('test_media')) ?>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <?php echo($this->form->renderField('recurring')) ?>
                            </div>
                            <div class="col-md-6">
                                <?php echo($this->form->renderField('duration')) ?>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
            <?php echo ($this->form->renderField('id')) ?>
            <input type="hidden" name="task" value="event.save">
        </form>
    </div>
<?php } ?>
<?php
$doc = Factory::getDocument();
$doc->addStyleSheet('admin/app/assets/less/view_form_event.less');
$doc->addScriptApplySelector('.view-event-form', 'view_form_event', array(
), "admin/app/assets/js/view_form_event.js");
