<?php
       
    


/**
 * Use for the show the testimonials at home page and in testimonial page with shortcode
 * @param int $pageId default is null the id of a post
 * @param boolean $isCustomizer default is false if set to true it mean the output is set for the home page
 * @param int $i default null
 * @param boolean $showStaticVals default is false
 * @return string
 * @author Luzuk <support@luzuk.com>
 * */

/*services*/
function serviceShortCode($pageId = null, $isCustomizer = false, $i = null) {
    ob_start();

    $args = array('post_type' => 'our-services');
    if (!empty($pageId)) {
        $args['page_id'] = absint($pageId);
    }
    $args['posts_per_page'] = 1;
    $colCls = '';
    // if($isCustomizer == true){
    $cols = get_theme_mod('service_npp_count',5);  
    $services_page_icon1 = get_theme_mod('services_page_icon1'.$i);

    ++$cols;
    switch ($cols) {
       case 1:
                        $colCls = 'col-md-12 col-sm-12 col-xs-12';
                        break;
                        case 2: 
                        $colCls = 'col-md-6 col-sm-6 col-xs-12';
                        break;
                        case 3:
                        case 5:
                        case 6:
                        case 9:
                        case 11:
                        case 13:
                        case 15:
                        $colCls = 'col-md-4 col-sm-6 col-xs-12';
                        break;
                        default: 
                        $colCls = 'col-md-3 col-sm-6 col-xs-12';
                        break;
        }
    // }
        $text = '';
        $query = new WP_Query($args);
        if ($query->have_posts()):
            $postN = 0;

            while ($query->have_posts()) : $query->the_post();
                $luzuk_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'total-service-thumb');
                $post = get_post();

                 $servicesNum = get_post_meta($post->ID, 'servicesNum', false);
                    $services_Num = !empty($servicesNum[0]) ? $servicesNum[0] : '';
                ?>
        <div class="<?php echo $colCls;?> "> 
        <!-- <div class="item inser"> -->
            <div ser-match-height="groupName" class="single-service-bx">
                <div class="single-service ">
                    <div class="service-icon  padding0">
                       <?php
                        if (has_post_thumbnail()) {
                            $image_url = $luzuk_image[0];
                        } else {
                            $image_url = get_template_directory_uri() . '/images/services.jpg';
                        }
                        ?>
                        <div class="ser-img">
                            <a href="<?php the_permalink(); ?>">
                                <!-- <div class="ser-icn">       
                                    <i class="fa fa-camera-retro"></i>
                                </div> -->
                                <img class="img-responsive" src="<?php echo esc_url($image_url); ?>" alt="<?php the_title(); ?>" />
                                <div class="ser-wave">
                                    <svg width="100%" height="100%" id="svg" viewBox="0 0 1440 500" xmlns="http://www.w3.org/2000/svg" class="transition duration-300 ease-in-out delay-150">
                                        <path d="M 0,500 C 0,500 0,250 0,250 C 96.66410256410259,285.0769230769231 193.32820512820518,320.15384615384613 274,309 C 354.6717948717948,297.84615384615387 419.35128205128194,240.46153846153848 493,234 C 566.6487179487181,227.53846153846152 649.2666666666669,271.99999999999994 733,285 C 816.7333333333331,298.00000000000006 901.5820512820512,279.53846153846155 985,252 C 1068.4179487179488,224.46153846153842 1150.4051282051282,187.84615384615387 1226,186 C 1301.5948717948718,184.15384615384613 1370.797435897436,217.07692307692307 1440,250 C 1440,250 1440,500 1440,500 Z" stroke="none" stroke-width="0" class="transition-all duration-300 ease-in-out delay-150 path-0"></path>
                                    </svg>
                                </div>

                            </a>
                        </div> 
                    </div>
                    <div class="service-title-box">
                        <a href="<?php the_permalink(); ?>"> <h4 class="inner-area-title "><?php the_title(); ?></h4></a>
                        <p class="inner-area-text">
                            <?php
                                if(has_excerpt()){
                                  echo get_the_excerpt();
                                 }else{
                                  echo luzuk_excerpt( get_the_content() , 80 );
                                 } 
                             ?>
                        </p> 
                    <?php
                        $ser_button1 = get_theme_mod('ser_button1', 'READ MORE');
                    ?>
                    <?php if( get_theme_mod('ser_button1_display','show' ) == 'show') : ?>

                    <?php if($ser_button1) { ?>
                        <div class="btn5">  
                            <a href="<?php echo esc_url(get_permalink()); ?>">
                                <?php echo $ser_button1 ?>
                            </a>
                        </div> 
                    <?php }?>
                      <?php endif ?>
                    </div>
                     
                    <div class="clearfix"></div>
                </div>
                <div class="clearfix"></div> 
            </div>             
        </div>


                <?php
            endwhile;
            $text = ob_get_contents();
            ob_clean();
        endif;
        wp_reset_postdata();
        return $text;
    }


function serviceInnerpageShortCode($pageId = null, $isCustomizer = false, $i = null) {
    ob_start();

    $args = array('post_type' => 'our-services');
    if (!empty($pageId)) {
        $args['page_id'] = absint($pageId);
    }
    $args['posts_per_page'] = -1;
    $colCls = '';
    // if($isCustomizer == true){
    $cols = get_theme_mod('serviceinner_npp_count',2);  
    //$services_page_icon1 = get_theme_mod('services_page_icon1'.$i);

    ++$cols;
    switch ($cols) {
       case 1:
                        $colCls = 'col-md-12 col-sm-12 col-xs-12';
                        break;
                        case 2: 
                        $colCls = 'col-md-6 col-sm-6 col-xs-12';
                        break;
                        case 3:
                        case 5:
                        case 6:
                        case 9:
                        case 11:
                        case 13:
                        case 15:
                        $colCls = 'col-md-4 col-sm-6 col-xs-12';
                        break;
                        default: 
                        $colCls = 'col-md-3 col-sm-6 col-xs-12';
                        break;
        }
    // }
        $text = '';
        $query = new WP_Query($args);
        if ($query->have_posts()):
            $postN = 0;

            while ($query->have_posts()) : $query->the_post();
                $luzuk_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'total-service-thumb');
                $post = get_post();

                 $servicesNum = get_post_meta($post->ID, 'servicesNum', false);
                    $services_Num = !empty($servicesNum[0]) ? $servicesNum[0] : '';
                ?>
        <!-- <div class="<?php echo $colCls;?> single-service-bx"> -->
        <div class="item inser">
<!--inner page  -->
        <div ser-match-height="groupName" class="servicesinn">
            <div class="single-service">
                <div class="service-icon padding0">
                   <?php
                        if (has_post_thumbnail()) {
                            $image_url = $luzuk_image[0];
                        } else {
                            $image_url = get_template_directory_uri() . '/images/services.jpg';
                        }
                    ?>
                    <div class="ser-img">
                        <a href="<?php the_permalink(); ?>">
                            <img class="img-responsive" src="<?php echo esc_url($image_url); ?>" alt="<?php the_title(); ?>" />
                            <div class="ovrly"></div>

                        </a>
                    </div> 
                </div>
                <!-- <a href="<?php the_permalink(); ?>"> -->
                    
                <!-- </a> -->
                <div class="service-title-box">
                    <a href="<?php the_permalink(); ?>"> <h4 class="post-title inner-area-title wow fadeInDown"><?php the_title(); ?></h4></a>
                    <p class="post-text inner-area-text wow fadeInDown"> <?php
                        if(has_excerpt()){
                          echo get_the_excerpt();
                         }else{
                          echo luzuk_excerpt( get_the_content() , 100 );
                         } 
                        ?>
                    </p>  
                    <?php
                        $ser_button = get_theme_mod('ser_button', 'Read More');
                    ?>
                        <?php if($ser_button) { ?>
                            <div class="btn5">  
                                <a href="<?php echo esc_url(get_permalink()); ?>">
                                    <?php echo $ser_button ?> 
                                </a>
                            </div> 
                        <?php }?>
                </div>
               
            <div class="clearfix"></div>
            </div>  
        </div>
        <!--inner page  --> 
        <script>
                jQuery.noConflict();
                $(function(){
                    function singleserviceHeight(){
                        var ht = 0;
                        $('#innerpage-box .single-service').each(function(i){
                            var tHt = $(this).height();
                            if(ht<tHt){
                                ht=tHt;
                            }
                        });
                        $('#innerpage-box .single-service').height(ht+'px');
                    }
                    singleserviceHeight();
                });
                $( window ).resize(function(){
                    singleserviceHeight();
                });
            </script>   
 </div>

   
            <?php
        endwhile;
        $text = ob_get_contents();
        ob_clean();
    endif;
    wp_reset_postdata();
    return $text;
}




/*events*/
function eventShortCode($pageId = null, $isCustomizer = false, $i = null) {

    ob_start();

    $args = array('post_type' => 'our-events');
    if (!empty($pageId)) {
        $args['page_id'] = absint($pageId);
    }
    $args['posts_per_page'] = -1;
    $colCls = '';
    // if($isCustomizer == true){
    $cols = get_theme_mod('event_npp_count',2);  
    $events_page_icon1 = get_theme_mod('events_page_icon1'.$i);

    ++$cols;
    switch ($cols) {
   
        case 1:
        $colCls = 'col-md-12 col-sm-12';
        break;
        case 2: 
        $colCls = 'col-md-6 col-sm-6';
        break;
        case 3:
        case 5:
        case 6:
        case 9:
        case 11:
        case 13:
        case 15:
        $colCls = 'col-md-4 col-sm-6';
        break;
        default: 
        $colCls = 'col-md-3 col-sm-6';
        break;
        }
    // }
        $text = '';
        $query = new WP_Query($args);
        if ($query->have_posts()):
            $postN = 0;

            while ($query->have_posts()) : $query->the_post();
                $luzuk_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'total-event-thumb');
                $post = get_post();

                 $eventsNum = get_post_meta($post->ID, 'eventsNum', false);
                    $events_Num = !empty($eventsNum[0]) ? $eventsNum[0] : '';
                ?>
        <div class="<?php echo $colCls;?> ">
            <div class=" single-event-bx">
            <div class="single-event">
               <?php
                    if (has_post_thumbnail()) {
                        $image_url = $luzuk_image[0];
                    } else {
                        $image_url = get_template_directory_uri() . '/images/events.jpg';
                    }
                ?>
                <a href="<?php the_permalink(); ?>">
                <div class="event-img">
                    <img class="img-responsive" src="<?php echo esc_url($image_url); ?>" alt="<?php the_title(); ?>" />
                    <div class="eve-wave">
                        <svg width="100%" height="100%" id="svg" viewBox="0 0 1440 500" xmlns="http://www.w3.org/2000/svg" class="transition duration-300 ease-in-out delay-150">
                            <path d="M 0,500 C 0,500 0,250 0,250 C 96.66410256410259,285.0769230769231 193.32820512820518,320.15384615384613 274,309 C 354.6717948717948,297.84615384615387 419.35128205128194,240.46153846153848 493,234 C 566.6487179487181,227.53846153846152 649.2666666666669,271.99999999999994 733,285 C 816.7333333333331,298.00000000000006 901.5820512820512,279.53846153846155 985,252 C 1068.4179487179488,224.46153846153842 1150.4051282051282,187.84615384615387 1226,186 C 1301.5948717948718,184.15384615384613 1370.797435897436,217.07692307692307 1440,250 C 1440,250 1440,500 1440,500 Z" stroke="none" stroke-width="0" class="transition-all duration-300 ease-in-out delay-150 path-0"></path>
                        </svg>
                    </div>
                </div> 
                </a>   
               
                <div class="event-title-box ">
                    <div class="boxinn">
                        <div class="datepalce"><?php echo ($events_Num);  ?></div>
                        <a href="<?php the_permalink(); ?>"> <h4 class="inner-area-title "><?php the_title(); ?></h4></a>
                        <p> <?php
                            if(has_excerpt()){
                              echo get_the_excerpt();
                             }else{
                              echo luzuk_excerpt( get_the_content() , 150 );
                             } 
                            ?>
                        </p>
                        <?php if( get_theme_mod('event_button_display','show' ) == 'show') : ?>

                            <?php
                                $event_button = get_theme_mod('event_button', 'Read Full');
                            ?>

                            <div class="btn5">  
                                <a href="<?php echo esc_url(get_permalink()); ?>">
                                    <?php echo $event_button ?>
                                </a>
                            </div>
                        <?php endif ?>
                    </div>  
                </div>
                <div class="clearfix"></div>
            </div> 
            <div class="clearfix"></div>
        </div>  
        <script>
            jQuery.noConflict();
            $(function(){
                function singleeventHeight(){
                    var ht = 0;
                    $('#innerpage-box .single-event').each(function(i){
                        var tHt = $(this).height();
                        if(ht<tHt){
                            ht=tHt;
                        }
                    });
                    $('#innerpage-box .single-event').height(ht+'px');
                }
                singleeventHeight();
            });
            $( window ).resize(function(){
                singleeventHeight();
            });
        </script>
    </div>
            <?php
        endwhile;
        $text = ob_get_contents();
        ob_clean();
    endif;
    wp_reset_postdata();
    return $text;
}


function eventInnerpageShortCode($pageId = null, $isCustomizer = false, $i = null) {
    ob_start();

    $args = array('post_type' => 'our-events');
    if (!empty($pageId)) {
        $args['page_id'] = absint($pageId);
    }
    $args['posts_per_page'] = -1;
    $colCls = '';
    // if($isCustomizer == true){
    $cols = get_theme_mod('event_npp_count',2);  
    $events_page_icon1 = get_theme_mod('events_page_icon1'.$i);

    ++$cols;
    switch ($cols) {
   
        case 1:
        $colCls = 'col-md-12 col-sm-12';
        break;
        case 2: 
        $colCls = 'col-md-12 col-sm-12';
        break;
        case 3:
        case 5:
        case 6:
        case 9:
        case 11:
        case 13:
        case 15:
        $colCls = 'col-md-12 col-sm-12';
        break;
        default: 
        $colCls = 'col-md-12 col-sm-12';
        break;
        }
    // }
        $text = '';
        $query = new WP_Query($args);
        if ($query->have_posts()):
            $postN = 0;

            while ($query->have_posts()) : $query->the_post();
                $luzuk_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'total-event-thumb');
                $post = get_post();

                 $eventsNum = get_post_meta($post->ID, 'eventsNum', false);
                    $events_Num = !empty($eventsNum[0]) ? $eventsNum[0] : '';
                ?>
     
    <div class="<?php echo $colCls;?> eventbxinn">
<!--inner page  -->
        <div class="single-event-bxinn">
            <div class="single-event">
               <?php
                    if (has_post_thumbnail()) {
                        $image_url = $luzuk_image[0];
                    } else {
                        $image_url = get_template_directory_uri() . '/images/events.jpg';
                    }
                ?>
                <div class="col-md-5 col-sm-6 evnleft">
                    <div class="event-img">
                        <a href="<?php the_permalink(); ?>">
                            <img class="img-responsive" src="<?php echo esc_url($image_url); ?>" alt="<?php the_title(); ?>" />  
                        </a>
                    </div>
                    <div class="clearfix"></div> 
                </div>
                <div class="col-md-7 col-sm-6 evnright">
                    <div class="event-title-box ">
                        <div class="boxinn">
                            <div class="datepalce"><?php echo ($events_Num);  ?></div>
                            <a href="<?php the_permalink(); ?>"> <h3 class="inner-area-title "><?php the_title(); ?></h3></a>
                            <p> <?php
                                if(has_excerpt()){
                                  echo get_the_excerpt();
                                 }else{
                                  echo luzuk_excerpt( get_the_content() , 280 );
                                 } 
                                ?>
                            </p>
                            <?php
                                $event_button1 = get_theme_mod('event_button1', 'See More');
                            ?>
                            <?php if($event_button1 ){ ?>
                            <div class="btn5">  
                                <a href="<?php echo esc_url(get_permalink()); ?>">
                                <?php echo $event_button1 ?> <i class="fa fa-long-arrow-right" ></i>
                                </a>
                            </div>
                            <?php }?>
                        </div>  
                    </div>
                    <div class="clearfix"></div> 
                </div>
                <div class="clearfix"></div>
            </div> 
        </div> 
        <!-- </div> -->
        <!--inner page  --> 
    <script>
            jQuery.noConflict();
            $(function(){
                function singleeventbxinnHeight(){
                    var ht = 0;
                    $('#innerpage-box .single-event-bxinn').each(function(i){
                        var tHt = $(this).height();
                        if(ht<tHt){
                            ht=tHt;
                        }
                    });
                    $('#innerpage-box .single-event-bxinn').height(ht+'px');
                }
                singleeventbxinnHeight();
            });
            $( window ).resize(function(){
                singleeventbxinnHeight();
            });
    </script>   
    </div>
            <?php
        endwhile;
        $text = ob_get_contents();
        ob_clean();
    endif;
    wp_reset_postdata();
    return $text;
}




/**
 * Use for the show the gallery at home page and in testimonial page with shortcode
 * @param int $pageId default is null the id of a post
 * @param boolean $isCustomizer default is false if set to true it mean the output is set for the home page
 * @param int $i default null
 * @param boolean $showStaticVals default is false
 * @return string
 * @author Luzuk <support@luzuk.com>
 * */

/*gallery*/ 

function galleryShortCode($pageId = null, $isCustomizer = false, $i = null) {

    ob_start();

    $args = array('post_type' => 'our-gallery');
    if (!empty($pageId)) {
        $args['page_id'] = absint($pageId);
    }
    $args['posts_per_page'] = -1;
    $colCls = '';
    // if($isCustomizer == true){
    $cols = get_theme_mod('luzuk_gallery_npp_count', 7);  
    ++$cols;
    switch ($cols) {
                    case 1:
                    $colCls = 'col-md-12 col-sm-12 col-xs-12'; 
                    break;
                    case 2:
                    $colCls = 'col-md-6 col-sm-6 col-xs-12';
                    break;
                    case 3:
                    case 5:
                    case 6:
                    case 9:
                    $colCls = 'col-md-4 col-sm-6 col-xs-12';
                    break;
                    case 4:
                    case 7:
                    case 8:
                    case 10:
                    case 11:
                    case 12:
                    $colCls = 'col-md-4 col-sm-6 col-xs-12';
                    break;
                    default:
                    $colCls = 'col-md-3 col-sm-6 col-xs-12';
                    break;
    }
    // }
    $text = '';
    $query = new WP_Query($args);
    if ($query->have_posts()):
        $postN = 0;

        while ($query->have_posts()) : $query->the_post();
            $luzuk_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium_large');
            $post = get_post();
            ?> 

        <div class="<?php echo $colCls; ?>">
            <div class="lz-gallery-images">
                <figure class="spa-gall">
                    <div class="box">
                    <?php
                        if (has_post_thumbnail()) {
                            $image_url = $luzuk_image[0];
                        } else {
                            $image_url = get_template_directory_uri() . '/images/about1.jpg';
                        }
                    ?>
                     <a class="group1" href="<?php echo esc_url($image_url); ?>" title="<?php the_title(); ?>"> 
                        <img class="secondry-bg img-responsive" src="<?php echo esc_url($image_url); ?>" alt="<?php the_title(); ?>" />
                        <div class="ovlay"></div>
                        <div class="gall-icn">
                            <i class="fa fa-search-plus" aria-hidden="true"></i>
                        </div>
                        <div class="over-text">
                            <h3 class="inner-area-title "><?php the_title(); ?></h3>
                        </div> 
                    </a>
                    </div>
                </figure>
            </div>
        </div> 
                <?php
            endwhile;
            $text = ob_get_contents();
            ob_clean();
        endif;
        wp_reset_postdata();
        return $text;
    }



 /**
     * Use for the show the testimonials at home page and in testimonial page with shortcode
     * @param int $pageId default is null the id of a post
     * @param boolean $isCustomizer default is false if set to true it mean the output is set for the home page
     * @param int $i default null
     * @param boolean $showStaticVals default is false
     * @return void
     * @author Luzuk <support@luzuk.com>
     * */
    function pricingShortcode() {
      ob_start();
      $cols = get_theme_mod('pricing_npp_count', 2);
      $cols++;
      switch ($cols) {
        case 1:
            $colCls = 'col-md-12 col-sm-12 col-xs-12';
            break;
            case 2: 
            $colCls = 'col-md-6 col-sm-6 col-xs-12';
            break;
            case 3:
            case 5:
            case 6:
            case 9:
            case 11:
            case 13:
            case 15:
            $colCls = 'col-md-4 col-sm-6 col-xs-12';
            break;
            default: 
            $colCls = 'col-md-6 col-sm-6 col-xs-12';
            break;
    }

    $showStatic = true;
    for ($i = 1; $i <= $cols; $i++) {
        $PlanPageId = get_theme_mod('pricing_plan_page_' . $i);
        $pricing_page_icon = get_theme_mod('pricing_plan_page_icon_'.$i);
        $planTitle  = get_theme_mod('pricing_plan_name_' . $i, 'Standard Plan');
        $planunit  = get_theme_mod('pricing_plan_unit_' . $i,'$');
        $planPrice  = get_theme_mod('pricing_plan_price_' . $i,'30');
        $planPday  = get_theme_mod('planPday_' . $i,'/ Day');
        $planContent= get_theme_mod('pricing_plan_content_' . $i, '
            
            <li>All Time Free Wifi</li>
            <li>Home Made Food</li>
            <li>AC & Bathtub</li>');

        $link = get_theme_mod('pricing_plan_url'.$i);
        $url = get_theme_mod('pricing_plan_url_'.$i, '#');

        if ($PlanPageId || $planTitle || $planunit || $planPrice || $planPday || $planContent || $url || $pricing_page_icon) {
          $showStatic = false;
          ?>
          <div class="<?php echo $colCls; ?> ">
            <div class="single-pricing wow zoomIn">
            <div class="pr-s-area">
                <h4 class="plan-title inner-area-title" href="#">
                    <?php echo ($planTitle); ?>
                </h4>
               
                <svg viewbox="0 0 100 25">
                    <path fill="#fff" d="M0 30 V19 Q30 28 50 20 T100 25 V30z" />
                </svg>
            </div>
            <div class="textbx">
             <div class="currency-price"><?php echo ($planunit); ?><?php echo ($planPrice); ?> <span><?php echo ($planPday); ?></span></div>
            <ul class="pricing-list section-area-text wow slideInLeft"> <?php echo ($planContent); ?></ul>
            
            <?php
            $pricing_page_id = get_theme_mod('pricing_page');
            $pricing_page_button_title = get_theme_mod('pricing_page_button_title_'.$i, 'BOOK NOW');
            ?>
            <?php if($pricing_page_button_title){ ?>
                <div class="pc-btn" data-wow-duration="4s">    
                    <a class="btn btn-lg" href="<?php echo esc_url(!empty($url)?$url:'#');?>" data-hover="/f178" >
                       <?php echo ($pricing_page_button_title);  ?>
                    </a>
                </div>
              

            <?php } ?>
            </div>
        </div>
    </div>
    <?php
}
}
if ($showStatic === true) {
  for ($i = 1; $i <= $cols; $i++) {
    $link = get_theme_mod('pricing_plan_url'.$i);
    $url = get_theme_mod('pricing_plan_url_'.$i, '#');

    ?>
    <div class="<?php echo $colCls; ?> plan">
      <div class="pricing-plans">

        <div class="price-box">
          <div class="price-bx">

            <div class="plan-cost">$30</div>
        </div>
        <div class="clearfix"></div>
        <h4 class="plan-title">STANDARD</h4>
        <div class="table-content">
        Excepteur sint occaecat cupidatat non proi dent sunt in culpa.
     </div>
     <div class="clearfix"></div>
     <div class="pri-table-link">
      <a class="btn" href="#">DETAILS</a>
  </div>
</div>
<!-- <div class="clearfix"></div> -->
</div>
</div>
<?php
}

}

$pricingHtml = ob_get_contents();
        // echo $pricingHtml;
ob_flush();
ob_clean();
}

