<?php 
global $yahosein;
 ?>
    <section class="c-sections zekr_aiyam_mazhabi">
        <div class="container">
            <div class="row">
                <div class="col-md-12 ">
                    <div class="text_zekr">
                        <?php 
                        $main_color = $yahosein['opt-site-scheme'];
                        $main_color  = str_replace('#','',$main_color );
                         ?>
                        <img class="namad" src="<?php echo get_template_directory_uri(); ?>/layouts/img/<?php echo $main_color; ?>-zakre_ayam.png" alt="">
                        <span class="text_sabet_ayam"><b>ذکر ایام هفته:</b></span>
                        <span class="matne_zekr"><?php yahosein_zekr_hafte(); ?></span>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <?php
    if(isset($yahosein['opt-slide-enable']) && $yahosein['opt-slide-enable']==1):
        $slides = roman_get_slideshow_items($yahosein['opt-slide-cat']);
        if(!empty( $slides)):
            ?>
            <section class="c-sections  carousel_mazhabi">
                <div class="container">
                    <div class="row">
                        <div class="col-md-12 col-sm-12 col-xs-12">
                            <div id="myCarousel" class="carousel slide" data-ride="carousel">
                                <div class="col-md-3 col-sm-3 hidden-xs">
                                    <ol class="carousel-indicators">
                                    <?php
                                    $counter = 0;
                                    foreach ($slides as $slide) {
                                        ?>
                                        <li data-target="#myCarousel" data-slide-to="<?php echo $counter; ?>" class="<?php if($counter==0){echo 'active';} ?>"><img src="<?php echo get_the_post_thumbnail_url($slide,'slide-show');  ?>" alt="<?php echo esc_attr($slide->post_title ); ?>">
                                            <aside class="text_caption"><?php echo ($slide->post_title ); ?></aside>
                                        </li>
                                        <?php
                                        $counter++;
                                    }
                                    ?>



                                    </ol>

                                </div>
                                <div class="col-md-9 col-sm-9 col-xs-12 carousel_size">
                                    <div class="carousel-inner">
                                    <?php
                                    $counter = 0;
                                    foreach ($slides as $slide)
                                    {
                                        ?>
                                        <div class="item <?php if($counter==0){echo 'active';} ?>">
                                        <a title="<?php echo esc_attr($slide->post_title); ?>" href="<?php the_permalink($slide->ID); ?>">
                                            <img src="<?php echo get_the_post_thumbnail_url($slide,'slide-show');  ?>" alt="<?php echo esc_attr($slide->post_title ); ?>" style="width:100%;">
                                            <div class="carousel-caption">
                                                <?php
                                                if(isset($yahosein['opt-slide-enable-caption']) && $yahosein['opt-slide-enable-caption']==1)
                                                {
                                                    echo '<h5>'.$slide->post_title.'</h5>';

                                                }
                                                ?>
                                            </div>
                                        </a>
                                        </div>
                                        <?php
                                        $counter++;
                                    }
                                    ?>

                                        <a class="hidden-lg hidden-md hidden-sm left carousel-control" href="#myCarousel" role="button" data-slide="next"><span class="fa fa-chevron-left "></span></a>

                                        <a class="hidden-lg hidden-md hidden-sm right carousel-control" href="#myCarousel" role="button" data-slide="prev"><span class="fa fa-chevron-right "></span></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php else:
            echo '<div class="col-md-6 col-md-offset-3"><a href="'.admin_url('admin.php?page=yahosein').'">دسته ای برای اسلاید مشخص نشد،لطفا از تنظیمات قالب اقدام کنید</a></div><div class="clearfix"></div>'; ?>
        <?php endif; # slide existance  ?>
        <?php endif; # slideshow  ?>

    <section class="c-sections index_contact_mazhabi">
        <div class="container">
            <div class="row index_contact_mazhabi_masonry">
							<?php get_sidebar(); ?>
						</div>
				</div>
    </section>

    <?php 
     if(isset($yahosein['opt-footer-cat-enable']) && $yahosein['opt-footer-cat-enable']==1){
        $tabs =array();
        $contents = array();
        $counter = 0;
        $num = isset($yahosein['opt-footer-cat-num'])?$yahosein['opt-footer-cat-num']:3;
        for ($i = 0; $i < $num; $i++)
        {
            $id = 'opt-footer-cat-' . $i;
            $cat = $yahosein[$id];
            if(empty($cat)) continue;
            $class = '';
            $div_id = 'home'.$i;
            if($counter==0){$class=' active in ';}$counter++;
            $tabs[]='<li class="'.$class.'"><a data-toggle="pill" data-target="#'.$div_id.'" href="#'.$div_id.'">'.get_cat_name( $cat ).'</a></li>';
            
            $contents[]  =yahosein_cat_section($cat,4,$class,$div_id);

        }
        if(count($tabs)>0)
        {
        ?>
        <section class="c-sections meno_tabi_mazhabi">
            <div class="container">
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <ul class="nav nav-pills">
                            <?php 
                                echo implode('',$tabs);
                             ?>
                        </ul>
                        <hr class="meno-tabi ">
                        <div class="tab-content widget_content_border ">
                            <?php 
                                echo implode('',$contents);
                             ?>                            
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <?php  
        }

    }
    ?>
