<?php
  $getPostAsk->execute(array(
    'seo_url'    => $_GET["seo_url"],
    'post_type'  => 'post_post'
  ));
  $postDataCheck=$getPostAsk->fetch(PDO::FETCH_ASSOC);
?>
              <div class="tp-page-title-area pt-180 pb-185 position-relative fix" data-background="<?php echo $postDataCheck['banner']; ?>">
            <div class="tp-custom-container">
                <div class="row">
                    <div class="col-12">
                        <div class="tp-page-title z-index">
                            <h2 class="breadcrumb-title"><?php echo $postDataCheck['title']; ?></span></h2>
                            <div class="breadcrumb-menu">
                                <nav class="breadcrumb-trail breadcrumbs">
                                    <ul class="trail-items">
                                      <li class="trail-item trail-begin"><a href="<?php echo $generalSettingCheck['site_url']; ?>"><?php echo $langArray['LINK_HOME']; ?></a></li>
                                     
                                        <li class="trail-item trail-end"><span><?php echo $postDataCheck['title']; ?></span></li>
                                    </ul>
                                </nav>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
  
        <section class="blog-details-area pt-120 pb-70">
            <div class="container">
                <div class="tp-custom-container-box">
                    <div class="row">
                        <div class="col-lg-9">
                            <div class="blog__details--wrapper mr-50 mb-50">
                                <div class="ablog ablog-4 mb-55">
                                    <div class="ablog__img wow fadeInUp">
                                        <img src="<?php echo $postDataCheck['banner']; ?>" class="img-fluid" alt="<?php echo $postDataCheck['title']; ?>">
                                    </div>
                                    <div class="ablog__text ablog__text4">
                                       
                                        <h3 class="ablog__text--title4 mb-20"><?php echo $postDataCheck['title']; ?></h3>
                                        <p class="mb-30"><?php echo $postDataCheck['content']; ?></p>
                                   
                                    </div>
                                </div>

                                

                                <div class="post-comments mb-95 wow fadeInUp">
                                  
                                    <div class="latest-comments">
                                        <ul>
                                            <ul class="social-box pull-right">
                        <span class="share--title"><?php echo $langArray['SHARE_TEXT']; ?></span>
             <div class="a2a_kit a2a_kit_size_32 a2a_default_style">
               <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
               <a class="a2a_button_facebook"></a>
               <a class="a2a_button_twitter"></a>
               <a class="a2a_button_email"></a>
               <a class="a2a_button_pinterest"></a>
               <a class="a2a_button_linkedin"></a>
               <a class="a2a_button_reddit"></a>
               <a class="a2a_button_whatsapp"></a>
             </div>
             <script>
             var a2a_config = a2a_config || {};
             a2a_config.locale = "tr";
             </script>
             <script async src="https://static.addtoany.com/menu/page.js"></script>
                    </ul>
                                        </ul>
                                    </div>
                                </div>

                        
                            </div>
                        </div>
                        <div class="col-lg-3">
                            <div class="ablog__sidebar mb-50">
                                 <div class="widget mb-40 wow fadeInUp"  data-wow-delay=".7s">
                                    <h3 class="sidebar__widget--title mb-25"><?php echo $langArray['HEAD_CATEGORIES']; ?></h3>
                                    <div class="sidebar--widget__cat mb-20">
                                         <?php
             $allCategories = array();
             $allCatCheck=$db->query("SELECT * FROM categories where language={$getLangCheck['language_id']} and categories_type='post_categories'", PDO::FETCH_ASSOC);
             if ( $allCatCheck->rowCount() ){
               foreach( $allCatCheck as $line ){
                  $allCategories[$line['categories_id']]['categories_id'] = $line['categories_id'];
                  $allCategories[$line['categories_id']]['title'] = $line['title'];
                  $allCategories[$line['categories_id']]['categories_top_id'] = $line['categories_top_id'];
                  $allCategories[$line['categories_id']]['seo_url'] = $line['seo_url'];
               }
             }
             function findCategories($categories){
                $row = array();
                foreach($categories as $category){
                  if($category['categories_top_id'] == 0) $row[] = $category;
                }
                return $row;
             }
             function findSubCategories($topCat,$categories,$again = 2){
                $row = array();
                foreach($categories as $category){
                  if($category['categories_top_id'] == $topCat){
                    $row[] = $category;
                  }
                }
                if(count($row) > 0){
                  foreach($row as $cat){
                    echo '<li><a href="'.$cat['seo_url'].'">'.str_repeat('- ',$again).' '.$cat['title'].'</a></li>';
                    findSubCategories($cat['categories_id'],$categories,$again+1);
                  }
                }
             }
             $mainCategories = findCategories($allCategories);
             echo '
               <ul class="blog-cat">
             ';
              foreach($mainCategories as $category){
                echo '
                 <li><a href="'.$category['seo_url'].'">'.str_repeat('- ',0).' '.$category['title'].'</a></li>
                ';
                findSubCategories($category['categories_id'],$allCategories);
              }
             echo '</ul>';
            ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>