<?php
use WooBooking\CMS\Utilities\Utility;
WpBookingPro_HtmlFrontend::_('jquery.slick');
$doc = Factory::getDocument();
$doc->addLessStyleSheet('blocks/block_categoryimage/assets/lesss/default.less');
?>
    <div class="block-categoryimage-default">
        <div class="row">
            <div class="col-md-12">
                <div class="wrapper-slide-category-item">
                    <div class="row">
                        <?php foreach ($list as $item){ ?>
                            <?php
                            $item=(object)$item;
                            $list_service=array_slice((array)(!empty($item->list_service)?$item->list_service:array()),0,3);
                            ?>
                            <div class="col-md-4 col-sm-6">
                                <div class="wrapper-category-item">
                                    <div class="img-block">
                                        <div>
                                            <img src="<?php esc_html_e(Factory::getRootUrlPlugin())?>/<?php esc_html_e($item->image) ?>" alt="category-image" />
                                        </div>
                                    </div>
                                    <div class="layer-blur"></div>
                                    <div class="layer-content">
                                        <h3><a href="<?php esc_html_e($this->frontendGoToLink("service.list","category_id=" . $item->id)) ?>"><?php esc_html_e($item->name) ?></a></h3>
                                        <div class="training">
                                            <ul class="list-service">
                                                <?php foreach ($list_service as $service) { ?>
                                                    <li><img class="service-image" src="<?php esc_html_e(Factory::getRootUrlPlugin()) ?>/<?php esc_html_e($service->image) ?>" alt="service-image" />
                                                    </li>
                                                <?php } ?>
                                            </ul>
                                            <p><?php esc_attr_e('Training','wpbookingpro') ?>:<?php echo count($list_service) ?></p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        <?php } ?>
                    </div>
                </div>
            </div>
        </div>
    </div>

<?php
$doc->addScriptApplySelector('.block-categoryimage-default','block_categoryimage_default',array(
),'blocks/block_categoryimage/assets/js/jquery.block_categoryimage_default.js');