<?php
/**
 * Webkul Software.
 *
 * @category   Webkul
 * @package    Webkul_Agorae
 * @author     Webkul Software Private Limited
 * @copyright  Copyright (c) Webkul Software Private Limited (https://webkul.com)
 * @license    https://store.webkul.com/license.html
 */

// @codingStandardsIgnoreFile

/**
 * Banner for seller collection page
 *
 * @var $block \Webkul\Marketplace\Block\Collection
 */

$partner = $block->getProfileDetail();
$viewModel = $block->getData("viewModel");
$moduleManager = $viewModel->getModuleManager();

if($partner->getIsSeller() && $partner->getShopUrl()){
    $helper = $this->helper('Webkul\Agorae\Helper\Data');
    if ($moduleManager->isOutputEnabled('Webkul_Marketplace')) {
    $mpHelper = $this->helper('Webkul\Marketplace\Helper\Data');

    $isMpSellerCommunicationModule = $helper->isModuleEnabled('Webkul_MpSellerBuyerCommunication');
    $isMpSellerCommunicationOutput = $helper->isOutputEnabled('Webkul_MpSellerBuyerCommunication');

    $sellerId = $partner->getSellerId();
    $seller = $helper->getCustomerData($sellerId);
    $sellerName = $seller->getName();

    $shopTitle = $partner->getShopTitle();
    if(!$shopTitle){
        $shopTitle = $partner->getShopUrl();
    }

    $locality = $partner->getCompanyLocality();
    $country = $helper->getCountry($partner->getCountryPic());
    $countryName = '';
    if($country){
        $countryName = ",".$country;
    }

    $ratings = $mpHelper->getSelleRating($sellerId);
    $ratingData = $mpHelper->getFeedTotal($sellerId);
    if(!$ratingData
        || !$ratingData['feedcount']
        || $ratingData==0
    ){
        $ratingData = [];
        $ratingData['feedcount'] = 0;
    }

    $bannerPic = $partner->getBannerPic() != '' ? $partner->getBannerPic() : "banner-image.png";
    $bannerPic = $helper->getMediaUrl().'avatar/'.$bannerPic;

    $logo = $partner->getLogoPic() == '' ? "noimage.png" : $partner->getLogoPic();
    $logo = $helper->getMediaUrl().'avatar/'.$logo;

    $countryFlag = $this->getViewFileUrl(
        'Webkul_Marketplace::images/country/countryflags/'
    )."/".strtoupper(
        $partner->getCountryPic() == "" ? "xx" : $partner['country_pic']
    ) .".png";

    $captchaEnable = $mpHelper->getCaptchaEnable();
    $sellerOrdersCount = $helper->getSellerOrdersCount($sellerId);

    if($mpHelper->getActiveColorPicker()){?>
        <style>
            .page-main{
                background-image:none;
                background-color:<?php echo $partner->getBackgroundWidth();?>;
            }
        </style>
    <?php
    } ?>
    <div class="wk-mp-design">
        <div class="wk_mp_seller_banner_container">
            <div class="wk_mp_seller_banner" style="background-image: url('<?php echo $bannerPic ?>');">
                <div class="wk-mp-header ">
                    <div class="wk-logo-block">
                        <a href="<?php echo $mpHelper->getRewriteUrl(
                                'marketplace/seller/profile/shop/'
                                .$partner->getShopUrl()
                            );?>" >
                            <img class="bannerpicrs" src="<?php echo $logo;?>" />
                        </a>
                    </div>
                    <div class="wk-seller">
                        <div class="section">
                            <div class="storename">
                                <a class="store-name"
                                    href="<?php echo $mpHelper->getRewriteUrl(
                                        'marketplace/seller/profile/shop/'.
                                        $partner->getShopUrl()
                                    );?>">
                                    <?php echo $shopTitle; ?>
                                </a>
                            </div>
                            <div class="wk-mp-profile_container storename">
                                <div class="sellername">
                                    <label><?php echo __("Managed by-") ?></label>
                                    <a class="seller-name"
                                        href="<?php echo $mpHelper->getRewriteUrl(
                                            'marketplace/seller/profile/shop/'
                                            .$partner->getShopUrl()
                                        );?>">
                                        <?php echo $sellerName ?>
                                    </a>
                                </div>
                            </div>
                            <div class="wk-mp-profile_container wefrom">
                                <a class="wk-storeloc-icon wk-icon icon"
                                    title="<?php echo __('Search') ?>"
                                    href="<?php echo $mpHelper->getRewriteUrl(
                                        'marketplace/seller/location/shop/'
                                        .$partner->getShopUrl()
                                    )."?loc=".$locality?>"
                                    target="_blank">
                                </a>
                                <label><?php echo __("From") ?></label>
                                <a class="cont-name"
                                    title="<?php echo __('Search') ?>"
                                    href="<?php echo  $mpHelper->getRewriteUrl(
                                        'marketplace/seller/location/shop/'
                                        .$partner->getShopUrl()
                                    )."?loc=".$locality?>"
                                    target="_blank">
                                    <span><?php echo $locality.$countryName; ?></span>
                                    <img class="piccountry"
                                        title="<?php echo __('View Map') ?>"
                                        src="<?php echo $countryFlag;  ?>" />
                                </a>
                            </div>
                            <div class="seller-rating">
                                <div class="ratings">
                                    <i><?php echo __('Rated  ') ?></i>
                                    <div class="rating-box">
                                        <div style="width:<?php echo (($ratings*100)/5); ?>%"
                                            class="rating"></div>
                                    </div>
                                    <span><?php echo $ratingData['feedcount']; ?></span>
                                    <i>
                                        <?php echo __(' based on %1 successfull sales', $sellerOrdersCount) ?>
                                    </i>
                                </div>
                            </div>
                            <span class="data">
                                <label><?php echo $partner->getCompanyDescription();?></label>
                            </span>
                            <div class="wk-mp-design-inner wk-mp-design-inner-last">
                                <div class="wk-mp-profile_container storename" style="display: inline-block;">
                                <?php if($partner->getInstagramActive()){ ?>
                                    <a href="//instagram.com/<?php echo $partner->getInstagramId();?>"
                                        target="blank">
                                        <span class="wk-social-icon wk-icon wk-social-icon-instagram"
                                            title="<?php echo __('Check in Instagram')?>"></span>
                                    </a>
                                <?php
                                } ?>
                                <?php if($partner->getPinterestActive()){ ?>
                                    <a href="//www.pinterest.com/jokestuffs/<?php echo $partner->getPinterestId();?>"
                                        target="blank">
                                        <span class="wk-social-icon wk-icon wk-social-icon-pinterest"
                                            title="<?php echo __('Check in Pinterest')?>"></span>
                                    </a>
                                <?php
                                } ?>
                                <?php if($partner->getFbActive()){ ?>
                                    <a href="//facebook.com/<?php echo $partner->getFacebookId();?>"
                                        target="blank">
                                        <span class="wk-social-icon wk-icon wk-social-icon-fb"
                                            title="<?php echo __('Check in Facebook')?>"></span>
                                    </a>
                                <?php
                                } ?>
                                <?php if($partner->getTwActive()){ ?>
                                    <a href="//twitter.com/<?php echo $partner->getTwitterId();?>"
                                        target="blank">
                                        <span class="wk-social-icon wk-icon wk-social-icon-tw"
                                            title="<?php echo __('Check in Twitter')?>"></span>
                                    </a>
                                <?php
                                } ?>
                                <?php if($partner->getGplusActive()){ ?>
                                    <a href="//plus.google.com/<?php echo $partner->getGplusId();?>"
                                        target="blank">
                                        <span class="wk-social-icon wk-icon wk-social-icon-gplus"
                                            title="<?php echo __('Check in Google+')?>"></span>
                                    </a>
                                <?php
                                } ?>
                                <?php if($partner->getVimeoActive()){ ?>
                                    <a href="//vimeo.com/<?php echo $partner->getVimeoId();?>"
                                        target="blank">
                                        <span class="wk-social-icon wk-icon wk-social-icon-vimeo"
                                            title="<?php echo __('Check in Vimeo')?>"></span>
                                    </a>
                                <?php
                                } ?>
                                <?php if($partner->getYoutubeActive()){ ?>
                                    <a href="//www.youtube.com/user/<?php echo $partner->getYoutubeId();?>"
                                        target="blank">
                                        <span class="wk-social-icon wk-icon wk-social-icon-utube"
                                            title="<?php echo __('Check in Youtube')?>"></span>
                                    </a>
                                <?php
                                } ?>
                                <?php if($partner->getMoleskineActive()){ ?>
                                    <a href="//moleskine.com/<?php echo $partner->getMoleskineId();?>"
                                        target="blank">
                                        <span class="wk-social-icon wk-icon wk-social-icon-moleskin"
                                            title="<?php echo __('Check in Moleskine')?>"></span>
                                    </a>
                                <?php
                                } ?>
                                </div>
                            </div>
                            <?php if($isMpSellerCommunicationModule && $isMpSellerCommunicationOutput): ?>
                                <?php $mpProfileBlock = $this->getLayout()->createBlock(
                                    'Webkul\Marketplace\Block\Profile'
                                );
                                $_helper = $this->helper('Webkul\MpSellerBuyerCommunication\Helper\Data');
                                $respnseRate = $_helper->getResponseRateOfSeller($sellerId);
                                $avgResponse = $_helper->getResponseTimeOfSeller($sellerId); ?>
                                <div class="section ask-que">
                                    <a class="askque"><?php echo __('Contact Seller') ?></a>

                                    <div class="ask-que">
                                        <div id="wk-mp-ask-data">
                                            <div class="modals-wrapper">
                                                <aside tabindex="0" data-type="popup" data-role="modal" class="modal-popup modal-slide _inner-scroll wk-mp-model-popup">
                                                    <div tabindex="0" data-role="focusable-start"></div>
                                                    <div data-role="focusable-scope" class="modal-inner-wrap">
                                                        <header class="modal-header">
                                                            <h4 class="modal-title"><?php echo __('Contact Seller') ?></h4>
                                                            <!-- <span  class="wk-close" >x</span> -->
                                                            <button type="button" data-role="closeBtn" class="action-close wk-close">
                                                                <span><?php echo __('Close') ?></span>
                                                            </button>
                                                            <span  class="wk-clear" ></span>
                                                        </header>
                                                        <?php
                                                        if($mpProfileBlock->Session->isLoggedIn()){
                                                            $buyer_name = $mpProfileBlock->Session->getCustomer()->getName();
                                                            $buyer_email = $mpProfileBlock->Session->getCustomer()->getEmail();
                                                            $readonly = "readonly='readonly'";
                                                        }else{
                                                            $buyer_email = '';
                                                            $buyer_name = '';
                                                            $readonly = '';
                                                        }
                                                        ?>
                                                        <form id="ask-form" method="post" action="#" class="fieldset" data-mage-init='{"validation":{}}' enctype="multipart/form-data">
                                                            <div class="modal-body form-list field required">
                                                                <label class="label"><?php echo __('Support Type') ?> :</label>
                                                                <select name="support_type" class="validate-select required-entry">
                                                                    <?php foreach ($_helper->getSupportTypes() as $key => $value) { ?>
                                                                        <option value=<?php echo $key; ?>><?php echo $value; ?></option>
                                                                    <?php }  ?>
                                                                </select>
                                                                <label class="label"><?php echo __('Your Name') ?> :</label>
                                                                <input type="text" name="name" class="queryemail wk-contact_input_fields required-entry" value="<?php echo $buyer_name?>" <?php echo $readonly?>/>
                                                                <label class="label"><?php echo __('Your Email') ?> :</label>
                                                                <input type="text" name="email" class="queryemail required-entry validate-email wk-contact_input_fields" value="<?php echo $buyer_email?>" <?php echo $readonly?>/>
                                                                <label class="label"><?php echo __('Subject') ?> :</label>
                                                                <input type="text" name="subject" class="wk-contact_input_fields required-entry"/>
                                                                <label class="label"><?php echo __('Your Query') ?> :</label>
                                                                <textarea  name="ask" id="queryquestion" class="queryquestion wk-contact_input_fields required-entry" style="width:100%;"></textarea>

                                                                <script>
                                                                    require([
                                                                        'jquery',
                                                                        'mage/adminhtml/wysiwyg/tiny_mce/setup'
                                                                    ], function(jQuery){

                                                                        var config = '',editor;

                                                                            jQuery.extend(
                                                                            config,
                                                                            {
                                                                                settings: {
                                                                                    theme_advanced_buttons1 : 'bold,italic,|,justifyleft,justifycenter,justifyright,|,' +
                                                                                    'fontselect,fontsizeselect,|,forecolor,backcolor,|,link,unlink,image,|,bullist,numlist,|,code',
                                                                                    theme_advanced_buttons2: null,
                                                                                    theme_advanced_buttons3: null,
                                                                                    theme_advanced_buttons4: null,
                                                                                    theme_advanced_statusbar_location: null
                                                                                },
                                                                                files_browser_window_url: false
                                                                            }
                                                                        );

                                                                        editor = new tinyMceWysiwygSetup(
                                                                            'queryquestion',
                                                                            config
                                                                        );
                                                                        editor.turnOn();

                                                                        jQuery('#queryquestion')
                                                                            .addClass('wysiwyg-editor')
                                                                            .data(
                                                                                'wysiwygEditor',
                                                                                editor
                                                                            );
                                                                        });
                                                                </script>

                                                                <input type="hidden" name="seller-id" value="<?php echo $sellerId;?>"/>
                                                                <?php
                                                                if($captchaEnable){?>
                                                                    <div>
                                                                        <span>
                                                                            <label for="wk-mp-captcha"><span id="wk-mp-captchalable1"><?php echo rand(1,20)?></span> + <span id="wk-mp-captchalable2"><?php echo rand(1,20)?></span> =</label>
                                                                        </span>
                                                                        <input type="text" class="required-entry wk-contact_input_fields" name="wk-mp-captcha" id="wk-mp-captcha" />
                                                                    </div>
                                                                <?php
                                                                }?>
                                                                <label class="file label" class=""><em></em><?php echo __('Add Image/File') ?> :</label>
                                                                <div class="input-box">
                                                                    <input type="file" name="img_attachment[]" class="wk_imagevalidate"/>
                                                                    <br>
                                                                    <div id="otherimages"></div>
                                                                    <a href="#" class="product_images"><?php echo __("Add More image"); ?></a><br />

                                                                </div>
                                                            </div>
                                                            <div class="modal-footer">
                                                                <span class="error"></span>
                                                                <span class="errormail"></span>
                                                                <input type="reset" value="<?php echo __('Reset') ?>" id="resetbtn" class="wk-btn wk-btn_default"/>
                                                                <input type="submit" value="<?php echo __('Submit') ?>" id="askbtn" class="wk-btn wk-btn-primary clickask"/>
                                                                <span class="wk-clear"></span>
                                                            </div>
                                                        </form>
                                                    </div>
                                                    <div tabindex="0" data-role="focusable-end"></div>
                                                </aside>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <span class="seller-response-rate">
                                    <?php echo $respnseRate .__('% response rate,') ?>
                                    <?php echo $avgResponse. __('-mins response time') ?>
                                </span>
                                <script id="attachment-template" type="text/x-magento-template">
                                    <div id='childDiv<%- fields.index %>'>
                                        <input type='file' name='img_attachment[]' class='wk_imagevalidate'/>
                                        <a href="javascript:void(0)" class="remove_attch"><?php echo __('Remove'); ?></a>
                                    </div>
                                </script>

                                <?php
                                    $releventFormData = [
                                        'targetAjaxUrl' => $mpProfileBlock->getUrl("mpsellerbuyercommunication/seller/sendmail", ["_secure" => $this->getRequest()->isSecure()]),
                                        'captchenable'  => $captchaEnable,
                                        'varificationMsg' => __(' enable to varifiy captcha'),
                                        'formValidator' => '#ask-form',
                                        'attachmentTemplate' => '#attachment-template',
                                        'saveAjaxFileUrl' => $mpProfileBlock->getUrl("mpsellerbuyercommunication/seller/saveFiles", ["_secure" => $this->getRequest()->isSecure()])
                                    ];

                                $serializedData = $this->helper(
                                    'Magento\Framework\Json\Helper\Data'
                                )->jsonEncode($releventFormData); ?>

                                <script type="text/x-magento-init">
                                    {
                                        "*": {
                                            "wkSellerProfilePage": <?php echo $serializedData; ?>
                                        }
                                    }
                                </script>
                            <?php else: ?>
                                <div class="section ask-que">
                                    <a class="askque"><?php echo __('Ask Question') ?></a>
                                    <div class="ask-que">
                                        <div id="wk-mp-ask-data">
                                            <div class="modals-wrapper">
                                                <aside tabindex="0"
                                                    data-type="popup"
                                                    data-role="modal"
                                                    class="modal-popup modal-slide _inner-scroll wk-mp-model-popup">
                                                    <div tabindex="0" data-role="focusable-start"></div>
                                                    <div data-role="focusable-scope" class="modal-inner-wrap">
                                                        <header class="modal-header">
                                                            <h4 class="modal-title">
                                                                <?php echo __('Contact Seller') ?>
                                                            </h4>
                                                            <!-- <span  class="wk-close" >x</span> -->
                                                            <button type="button"
                                                                data-role="closeBtn"
                                                                class="action-close wk-close">
                                                                <span>Close</span>
                                                            </button>
                                                            <span class="wk-clear"></span>
                                                        </header>
                                                        <?php
                                                        if($helper->checkCustomerLoggedIn()){
                                                            $buyerName = $helper->getLoggedInCustomer()->getName();
                                                            $buyerEmail = $helper->getLoggedInCustomer()->getEmail();
                                                            $readonly = "readonly='readonly'";
                                                        }else{
                                                            $buyerEmail = '';
                                                            $buyerName = '';
                                                            $readonly = '';
                                                        }
                                                        ?>
                                                        <form id="ag-ask-form"
                                                            method="post"
                                                            action="#" class="fieldset">
                                                            <div class="modal-body form-list field required">
                                                                <label class="label">
                                                                    <?php echo __('Your Name') ?> :
                                                                </label>
                                                                <input type="text"
                                                                    name="name"
                                                                    class="queryemail wk-contact_input_fields required-entry"
                                                                    value="<?php echo $buyerName?>"
                                                                    <?php echo $readonly?>/>
                                                                <label class="label">
                                                                    <?php echo __('Your Email') ?> :
                                                                </label>
                                                                <input type="text"
                                                                    name="email"
                                                                    class="queryemail required-entry validate-email wk-contact_input_fields"
                                                                    value="<?php echo $buyerEmail?>"
                                                                    <?php echo $readonly?>/>
                                                                <label class="label">
                                                                    <?php echo __('Subject') ?> :
                                                                </label>
                                                                <input type="text"
                                                                    name="subject"
                                                                    class="wk-contact_input_fields required-entry"/>
                                                                <label class="label">
                                                                    <?php echo __('Your Query') ?> :
                                                                </label>
                                                                <textarea name="ask"
                                                                    class="queryquestion wk-contact_input_fields required-entry"
                                                                    style="width:100%;"></textarea>
                                                                <input type="hidden"
                                                                    name="seller-id"
                                                                    value="<?php echo $sellerId;?>"/>
                                                                <?php if($captchaEnable){ ?>
                                                                    <div>
                                                                        <span>
                                                                            <label for="wk-mp-captcha">
                                                                                <span id="wk-mp-captchalable1">
                                                                                    <?php echo rand(1,20)?>
                                                                                </span> +
                                                                                <span id="wk-mp-captchalable2">
                                                                                    <?php echo rand(1,20)?>
                                                                                </span> =
                                                                            </label>
                                                                        </span>
                                                                        <input type="text"
                                                                            class="required-entry wk-contact_input_fields"
                                                                            name="wk-mp-captcha"
                                                                            id="wk-mp-captcha" />
                                                                    </div>
                                                                <?php
                                                                } ?>
                                                            </div>
                                                            <div class="modal-footer">
                                                                <span class="error"></span>
                                                                <span class="errormail"></span>
                                                                <input type="reset"
                                                                    value="<?php echo __('Reset') ?>"
                                                                    id="resetbtn"
                                                                    class="wk-btn wk-btn_default"/>
                                                                <input type="submit"
                                                                    value="<?php echo __('Submit') ?>"
                                                                    id="askbtn"
                                                                    class="wk-btn wk-btn-primary clickask"/>
                                                                <span class="wk-clear"></span>
                                                            </div>
                                                        </form>
                                                    </div>
                                                    <div tabindex="0" data-role="focusable-end"></div>
                                                </aside>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <script>
                                    require([
                                        "jquery",
                                        'Magento_Ui/js/modal/alert',
                                        'mage/translate',
                                        "mage/mage"
                                    ], function($, alert, __){
                                        var askDataForm = $('#ag-ask-form');
                                        askDataForm.mage('validation', {});

                                        $('body').append($('#wk-mp-ask-data'));
                                        $('.askque').click(function(){
                                            $('#ag-ask-form input,#ag-ask-form textarea').removeClass('mage-error');
                                            $('.page-wrapper').css('opacity','0.4');
                                            $('.wk-mp-model-popup').addClass('_show');
                                            $('#wk-mp-ask-data').show();
                                        });
                                        $('.wk-close').click(function(){
                                            $('.page-wrapper').css('opacity','1');
                                            $('#resetbtn').trigger('click');
                                            $('#wk-mp-ask-data').hide();
                                            $('#ag-ask-form .validation-failed').each(function(){
                                                $(this).removeClass('validation-failed');
                                            });
                                            $('#ag-ask-form .validation-advice').each(function(){
                                                $(this).remove();
                                            });
                                        });
                                        $('#askbtn').click(function(){
                                            if(askDataForm.valid()!=false){
                                                var thisthis = $(this);
                                                if(thisthis.hasClass("clickask")){
                                                    <?php if($captchaEnable){?>
                                                        var total = parseInt(
                                                            $('#wk-mp-captchalable1').text()
                                                        ) + parseInt($('#wk-mp-captchalable2').text());
                                                        var wk_mp_captcha = $('#wk-mp-captcha').val();
                                                        if(total != wk_mp_captcha){
                                                            $('#wk-mp-captchalable1').text(Math.floor((Math.random()*10)+1));
                                                            $('#wk-mp-captchalable2').text(Math.floor((Math.random()*100)+1));
                                                            $('#wk-mp-captcha').val('');
                                                            $('#wk-mp-captcha').addClass('mage-error');
                                                            $(this).addClass('mage-error');
                                                            $('#ask_form .errormail')
                                                                .text(
                                                                    "<?php echo __(' Wrong varification number. ') ?>"
                                                                ).slideDown('slow').delay(2000).slideUp('slow');
                                                        }else{
                                                            thisthis.removeClass('clickask');
                                                            $('#wk-mp-ask-data').addClass('mail-procss');
                                                            $.ajax({
                                                                url:'<?php echo $block->getUrl("marketplace/seller/sendmail", ["_secure" => $this->getRequest()->isSecure()]) ?>',
                                                                data:$('#ag-ask-form').serialize(),
                                                                type:'post',
                                                                dataType:'json',
                                                                success:function(d){
                                                                    thisthis.addClass('clickask');
                                                                    $('#wk-mp-ask-data').removeClass('mail-procss')
                                                                    alert({
                                                                        content : __(' Your mail has been sent '),
                                                                        actions: {
                                                                                    always: function () {
                                                                                        $('.wk-close,#resetbtn').trigger('click');
                                                                                        $('.modals-overlay').remove();
                                                                                        $('#wk-mp-ask-data').parent().removeClass('_has-modal');
                                                                                    }
                                                                                }
                                                                    });
                                                                }
                                                            });
                                                        }
                                                    <?php
                                                    }else{?>
                                                        thisthis.removeClass('clickask');
                                                            $('#wk-mp-ask-data').addClass('mail-procss');
                                                            $.ajax({
                                                                url:'<?php echo $block->getUrl("marketplace/seller/sendmail", ["_secure" => $this->getRequest()->isSecure()]) ?>',
                                                                data:$('#ag-ask-form').serialize(),
                                                                type:'post',
                                                                dataType:'json',
                                                                success:function(d){
                                                                    thisthis.addClass('clickask');
                                                                    $('#wk-mp-ask-data').removeClass('mail-procss')
                                                                    alert({
                                                                        content : __(' Your mail has been sent '),
                                                                        actions: {
                                                                                    always: function () {
                                                                                        $('.wk-close,#resetbtn').trigger('click');
                                                                                        $('.modals-overlay').remove();
                                                                                        $('#wk-mp-ask-data').parent().removeClass('_has-modal');
                                                                                    }
                                                                                }
                                                                    });
                                                                }
                                                            });
                                                        <?php
                                                    }?>
                                                }
                                                return false;
                                            }
                                        });
                                    });
                                </script>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php
}
} ?>
