<?php

use WpBookingEvent\Factory;
use WpBookingEvent\Html\ToolBar;
use WpBookingEvent\Language\Text;
use WpBookingEventAdmin\app\helpers\ConfigHelper as ConfigHelperAlias;

$doc = Factory::getDocument();
$doc->addLessStyleSheet('admin/app/assets/less/view_form_config.less');
$style_block_top_event= ConfigHelperAlias::get_style_block_top_event();
$go_to_page = ConfigHelperAlias::get_go_to_page_event_detail();
$style_form_booking_style = ConfigHelperAlias::get_select_form_booking_style();
$image_path = WPBOOKINGEVENT_PLUGIN_DIR_URL.DS."admin/app/assets/images";
$booking_style_image = WPBOOKINGEVENT_PLUGIN_DIR_URL.DS."admin/app/assets/images/bookingstyles";
$event_page_image =  WPBOOKINGEVENT_PLUGIN_DIR_URL.DS."admin/app/assets/images/gotoevents";
?>
<div class="view-config-form">
    <form action="" name="admin-form" method="post" enctype="multipart/form-data">
        <div>
            <ul class="event-tab nav nav-tabs" role="tablist">
                <li role="presentation" class="active" ><a href="#booking" aria-controls="profile" role="tab"
                                           data-toggle="tab"><?php esc_html_e("Booking",'wpbookingevent') ?></a></li>
                <li role="presentation"><a href="#basic" aria-controls="home" role="tab"
                                                          data-toggle="tab"><?php esc_attr_e('Basic','wpbookingevent') ?></a></li>
                <li role="presentation"><a href="#view" aria-controls="profile" role="tab"
                                           data-toggle="tab"><?php esc_html_e("View",'wpbookingevent') ?></a></li>
            </ul>
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="booking">
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo($this->form->renderField('booking_style','params')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo($this->form->renderField('timezone','params')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo($this->form->renderField('client_secret_file','params')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <?php echo($this->form->renderField('is_enable_booking_add_gg_calendar_api','params')) ?>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <?php
                            $field = $this->form->getField('multi_product_in_cart','params');
                            echo ($field->input)
                            ?>
                        </div>
                    </div>
                </div>
                <div role="tabpanel" class="tab-pane" id="basic">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="block-basic-item">
                                <?php echo ($this->form->renderField('page_service_detail','params')) ?>
                                <?php echo(ToolBar::render_button_task("config.create_page_service_detail",wpbookingevent_get_content("Create page service detail"))) ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="block-basic-item">
                                <?php echo ($this->form->renderField('page_list_category','params')) ?>
                                <?php echo(ToolBar::render_button_task("config.create_page_list_category",wpbookingevent_get_content("Create page list category"))) ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="block-basic-item">
                                <?php echo ($this->form->renderField('page_list_service','params')) ?>
                                <?php echo(ToolBar::render_button_task("config.create_page_list_service",wpbookingevent_get_content("Create page list service"))) ?>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="block-basic-item">
                                <?php echo ($this->form->renderField('page_list_event','params')) ?>
                                <?php echo(ToolBar::render_button_task("config.create_page_list_event",wpbookingevent_get_content("Create page list event"))) ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="block-basic-item">
                                <?php echo ($this->form->renderField('page_event_detail','params')) ?>
                                <?php echo(ToolBar::render_button_task("config.create_page_event_detail",wpbookingevent_get_content("Create page event detail"))) ?>
                            </div>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <div role="tabpanel" class="tab-pane" id="view">
                    <div class="row">
                        <div class="col-md-12">
                            <fieldset>
                                <legend><?php esc_attr_e('Onclick Event Detail:','wpbookingevent') ?></legend>
                                <?php echo($this->form->renderField('onclick_event_detail','params')) ?>
                                <div class="title-styles-go-to-page">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <h4 class=""><?php esc_attr_e('All select detail page','wpbookingevent') ?></h4>
                                        </div>
                                        <div class="col-md-6 col-sm-6">
                                            <div class="image-style">
                                                <?php if ( $go_to_page=='show_on_page'){ ?>
                                                    <h5><?php esc_attr_e('show on page','wpbookingevent') ?> <i class="fas fa-check-circle"></i></h5>
                                                <?php } else{ ?>
                                                    <h5><?php esc_attr_e('show on page','wpbookingevent') ?></h5>
                                                <?php } ?>
                                                <img src="<?php echo ($event_page_image."/showonpage.jpg")?>">
                                            </div>
                                        </div>
                                        <div class="col-md-6 col-sm-6">
                                            <div class="image-style">
                                                <?php if ( $go_to_page=='go_event_page'){ ?>
                                                    <h5><?php esc_attr_e('go to event detail page','wpbookingevent') ?> <i class="fas fa-check-circle"></i></h5>
                                                <?php } else{ ?>
                                                    <h5><?php esc_attr_e('go to event detail page','wpbookingevent') ?></h5>
                                                <?php } ?>
                                                <img src="<?php echo ($event_page_image."/gotoevent.jpg")?>">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </fieldset>
                            <fieldset>
                                <legend><?php esc_attr_e('Form booking style:','wpbookingevent') ?></legend>
                                <?php echo($this->form->renderField('select_form_booking_style','params')) ?>
                                <div class="title-styles-bookingevent-list">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <h4 class=""><?php esc_attr_e('All styles of bookingevent','wpbookingevent') ?></h4>
                                        </div>
                                        <div class="col-md-6 col-sm-6">
                                            <div class="image-style">
                                                <?php if ( $style_form_booking_style=='style_1'){ ?>
                                                    <h5><?php esc_attr_e('Style 1','wpbookingevent') ?> <i class="fas fa-check-circle"></i></h5>
                                                <?php } else{ ?>
                                                    <h5><?php esc_attr_e('Style 1','wpbookingevent') ?></h5>
                                                <?php } ?>
                                                <img src="<?php echo ($booking_style_image."/style1.jpg")?>">
                                            </div>
                                        </div>
                                        <div class="col-md-6 col-sm-6">
                                            <div class="image-style">
                                                <?php if ( $style_form_booking_style=='style_2'){ ?>
                                                    <h5><?php esc_attr_e('Style 2','wpbookingevent') ?> <i class="fas fa-check-circle"></i></h5>
                                                <?php } else{ ?>
                                                    <h5><?php esc_attr_e('Style 2','wpbookingevent') ?></h5>
                                                <?php } ?>
                                                <img src="<?php echo ($booking_style_image."/style2.jpg")?>">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </fieldset>

                            <fieldset>
                                <legend><?php esc_attr_e('Style block top event','wpbookingevent') ?></legend>
                                <?php echo($this->form->renderField('select_style_top_event','params')) ?>
                                <div class="title-styles-top-events">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <h4 class=""><?php esc_attr_e('All styles of block top events','wpbookingevent') ?></h4>
                                        </div>
                                        <div class="col-md-4 col-sm-6">
                                            <div class="image-style">
                                                <?php if ( $style_block_top_event=='style_1'){ ?>
                                                    <h5><?php esc_attr_e('Style 1','wpbookingevent') ?> <i class="fas fa-check-circle"></i></h5>
                                                <?php } else{ ?>
                                                    <h5><?php esc_attr_e('Style 1','wpbookingevent') ?></h5>
                                                <?php } ?>
                                                <img src="<?php echo ($image_path."/style1.jpg")?>">
                                            </div>
                                        </div>
                                        <div class="col-md-4 col-sm-6">
                                            <div class="image-style">
                                                <?php if ( $style_block_top_event=='style_2'){ ?>
                                                    <h5><?php esc_attr_e('Style 2','wpbookingevent') ?> <i class="fas fa-check-circle"></i></h5>
                                                <?php } else{ ?>
                                                    <h5><?php esc_attr_e('Style 2','wpbookingevent') ?></h5>
                                                <?php } ?>
                                                <img src="<?php echo ($image_path."/style2.jpg")?>">
                                            </div>
                                        </div>
                                        <div class="col-md-4 col-sm-6">
                                            <div class="image-style">
                                                <?php if ( $style_block_top_event=='style_3'){ ?>
                                                    <h5><?php esc_attr_e('Style 3','wpbookingevent') ?> <i class="fas fa-check-circle"></i></h5>
                                                <?php } else{ ?>
                                                    <h5><?php esc_attr_e('Style 3','wpbookingevent') ?></h5>
                                                <?php } ?>
                                                <img src="<?php echo ($image_path."/style3.jpg")?>">
                                            </div>
                                        </div>
                                        <div class="col-md-4 col-sm-6">
                                            <div class="image-style">
                                                <?php if ( $style_block_top_event=='style_4'){ ?>
                                                    <h5><?php esc_attr_e('Style 4','wpbookingevent') ?> <i class="fas fa-check-circle"></i></h5>
                                                <?php } else{ ?>
                                                    <h5><?php esc_attr_e('Style 4','wpbookingevent') ?></h5>
                                                <?php } ?>
                                                <img src="<?php echo ($image_path."/style4.jpg")?>">
                                            </div>
                                        </div>
                                        <div class="col-md-4 col-sm-6">
                                            <div class="image-style">
                                                <?php if ( $style_block_top_event=='style_5'){ ?>
                                                    <h5><?php esc_attr_e('Style 5','wpbookingevent') ?> <i class="fas fa-check-circle"></i></h5>
                                                <?php } else{ ?>
                                                    <h5><?php esc_attr_e('Style 5','wpbookingevent') ?></h5>
                                                <?php } ?>
                                                <img src="<?php echo ($image_path."/style5.jpg")?>">
                                            </div>
                                        </div>
                                        <div class="col-md-4 col-sm-6">
                                            <div class="image-style">
                                                <?php if ( $style_block_top_event=='style_6'){ ?>
                                                    <h5><?php esc_attr_e('Style 6','wpbookingevent') ?> <i class="fas fa-check-circle"></i></h5>
                                                <?php } else{ ?>
                                                    <h5><?php esc_attr_e('Style 6','wpbookingevent') ?></h5>
                                                <?php } ?>
                                                <img src="<?php echo ($image_path."/style6.jpg")?>">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </fieldset>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <input type="hidden" name="task" value="config.save">
    </form>
</div>
