<?php
        
//faq 


//team
function teamShortCode($pageId = null, $isCustomizer = false, $i = null) { 

    ob_start();

    $args = array('post_type' => 'our-team');
    if (!empty($pageId)) {
        $args['page_id'] = absint($pageId);
    }
    $args['posts_per_page'] = -1;
    $colCls = '';
    // if($isCustomizer == true){
    $cols = get_theme_mod('team_area_npp_count', 15);
    $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-12 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();
        $team_area_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'total-team-thumb');
        if ($isCustomizer === true) {
            $team_area_designation = get_theme_mod('team_area_designation' . $i);
            $team_area_facebook = get_theme_mod('team_area_facebook' . $i);
            $team_area_twitter = get_theme_mod('team_area_twitter' . $i);
            $team_area_instagram = get_theme_mod('team_area_instagram' . $i);
            $team_area_pinterest = get_theme_mod('team_area_pinterest' . $i);
        } else {
            $team_area_facebook = '';
            $team_area_twitter = '';
            $team_area_instagram = '';
            $team_area_pinterest = '';
            $team_area_designation = '';
        }

        $post = get_post();
            //Social media urls
        $teamFacebook = get_post_meta($post->ID, 'teamFacebook', false);
        $team_area_facebook = !empty($teamFacebook[0]) ? $teamFacebook[0] : '';

        $teamTwitter = get_post_meta($post->ID, 'teamTwitter', false);
        $team_area_twitter = !empty($teamTwitter[0]) ? $teamTwitter[0] : '';

        $teamInstagram = get_post_meta($post->ID, 'teamInstagram', false);
        $team_area_instagram = !empty($teamInstagram[0]) ? $teamInstagram[0] : '';

         $teamPinterest = get_post_meta($post->ID, 'teamPinterest', false);
        $team_area_pinterest = !empty($teamPinterest[0]) ? $teamPinterest[0] : '';

            //designation
        $designation = get_post_meta($post->ID, 'designation', false);
        $team_area_designation = !empty($designation[0]) ? $designation[0] : '';

        ?>
        <div class="<?php echo $colCls;?> single-team">
        <div class="item single-team">
            <div class="our-team wow zoomIn">
                <div class="single-team-img">
                    <?php if ($team_area_facebook || $team_area_twitter || $team_area_instagram || $team_area_linkedin || $team_area_pinterest) { ?>
                    <div class="team-social-icon">
                        <?php if ($team_area_facebook) { ?>
                            <a target="_blank" href="<?php echo esc_url($team_area_facebook) ?>">
                                <i class="fa fa-facebook"></i></a>
                            <?php } ?>
                            <?php if ($team_area_twitter) { ?>
                                <a target="_blank" href="<?php echo esc_url($team_area_twitter) ?>" ><i class="fa fa-twitter"></i></a>
                            <?php } ?>
                            <?php if ($team_area_instagram) { ?>
                                <a target="_blank" href="<?php echo esc_url($team_area_instagram) ?>" ><i class="fa fa-instagram"></i></a> 
                            <?php } ?>
                               <?php if ($team_area_pinterest) { ?>
                                <a target="_blank" href="<?php echo esc_url($team_area_pinterest) ?>"><i class="fa fa-pinterest"></i></a>
                                <?php } ?>
                              <?php if ($team_area_linkedin) { ?>
                                <a target="_blank" href="<?php echo esc_url($team_area_linkedin) ?>" ><i class="fa fa-linkedin"></i></a> 
                            <?php } ?>
                        </div>
                    <?php } ?>

                    <?php
                        if (has_post_thumbnail()) {
                            $image_url = $team_area_image[0];
                        } else {
                            $image_url = get_template_directory_uri() . '/images/team-thumb.png';
                        }
                    ?>                  
                    <img src="<?php echo esc_url($image_url); ?>" alt="<?php the_title(); ?>" />
                </div>
                    <div class="team-text">
                        <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="311.494" height="69.113" viewBox="0 0 311.494 69.113">
                                  <defs>
                                    <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
                                      <stop offset="0" stop-color="#ffa200"/>
                                      <stop offset="1" stop-color="#ff6f00"/>
                                    </linearGradient>
                                  </defs>
                                  <path id="Rectangle_1" data-name="Rectangle 1" d="M21,851.471H99.255c15.124,0,41.151-39.055,67.148-36.655H327.8v67.007H21Z" transform="translate(-17 -814.71)" fill-rule="evenodd" fill="url(#linear-gradient)"/>
                                  <path id="Rectangle_1-2" data-name="Rectangle 1" d="M17,851.471H99.439c15.158,0,41.243-39.055,67.3-36.655H328.494v67.007H17Z" transform="translate(-17 -812.71)" fill="#fff" fill-rule="evenodd"/>
                                </svg>
                       <h4 class="inner-area-title wow fadeInLeft" data-wow-duration="1s">
                            <?php the_title(); ?>
                        </h4>
                        <div class="team-designation wow fadeInLeft" data-wow-duration="2s">
                            <?php echo ($team_area_designation); ?>
                        </div>
                    <div class="t-olay"></div>
                </div>
                <div class="clearfix"></div>
             </div>
</div>
</div>

            <?php
        endwhile;
        $text = ob_get_contents();
        ob_clean();
    endif;
    wp_reset_postdata();
    return $text;
}
//team
function innteamShortCode($pageId = null, $isCustomizer = false, $i = null) { 

    ob_start();

    $args = array('post_type' => 'our-team');
    if (!empty($pageId)) {
        $args['page_id'] = absint($pageId);
    }
    $args['posts_per_page'] = -1;
    $colCls = '';
    // if($isCustomizer == true){
    $cols = get_theme_mod('team_area_npp_count', 15);
    $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-12 col-xs-12';
        break;
        default: 
        $colCls = 'col-md-4 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();
        $team_area_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'total-team-thumb');
        if ($isCustomizer === true) {
            $team_area_designation = get_theme_mod('team_area_designation' . $i);
            $team_area_facebook = get_theme_mod('team_area_facebook' . $i);
            $team_area_twitter = get_theme_mod('team_area_twitter' . $i);
            $team_area_instagram = get_theme_mod('team_area_instagram' . $i);
            $team_area_pinterest = get_theme_mod('team_area_pinterest' . $i);
        } else {
            $team_area_facebook = '';
            $team_area_twitter = '';
            $team_area_instagram = '';
            $team_area_pinterest = '';
            $team_area_designation = '';
        }

        $post = get_post();
            //Social media urls
        $teamFacebook = get_post_meta($post->ID, 'teamFacebook', false);
        $team_area_facebook = !empty($teamFacebook[0]) ? $teamFacebook[0] : '';

        $teamTwitter = get_post_meta($post->ID, 'teamTwitter', false);
        $team_area_twitter = !empty($teamTwitter[0]) ? $teamTwitter[0] : '';

        $teamInstagram = get_post_meta($post->ID, 'teamInstagram', false);
        $team_area_instagram = !empty($teamInstagram[0]) ? $teamInstagram[0] : '';

         $teamPinterest = get_post_meta($post->ID, 'teamPinterest', false);
        $team_area_pinterest = !empty($teamPinterest[0]) ? $teamPinterest[0] : '';

            //designation
        $designation = get_post_meta($post->ID, 'designation', false);
        $team_area_designation = !empty($designation[0]) ? $designation[0] : '';

        ?>
        <div class="<?php echo $colCls;?> innsingle-team">
    <!-- < inner page >  -->
            <div class="inner-team">
                    <div class="single-team-img">
                        <div class="overlay"></div>
                        <?php if ($team_area_facebook || $team_area_twitter || $team_area_instagram || $team_area_pinterest) { ?>
                                <div class="team-social-icon">
                                <?php if ($team_area_facebook) { ?>
                                        <a target="_blank" href="<?php echo esc_url($team_area_facebook) ?>">
                                        <i class="fa fa-facebook"></i></a>
                                    <?php } ?>
                                    <?php if ($team_area_twitter) { ?>    
                                        <a target="_blank" href="<?php echo esc_url($team_area_twitter) ?>" ><i class="fa fa-twitter"></i></a>
                                    <?php } ?>
                                    <?php if ($team_area_instagram) { ?>
                                        <a target="_blank" href="<?php echo esc_url($team_area_instagram) ?>" ><i class="fa fa-instagram"></i></a> 
                                    <?php } ?>
                                       <?php if ($team_area_pinterest) { ?>
                                        <a target="_blank" href="<?php echo esc_url($team_area_pinterest) ?>"><i class="fa fa-pinterest"></i></a>
                                        <?php } ?>
                                </div>
                            <?php } ?>
                        <?php
                            if (has_post_thumbnail()) {
                                $image_url = $team_area_image[0];
                            } else {
                                $image_url = get_template_directory_uri() . '/images/team-thumb.png';
                            }
                        ?>                  
                        <img src="<?php echo esc_url($image_url); ?>" alt="<?php the_title(); ?>" />
                        <div class="clearfix"></div>
                    </div>
                    <div class="textbx ">
                        <svg id="Group_182" data-name="Group 182" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="396.395" height="87.951" viewBox="0 0 396.395 87.951">
                          <defs>
                            <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
                              <stop offset="0" stop-color="#ffa200"/>
                              <stop offset="1" stop-color="#ff6f00"/>
                            </linearGradient>
                          </defs>
                          <path id="Rectangle_1" data-name="Rectangle 1" d="M21,861.491h99.585c19.246,0,52.367-49.7,85.449-46.645H411.42v85.27H21Z" transform="translate(-15.91 -814.71)" fill-rule="evenodd" fill="url(#linear-gradient)"/>
                          <path id="Rectangle_1-2" data-name="Rectangle 1" d="M17,861.491H121.909c19.289,0,52.484-49.7,85.64-46.645H413.395v85.27H17Z" transform="translate(-17 -812.165)" fill="#fff" fill-rule="evenodd"/>
                        </svg>
                        <div class="inteam-cont">
                            <h1 class="inner-area-title"><?php the_title(); ?> </h1>
                            <div class="team-designation ">
                                <?php echo ($team_area_designation); ?>
                            </div>
                        </div> 
                    </div>
                <div class="clearfix"></div>
            </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 string
 * @author luzuk <support@luzuk.com>
 * */
function testimonialShortCode($pageId = null, $isCustomizer = false, $i = null) {

    ob_start();

    $args = array('post_type' => 'our-testimonial');
    if (!empty($pageId)) {
        $args['page_id'] = absint($pageId);
    }
    $colCls = '';
    // if($isCustomizer == true){
    $cols = get_theme_mod('test_npp_count', 5);
    $cols++;
    switch($cols){
        
            }
           $icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');     
    // }
    $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-team-thumb');
        $post = get_post();

            if (($postN % 3) == 0 && $isCustomizer == false) {
                ?>
                <?php
            }
            ++$postN;
            ?>
        <div class="item innertest-item">
            <div class="tetimonoal-area">
                <div class="ts-area-content">
                        <h3 class="ts-area-title "><?php the_title(); ?></h3>
                          <div class="text-designation">
                                <?php
                                    $name2 = get_post_meta($post->ID, 'testimonial_Sub_Title', false);
                                    echo (!empty($name2[0])) ? $name2[0] : '';
                                 ?> 
                         </div> 
                         <div class="clearfix"></div>
                </div>
                <div class="right-trg"></div>
                    <div class="clearfix"></div>
                <div class="ts-area-single ">
                    <div class="ts-area-thumb">
                            <img src="<?php echo (!empty($luzuk_image[0])) ? $luzuk_image[0] : get_template_directory_uri() . '/images/team-thumb.png' ?>" class="img-responsive" alt="<?php the_title(); ?>" />
                            <div class="ts-bg"></div>
                    </div>
                        <div class="ts-area-c">     
                            <p><?php
                                if (has_excerpt()) {
                                    echo get_the_excerpt();
                                } else {
                                    echo get_the_content();
                                }
                                ?> 
                            </p>    
                        </div>
                        <div class="clearfix"></div>
                 </div>
            </div>
            <!-- innerpage-->
                <div class="ts-area-single-inn">
                    <div class="tsarea-inn">
                        <div class="tes-c">
                            <div class="ts-area-c">
                                <i class="fa fa-quote-left"></i>  
                                <p><?php
                                    if (has_excerpt()) {
                                        echo get_the_excerpt();
                                    } else {
                                        echo get_the_content();
                                    }
                                    ?> 
                                </p>  
                                 <i class="fa fa-quote-right"></i>
                            </div>
                            <div class="col-md-4 col-xs-12 col-sm-12 ts-area-thumb">
                                <div class="imgbg"></div>
                                <img src="<?php echo (!empty($luzuk_image[0])) ? $luzuk_image[0] : get_template_directory_uri() . '/images/team-thumb.png' ?>" class="img-responsive" alt="<?php the_title(); ?>" />
                            </div>
                                <div class="col-md-8 col-xs-12 col-sm-12 ts-area-bx">
                                    <h2 class="ts-area-title "><?php the_title(); ?></h2>
                                    <div class="text-designation">
                                        <?php
                                            $name2 = get_post_meta($post->ID, 'testimonial_Sub_Title', false);
                                            echo (!empty($name2[0])) ? $name2[0] : '';
                                         ?> 
                                    </div>
                                    <div class="clearfix"></div>
                                </div>
                                <div class="clearfix"></div>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <!-- <script>
                jQuery.noConflict();
                $(function(){
                    function tsareasingleinnHeight(){
                        var ht = 0;
                        $('#innerpage-box .ts-area-single-inn').each(function(i){
                            var tHt = $(this).height();
                            if(ht<tHt){
                                ht=tHt;
                            }
                        });
                        $('#innerpage-box .ts-area-single-inn').height(ht+'px');
                    }
                    tsareasingleinnHeight();
                });
                $( window ).resize(function(){
                    tsareasingleinnHeight();
                });
            </script> -->
            <!--innerpage-->
           <script>
                jQuery.noConflict();
                $(function(){
                    function tsareacHeight(){
                        var ht = 0;
                        $('.testimonials-area .ts-area-c p').each(function(i){
                            var tHt = $(this).height();
                            if(ht<tHt){
                                ht=tHt;
                            }
                        });
                        $('.testimonials-area .ts-area-c p').height(ht+'px');
                    }
                    tsareacHeight();
                });
                $( window ).resize(function(){
                    tsareacHeight();
                });
            </script>
        </div>

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


/*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',3);  
    //$services_page_icon1 = get_theme_mod('services_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-4 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-service-thumb');
            $post = get_post();

            ?>
        <div class="<?php echo $colCls; ?> single-service-bx wow zoomIn"> 
            <div class="single-service wow zoomIn">
                <div class="overlay"></div>
                        <a href="<?php the_permalink(); ?>">
                            <div class="service-containt">
                          <h4 class="post-title inner-area-title wow fadeInDown"> <?php the_title(); ?></h4>
                          <div class="service-text">
                          <p class="section-area-text">
                            <?php 
                               if (has_excerpt()) {
                                          echo get_the_excerpt();
                                      } else {
                                          echo luzuk_excerpt(get_the_content(),160);  
                                   }
                              ?>
                              </p>
                          </div>
                          </div>
                          <?php
                            if (has_post_thumbnail()) {
                                $image_url = $luzuk_image[0];
                            } else {
                                $image_url = get_template_directory_uri() . '/images/services.jpg';
                            }
                            ?> 
                          <img class="img-responsive" src="<?php echo esc_url($image_url); ?>" alt="<?php the_title(); ?>" />
                        </a>
                        <div class="clearfix"></div>
            </div>
        </div>
        <!-- inner-page -->
        <div class="col-md-4 col-sm-6 col-xs-12 inn-single-service-bx">
            <div class="singleinner-service">
                <div class="overlay"></div>
                    <a href="<?php the_permalink(); ?>">
                           <?php
                            if (has_post_thumbnail()) {
                                $image_url = $luzuk_image[0];
                            } else {
                                $image_url = get_template_directory_uri() . '/images/services.jpg';
                            }
                            ?>      
                        <div class="innservice-containt">
                            <h4 class="title"><?php the_title(); ?> </h4>
                            <div class="innservice-text">
                                <p class="innservice-text-area">
                                    <?php
                                    if (has_excerpt()) {
                                        echo get_the_excerpt();
                                    } else {
                                        echo get_the_content();
                                    }
                                    ?> 
                                </p>
                            </div>
                        </div>                                                  
                            <img class="img-responsive" src="<?php echo esc_url($image_url); ?>" alt="<?php the_title(); ?>" />
                    </a>
                                
            </div>
        </div>
        
        <!-- inner-page -->

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



/**
 * Use for the show the pricing 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>
 * */


// ==========================
/*********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-6 col-sm-6 col-xs-12';
                    break;
                    case 4:
                    case 7:
                    case 8:
                    case 10:
                    case 11:
                    case 12:
                    $colCls = 'col-md-6 col-sm-6 col-xs-12';
                    break;
                    default:
                    $colCls = 'col-md-6 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; ?> pd-1">  
        <div class="homegalry"> 
            <div class="lz-gallery-images wow zoomIn">
                <figure class="spa-gall">
                    <?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="over-text">
                            <h3 class="inner-area-title "><?php the_title(); ?></h3>
                        </div>
                        <div class="g-oly"></div>
                        <div class="gall-icn">
                            <i class="fa fa-plus"></i>
                        </div>
                    </a> 
                </figure>
            </div>
        </div> 
        
         <script>
            jQuery.noConflict();
            $(function(){
                function lzgalleryimagesinbox(){
                    var ht = 0;
                    $('#innerpage-box .lz-gallery-images').each(function(i){
                        var tHt = $(this).height();
                        if(ht<tHt){
                            ht=tHt;
                        }
                    });
                    $('#innerpage-box .lz-gallery-images').height(ht+'px');
                }
                lzgalleryimagesinbox();
            });
            $( window ).resize(function(){
                lzgalleryimagesinbox();
            });
        </script>
    </div>
                <?php
            endwhile;
            $text = ob_get_contents();
            ob_clean();
        endif;
        wp_reset_postdata();
        return $text;
    }



