<?php
    session_start();
    include_once('../../admin/db/saucerer.php');


if (empty($_GET['listing'])) {
  header('location:../');
} else {
$listing = $_GET['listing'];
}

$sql = "SELECT count(*) FROM listings WHERE url='$listing'"; 

$result = $conn->query($sql); 

while($row = mysqli_fetch_array($result)) { 

       if ($row['count(*)']==0) {
          header('location:../');
        } 
    }

//selecting data associated with this particular id
$result = mysqli_query($mysqli, "SELECT * FROM listings WHERE url='$listing'");

while($row = mysqli_fetch_array($result))
{
    $id = $row['id'];
    $code = $row['code'];
    $title = $row['title'];
    $cat = $row['cat'];
    $sub = $row['sub'];
    $email = $row['email'];
    $phone = $row['phone'];
    $address = $row['address'];
    $district = $row['district'];
    $country = $row['country'];
    $hr_open = $row['hr_open'];
    $hr_close = $row['hr_close'];
    $services = $row['services'];
    $paragraph1 = $row['paragraph1'];
    $phone1 = $row['phone1'];
    $phone2 = $row['phone2'];
    $facebook = $row['facebook'];
    $instagram = $row['instagram'];
    $twitter = $row['twitter'];
    $youtube = $row['youtube'];
    $website = $row['website'];
    $image = $row['image'];
    $image1 = $row['image1'];
    $image2 = $row['image2'];
    $image3 = $row['image3'];
    $image4 = $row['image4'];
    $image5 = $row['image5'];
    $image6 = $row['image6'];
    $summ1 = $row['summ1'];
    $summ2 = $row['summ2'];
    $summ3 = $row['summ3'];
    $summ4 = $row['summ4'];
    $summ5 = $row['summ5'];
    $summ6 = $row['summ6'];
    $url = $row['url'];

    if ($row['g_maps']) {
        $g_maps = $row['g_maps'];
    } else {
        $g_maps = '#!';
    }
    
}

?>

<!doctype html>
<html lang="en">
    <head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <link rel="icon" href="../../image/favicon/1.png" type="image/png">
        <title><?php echo $title; ?> | FitBora &copy;</title>

    <meta name="description" content="The fitness & wellness network">

    <meta name="keywords" content="<?php echo $title; ?>, <?php echo $district; ?>, <?php echo $services; ?> Kampala, Uganda">


 <!-- Social Share Data -->

    <meta content="text/html; charset=utf-8" name="Content-Type">

     <meta property="og:type" content="article">

    <meta property="og:image" content="https://fitbora.net/admin/blogs/images/<?php echo $image1; ?>">

    <!--  Less than 65 characters -->
    <meta property="og:title" content="<?php echo $title; ?> on FitBora &copy;">

    <meta property="og:url" content="https://fitbora.net/blog">

 <!--  Less than 300 characters -->
    <meta property="og:description" content="The fitness & wellness network">

    <meta property="og:site_name" content="<?php echo $title; ?> on FitBora &copy;">
    
    <!-- Twitter Cards -->

    <meta name="twitter:card" content="summary_large_image">

    <meta name="twitter:url" content="https://fitbora.net/blog">

    <meta name="twitter:title" content="<?php echo $title; ?> on FitBora &copy;">

    <meta name="twitter:description" content="The fitness & wellness network">

    <meta name="twitter:image" content="https://fitbora.net/admin/blogs/images/<?php echo $image1; ?>">

    <meta name="twitter:site" content="@fitbora">

    <meta name="twitter:creator" content="@iann_thecreator">


        <!-- Bootstrap CSS -->
        <link rel="stylesheet" href="../../css/bootstrap.css">
        <link rel="stylesheet" href="../../vendors/linericon/style.css">
        <link rel="stylesheet" href="../../css/font-awesome.min.css">
        <link rel="stylesheet" href="../../vendors/owl-carousel/owl.carousel.min.css">
        <link rel="stylesheet" href="../../vendors/bootstrap-datepicker/bootstrap-datetimepicker.min.css">
        <link rel="stylesheet" href="../../vendors/nice-select/css/nice-select.css">
        <link rel="stylesheet" href="../../vendors/owl-carousel/owl.carousel.min.css">
        <!-- main css -->
        <link rel="stylesheet" href="../../css/style.css">
        <link rel="stylesheet" href="../../css/responsive.css">

    <link href="../../css/datatable/dataTable.bootstrap.min.css" rel="stylesheet">

    <!--Animations-->
    <link rel="stylesheet" type="text/css" href="../../css/animations/style.css"> 

    <!--Fontawesome 6-->
    <link href="../../css/fontawesome/css/all.css" rel="stylesheet">  


    </head>
    <body>
        <!--================Header Area =================-->
        <header class="header_area">
            <div class="container">
                <nav class="navbar navbar-expand-lg navbar-light">
                    <!-- Brand and toggle get grouped for better mobile display -->
                    <a class="navbar-brand logo_h" href="../../"><img src="../../image/logo.png" alt=""></a>

                    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <!-- Collect the nav links, forms, and other content for toggling -->
                    <div class="collapse navbar-collapse offset" id="navbarSupportedContent">
                        <ul class="nav navbar-nav menu_nav ml-auto">
                            <li class="nav-item"><a class="nav-link" href="../../">Home</a></li> 
                            <li class="nav-item active submenu dropdown">
                                <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Directories</a>
                                <ul class="dropdown-menu">
                                    <li class="nav-item"><a class="nav-link" href="../../listings">All Listings</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Gyms">Gyms</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Health Clubs">Health Clubs</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Spas">Spas</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Massage Parlors">Massage Parlors</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Physiotherapists">Physiotherapists</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Dance Clubs">Dance Clubs</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Sports Clubs">Sports Clubs</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Trainers">Trainers</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Dieticians">Dieticians</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Technicians">Technicians</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Consultants">Consultants</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Swimming Pools">Swimming Pools</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../listings/Equipment Suppliers">Equipment Suppliers</a></li>
                                </ul>
                            </li> 
                            <li class="nav-item submenu dropdown">
                                <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Categories</a>
                                <ul class="dropdown-menu">
                                    <li class="nav-item"><a class="nav-link" href="../../categories">All Categories</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../categories/Fitness">Fitness</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../categories/Wellness">Wellness</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../categories/Massage">Massage</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../categories/Steam Bath">Steam Bath</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../categories/Sauna">Sauna</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../categories/Dance">Dance</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../categories/Sports">Sports</a></li>
                                    <li class="nav-item"><a class="nav-link" href="../../categories/Experts">Experts</a></li>
                                </ul>
                            </li> 
                            <li class="nav-item"><a class="nav-link" href="../../blog">Blog</a></li>
                            <li class="nav-item"><a class="nav-link" href="../../events">Events</a></li>
                            <li class="nav-item"><a class="nav-link" href="../../about">About Us</a></li>
                            <li class="nav-item"><a class="nav-link" href="../../contact">Contact Us</a></li>
                        </ul>
                    </div> 
                </nav>
            </div>
        </header>
        <!--================Header Area =================-->



       
        <!--================Breadcrumb Area =================-->
        <section class="breadcrumb_area">
            <div class="overlay bg-parallax" data-stellar-ratio="0.8" data-stellar-vertical-offset="0" data-background=""></div>
            <div class="container">
                <div class="page-cover text-center">
                    <h2 class="page-cover-tittle"><?php echo $title; ?></h2>
                    <ol class="breadcrumb">
                        <li><a href="../../">Home</a></li>
                        <li><a href="../">Categories</a></li>
                        <li><a href="../../categories/<?php echo $cat; ?>"><?php echo $cat; ?></a></li>
                        <li class="active">Listing</li>
                    </ol>
                </div>
            </div>
        </section>
        <!--================Breadcrumb Area =================-->


<!--================ Session Handler Start =================-->
<div class="session_handler">
<?php
        if(isset($_SESSION['error'])){
          echo "<div class='alert alert-danger text-center'>
            <button class='close'>&times;</button>
            ".$_SESSION['error']."
          </div>";
          unset($_SESSION['error']);
        }
        if(isset($_SESSION['success'])){
          echo "<div class='alert alert-success text-center'>
            <button class='close'>&times;</button>
            ".$_SESSION['success']."
          </div>";
          unset($_SESSION['success']);
        }
      ?>
</div>
<!--================ Session Handler End =================-->

        
        
        
        <!--================Blog Area =================-->
        <section class="blog_area single-post-area">
            <div class="container">
                <div class="row">
                    <div class="col-lg-8 posts-list">
                        <div class="single-post row">
                            <div class="col-lg-12">
                                <div class="feature-img">
                                    <img class="img-fluid one" src="../../admin/listings/images/<?php echo $image; ?>" alt="<?php echo $title; ?>">
                                </div>                                  
                            </div>
                            <div class="col-lg-3  col-md-3">
                                <div class="blog_info text-right">
                                    <div class="post_tag">
                                        <a href="#"><?php echo $sub; ?></a>
                                    </div>
                                    <ul class="blog_meta list_style">
                                        <li><a href="#"><?php echo $cat; ?><i class="fa fa-lightbulb"></i></a></li>
                                        <li><a class="text-underline" href="tel:<?php echo $phone; ?>">Call Now <i class="fa fa-mobile"></i></a></li>
                                        <li><a class="text-underline" href="mailto:<?php echo $email; ?>">Send Mail <i class="fa fa-envelope"></i></a></li>
                                        <li><a class="text-underline" href="https://wa.me/<?php echo $phone; ?>">Whatsapp <i class="fab fa-whatsapp"></i></a></li>
                                        <?php
                                        if ($website) {
                                             echo '<li><a class="text-underline" href="'.$website.'">'.$website.' <i class="fa fa-globe"></i></a></li>';
                                         }
                                         ?>
                                        <li><a href="#review"><span class="count-box"></span><i class="fa fa-comment"></i></a></li>
                                    </ul>
                                    <ul class="social-links">
                                        <?php
                                        if ($facebook) {
                                             echo '<li><a href="https://facebook.com/'.$facebook.'"><i class="fab fa-facebook"></i></a></li>';
                                         }
                                        if ($twitter) {
                                             echo '<li><a href="https://x.com/'.$twitter.'"><i class="fab fa-x-twitter"></i></a></li>';
                                         }
                                        if ($instagram) {
                                             echo '<li><a href="https://instagram.com/'.$instagram.'"><i class="fab fa-instagram"></i></a></li>';
                                         }
                                        if ($youtube) {
                                             echo '<li><a href="https://youtube.com/'.$youtube.'"><i class="fab fa-youtube-play"></i></a></li>';
                                         }
                                        ?>
                                    </ul>
                                </div>
                            </div>
                            <div class="col-lg-9 col-md-9 blog_details">

<!--Share Start-->
<div class="share-content">
    Share: 
      <a href="https://facebook.com/sharer.php?u=https://fitbora.net/listings/1/?listing=<?php echo $url;?>&text=Checkout <?php echo $title;?> on FitBora" target="_blank"><i class="fab fa-facebook"></i></a> 

          <a href="https://twitter.com/intent/tweet?url=https://fitbora.net/listings/1/?listing=<?php echo $url;?>&text=Checkout <?php echo $title;?> on FitBora" target="_blank"><i class="fab fa-x-twitter"></i></a>  

          <a href="https://www.linkedin.com/shareArticle?mini=true &amp;url=https://fitbora.net/listings/1/?listing=<?php echo $url;?>&text=Checkout <?php echo $title;?> on FitBora" target="_blank"><i class="fab fa-linkedin"></i></a>  

          <a href="whatsapp://send?text=<?php echo $title;?> %0D%0A Checkout <?php echo $title;?> on FitBora https://fitbora.net/listings/1/?listing=<?php echo $url;?>" target="_blank"><i class="fab fa-whatsapp"></i></a> 

          <a href="mailto:?subject=Checkout <?php echo $title;?> on FitBora&body=<?php echo $description1;?> Checkout <?php echo $title;?> on FitBora https://fitbora.net/listings/1/?listing=<?php echo $url;?>"><i class="fa fa-envelope"></i></a>
</div>
<!--Share End-->

                                <h2><?php echo $title; ?></h2>
                                <div class="quotes">Find us: <a href="<?php if ($g_maps) { echo $g_maps;} else { echo 'https://www.google.com/search?q='.$address.', '.$district.'';}?>"><?php echo ''.$address.', '.$district.'';?></a>
                                </div>
                                <div class="quotes">Services: <br><?php echo stripslashes($services);?></div>

                                <?php
                                        if ($paragraph1) {
                                             echo '<div class="quotes one">'.$paragraph1.'</div>';
                                         }
                                ?>

                            </div>
                            <div class="col-lg-12">
                                
                                <div class="row">
              <?php
              if ($image1) {
                if (!empty($image1) & empty($image2)) {
                    echo '<div class="col-12">';
                } else {
                 echo '<div class="col-6">';
                }
                            echo '<img class="img-fluid one" src="../../admin/listings/images/'.$image1.'" alt="'.$summ1.'">';
              if ($summ1) {
                echo '<p class="text-center"><i>'.$summ1.'</i></p>';
              }
                        echo '</div>';
                
               } 
              ?>

              <?php
              if ($image2) {
                 echo '<div class="col-6">';
                            echo '<img class="img-fluid one" src="../../admin/listings/images/'.$image2.'" alt="'.$summ2.'">';
              if ($summ2) {
                echo '<p class="text-center"><i>'.$summ2.'</i></p>';
              }
                        echo '</div>';
               } 
              ?>

              <?php
              if ($image3) {
                if (!empty($image3) & empty($image4)) {
                    echo '<div class="col-12">';
                } else {
                 echo '<div class="col-6">';
                }
                            echo '<img class="img-fluid one" src="../../admin/listings/images/'.$image3.'" alt="'.$summ3.'">';
              if ($summ3) {
                echo '<p class="text-center"><i>'.$summ3.'</i></p>';
              }
                        echo '</div>';
                
               } 
              ?>

              <?php
              if ($image4) {
                 echo '<div class="col-6">';
                            echo '<img class="img-fluid one" src="../../admin/listings/images/'.$image4.'" alt="'.$summ4.'">';
              if ($summ4) {
                echo '<p class="text-center"><i>'.$summ4.'</i></p>';
              }
                        echo '</div>';
               } 
              ?>

              <?php
              if ($image5) {
                if (!empty($image5) & empty($image6)) {
                    echo '<div class="col-12">';
                } else {
                 echo '<div class="col-6">';
                }
                            echo '<img class="img-fluid one" src="../../admin/listings/images/'.$image5.'" alt="'.$summ5.'">';
              if ($summ5) {
                echo '<p class="text-center"><i>'.$summ5.'</i></p>';
              }
                        echo '</div>';
                
               } 
              ?>

              <?php
              if ($image6) {
                 echo '<div class="col-6">';
                            echo '<img class="img-fluid one" src="../../admin/listings/images/'.$image6.'" alt="'.$summ6.'">';
              if ($summ6) {
                echo '<p class="text-center"><i>'.$summ6.'</i></p>';
              }
                        echo '</div>';
               } 
              ?>



                                <?php
                                        if ($phone1) {
                                          echo '<div class="quotes one">';
                                             echo 'For more details: <a href="tel:'.$phone1.'">'.$phone1.'</a>';
                                        if ($phone2) {
                                             echo ' | <a href="tel:'.$phone2.'">'.$phone2.'</a>';
                                         }
                                         echo '</div>';
                                       }
                                ?>

                                                                      
                                </div>
                            </div>
                        </div>
                        <div class="navigation-area">
                            <div class="row">


        <?php
          $sql = "SELECT * FROM listings WHERE id<'$id' ORDER BY id DESC LIMIT 1";

          //use for MySQLi-OOP
          $query = $conn->query($sql);

              while($row = $query->fetch_assoc()){

        echo '<div class="col-lg-6 col-md-6 col-12 nav-left flex-row d-flex justify-content-start align-items-center">
                                    <div class="thumb">
                                        <a href="./?listing='.$row["url"].'"><img class="img-fluid" src="../../admin/listings/images/'.$row["image"].'" alt="Prev"></a>
                                    </div>
                                    <div class="arrow">
                                        <a href="./?listing='.$row["url"].'"><span class="lnr text-white lnr-arrow-left"></span></a>
                                    </div>
                                    <div class="detials">
                                        <p>Prev</p>
                                        <a href="#"><h4>'.substr($row['title'], 0, 20).'..</h4></a>
                                    </div>
                                </div>';
        }

  ?>

        <?php

$sql = "SELECT count(*) FROM listings WHERE id<'$id'"; 

$result = $conn->query($sql); 

while($row = mysqli_fetch_array($result)) { 

    $count_one = $row['count(*)'];

} 

  if ($count_one==0) {
          $sql = "SELECT * FROM listings WHERE id!='$id' ORDER BY id DESC LIMIT 1";

          //use for MySQLi-OOP
          $query = $conn->query($sql);

              while($row = $query->fetch_assoc()){

        echo '<div class="col-lg-6 col-md-6 col-12 nav-left flex-row d-flex justify-content-start align-items-center">
                                    <div class="thumb">
                                        <a href="./?listing='.$row["url"].'"><img class="img-fluid" src="../../admin/listings/images/'.$row["image"].'" alt="Prev"></a>
                                    </div>
                                    <div class="arrow">
                                        <a href="./?listing='.$row["url"].'"><span class="lnr text-white lnr-arrow-left"></span></a>
                                    </div>
                                    <div class="detials">
                                        <p>Prev</p>
                                        <a href="#"><h4>'.substr($row['title'], 0, 20).'..</h4></a>
                                    </div>
                                </div>';
        }

      }

  ?>

                                

          
  <?php
          $sql = "SELECT * FROM listings WHERE id>'$id' ORDER BY id ASC LIMIT 1";

          //use for MySQLi-OOP
          $query = $conn->query($sql);

              while($row = $query->fetch_assoc()){

        echo '<div class="col-lg-6 col-md-6 col-12 nav-right flex-row d-flex justify-content-end align-items-center">
                                    <div class="detials">
                                        <p>Next</p>
                                        <a href="./?listing='.$row["url"].'"><h4>'.substr($row['title'], 0, 20).'..</h4></a>
                                    </div>
                                    <div class="arrow">
                                        <a href="#"><span class="lnr text-white lnr-arrow-right"></span></a>
                                    </div>
                                    <div class="thumb">
                                        <a href="./?listing='.$row["url"].'"><img class="img-fluid" src="../../admin/listings/images/'.$row["image"].'" alt="Next"></a>
                                    </div>                                      
                                </div>';
        }

  ?>

          
  <?php


$sql = "SELECT count(*) FROM listings WHERE id>'$id'"; 

$result = $conn->query($sql); 

    while($row = mysqli_fetch_array($result)) { 

    $count_two = $row['count(*)'];

} 

  if ($count_two==0) {

          $sql = "SELECT * FROM listings WHERE id!='$id' ORDER BY id ASC LIMIT 1";

          //use for MySQLi-OOP
          $query = $conn->query($sql);

              while($row = $query->fetch_assoc()){

        echo '<div class="col-lg-6 col-md-6 col-12 nav-right flex-row d-flex justify-content-end align-items-center">
                                    <div class="detials">
                                        <p>Next</p>
                                        <a href="./?listing='.$row["url"].'"><h4>'.substr($row['title'], 0, 20).'..</h4></a>
                                    </div>
                                    <div class="arrow">
                                        <a href="#"><span class="lnr text-white lnr-arrow-right"></span></a>
                                    </div>
                                    <div class="thumb">
                                        <a href="./?listing='.$row["url"].'"><img class="img-fluid" src="../../admin/listings/images/'.$row["image"].'" alt="Next"></a>
                                    </div>                                      
                                </div>';
        }

      }

  ?>

                                                                  
                            </div>
                        </div>

                        <div id="review" class="review-box"></div>

                        <div class="comment-form">
                            <h4>Leave A Review</h4>
                            <form method="POST" action="reviews/index.php" enctype="multipart/form-data">
                                <div class="form-group form-inline">

                                    <input type="hidden" class="form-control" name="listing_id" value="<?php echo $code; ?>">

                                    <input type="hidden" class="form-control" name="listing" value="<?php echo $listing; ?>">

                    <!--Star Rating Start-->
                    <div class="col-lg-12 col-md-12" align="center">
                        <div class="rating-form">
                          <ul>
                            <label for="one" class="one"><input type="radio" name="rate" class="filter"value="1" required><li><i class="fa fa-star"></i></li>
                            </label>
                            <label for="two" class="two"><input type="radio" name="rate" class="filter"value="2"><li><i class="fa fa-star"></i></li>
                            </label>
                            <label for="three" class="three"><input type="radio" name="rate" class="filter" value="3"><li><i class="fa fa-star"></i></li>
                            </label>
                            <label for="four" class="four"><input type="radio" name="rate" class="filter" value="4"><li><i class="fa fa-star"></i></li>
                            </label>
                            <label for="five" class="five"><input type="radio" name="rate" class="filter" value="5"><li><i class="fa fa-star"></i></li>
                            </label>
                          </ul>
                        </div>
                    </div>
                    <!--Star Rating End-->

                                  <div class="form-group col-lg-12 col-md-12 username">
                                    <input type="text" class="form-control" name="username" placeholder="Enter username">
                                  </div>
                                  <div class="form-group col-lg-6 col-md-6 name">
                                    <input type="text" class="form-control" name="name" placeholder="Enter Names" required>
                                  </div>
                                  <div class="form-group col-lg-6 col-md-6 email">
                                    <input type="email" class="form-control" name="email" placeholder="Enter Email Address" required>
                                  </div>                                        
                                </div>
                                <div class="form-group">
                                    <textarea class="form-control mb-10" rows="5" name="review" placeholder="Your Comment" required></textarea>
                                </div>
                                <button type="submit" name="submit" class="primary-btn button_hover">Post Review</button>
                                <p class="text-bottom comment_box"></p>
                            </form>
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="blog_right_sidebar">
                            <aside class="single_sidebar_widget search_widget">
                                <form action="../search/index.php" method="POST">
                                <div class="input-group">
                                    <input type="search" name="valueToSearch" class="form-control" placeholder="Search Listings" required>
                                    <span class="input-group-btn">
                                        <button class="btn btn-default" type="submit" name="search" value="Search"><i class="lnr lnr-magnifier"></i></button>
                                    </span>
                                </div><!-- /input-group -->
                                </form>
                                <div class="br"></div>
                            </aside>
                            <aside class="single_sidebar_widget author_widget blogger_slider owl-carousel">

<?php

    $sql = "SELECT * FROM bloggers WHERE deleted=''";

    //use for MySQLi-OOP
    $query = $conn->query($sql);
    if($query->fetch_assoc()==0){
        echo '<div align="center">
                                <i class="fa fa-user-circle mb-2" style="font-size: 100px;"></i>
                                <h4>Blogger Names</h4>
                                <p>Blogger Title</p>
                                <div class="social_icon">
                                    <a href="https://facebook.com"><i class="fab fa-facebook"></i></a>
                                    <a href="https://instagram.com"><i class="fab fa-instagram"></i></a>
                                    <a href="https://x.com"><i class="fab fa-twitter"></i></a>
                                    <a href="https://linkedin.com"><i class="fab fa-linkedin"></i></a>
                                    <a href="https://wa.me/256746006066"><i class="fab fa-whatsapp"></i></a>
                                </div>
                                <p>Discover your next great find with our listing website. We connect you to the best deals, services & opportunities in one easy-to-navigate platform.</p>
                                <div class="br"></div>
                            </div>';
    }
?>
                                                
<?php

    $sql = "SELECT * FROM bloggers WHERE deleted='' ORDER BY id DESC";

    //use for MySQLi-OOP
    $query = $conn->query($sql);
    while($row = $query->fetch_assoc()){

        echo '<div align="center">';
                                echo '<img class="author_img rounded-circle mb-2" src="../../admin/bloggers/images/'.$row["image"].'" alt="'.$row["name"].'" width="120px">';
                                echo '<h4>'.$row["name"].'</h4>';
                                echo '<p>'.$row["title"].'</p>';

                                echo '<div class="social_icon">';
                                if ($row["facebook"]) { echo '<a href="'.$row["facebook"].'"><i class="fab fa-facebook"></i></a>'; }
                                if ($row["instagram"]) { echo '<a href="'.$row["instagram"].'"><i class="fab fa-instagram"></i></a>'; }
                                if ($row["twitter"]) { echo '<a href="'.$row["twitter"].'"><i class="fab fa-twitter"></i></a>'; }
                                if ($row["linkedin"]) { echo '<a href="'.$row["linkedin"].'"><i class="fab fa-linkedin"></i></a>'; }
                                if ($row["phone"]) { echo '<a href="https://wa.me/'.$row["phone"].'"><i class="fab fa-whatsapp"></i></a>'; }
                                echo '</div>';

                                if ($row["description"]) {
                                    echo '<p>'.$row["description"].'</p>';
                                }

                                echo '<div class="br"></div>';
                            echo '</div>';

                }
?>
                            </aside>
                            <aside class="single_sidebar_widget popular_post_widget">
                                <h3 class="widget_title">Top Fitness Centres</h3>

                                                               
<?php

    $sql = "SELECT * FROM listings WHERE deleted='' AND code!='$code' ORDER BY id DESC LIMIT 4";

    //use for MySQLi-OOP
    $query = $conn->query($sql);
    while($row = $query->fetch_assoc()){

        echo '<div class="media post_item">
                                    <img src="../../admin/listings/images/'.$row["image"].'" alt="'.$row["title"].'" style="width: 100px;height: 70px;object-fit: cover;border-radius: 6px;">
                                    <div class="media-body">
                                        <a href="../../listings/1/?listing='.$row["url"].'"><h3>'.$row["title"].'</h3></a>
                                        <p>'.$row["sub"].'</p>
                                    </div>
                                </div>';

                }
?>

                                <div class="br"></div>

                                <a href="../../listings"><h3 class="widget_title text-uppercase">Discover More</h3></a>

                            </aside>
                            <aside class="single_sidebar_widget ads_widget">
                                <a href="#"><img class="img-fluid" src="../../image/blog/add.jpg" alt=""></a>
                                <div class="br"></div>
                            </aside>
                            <aside class="single_sidebar_widget post_category_widget">
                                <h4 class="widget_title">Categories</h4>
                                <ul class="list_style cat-list">

                                    <?php

    $sql = "SELECT COUNT(*), cat FROM listings WHERE deleted='' GROUP BY cat ORDER BY id DESC";

    //use for MySQLi-OOP
    $query = $conn->query($sql);
    while($row = $query->fetch_assoc()){

        echo '<li>
                                        <a href="../../categories/'.$row["cat"].'" class="d-flex justify-content-between">
                                            <p>'.$row["cat"].'</p>
                                            <p>'.$row["COUNT(*)"].'</p>
                                        </a>
                                    </li>';

                }
?>

                                </ul>
                                <div class="br"></div>
                            </aside>
                            <aside class="single-sidebar-widget newsletter_widget">
                                <h4 class="widget_title">Newsletter</h4>
                                <p class="text-bottom">Register your email and receive our latest updates</p>
                                <form method="POST">
                                <div class="form-group d-flex flex-row">
                                    <div class="input-group">
                                        <div class="input-group-prepend">
                                            <div class="input-group-text"><i class="fa fa-envelope" aria-hidden="true"></i></div>
                                        </div>
                                        <div class="username"><input type="text" class="form-control" id="username" name="username" value=""></div>
                                        <input type="text" class="form-control" name="email" id="email" placeholder="Email Address">
                                    </div>
                                    <button type="submit" name="newsletter" id="newsletter" class="bbtns border-0">Subcribe</button>
                                </div>  
                                </form>
                                <p class="text-bottom message_box">You can unsubscribe at any time</p>  
                                <div class="br"></div>                          
                            </aside>
                            <aside class="single-sidebar-widget tag_cloud_widget">
                                <h4 class="widget_title">Tag Clouds</h4>
                                <ul class="list_style">

<?php

    $sql = "SELECT COUNT(*), sub FROM listings WHERE deleted='' GROUP BY sub ORDER BY id DESC";

    //use for MySQLi-OOP
    $query = $conn->query($sql);
    while($row = $query->fetch_assoc()){

        echo '<li><a href="../../listings/'.$row["sub"].'s">'.$row["sub"].'s</a></li>';
    }

?>

                                </ul>
                            </aside>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!--================Blog Area =================-->

        
        <!--================ start footer Area  =================-->    
        <footer class="footer-area section_gap">
            <div class="container">
                <div class="row">

                    <div class="col-lg-4 col-md-12 col-sm-12 col-12">
                        <div class="single-footer-widget">
                            <h6 class="footer_title">Overview</h6>
                            <p>FitBora is a premier online listing designed to connect fitness and wellness enthusiasts with the best gyms and fitness facilities in their area.
                            Our comprehensive listing platform offers an extensive range of options, from high-end luxury fitness clubs to budget-friendly community gyms, spas and health clubs - ensuring there’s something for everyone.</p>
                        </div>
                    </div>

                    <div class="col-lg-2 col-md-3 col-sm-3 col-6">
                        <div class="single-footer-widget">
                            <h6 class="footer_title">Locations</h6>
                                    <ul class="list_style">
<?php

    $sql = "SELECT COUNT(*), district, image FROM listings WHERE deleted='' GROUP BY district ORDER BY id DESC LIMIT 5";

    //use for MySQLi-OOP
    $query = $conn->query($sql);
    while($row = $query->fetch_assoc()){

        echo '<li><a href="../../districts/ug/?district='.$row["district"].'"><i class="fa fa-angle-right"></i> '.$row["district"].'</a></li>';
    }

?>
                                    </ul>
                        </div>
                    </div>

                    <div class="col-lg-2 col-md-3 col-sm-3 col-6">
                        <div class="single-footer-widget">
                            <a href="../../categories"><h6 class="footer_title">Categories</h6></a>
                                    <ul class="list_style">
                                        <li><a href="../../categories/Fitness"><i class="fa fa-angle-right"></i> Fitness</a></li>
                                        <li><a href="../../categories/Wellness"><i class="fa fa-angle-right"></i> Wellness</a></li>
                                        <li><a href="../../categories/Massage"><i class="fa fa-angle-right"></i> Massage</a></li>
                                        <li><a href="../../categories/Steam Bath"><i class="fa fa-angle-right"></i> Steam Bath</a></li>
                                        <li><a href="../../categories/Experts"><i class="fa fa-angle-right"></i> Experts</a></li>
                                    </ul>
                        </div>
                    </div>

                    <div class="col-lg-2 col-md-3 col-sm-3 col-6">
                        <div class="single-footer-widget">
                            <h6 class="footer_title">Interact With</h6>
                                    <ul class="list_style">
                                        <li><a href="../../listings/Trainers"><i class="fa fa-angle-right"></i> Trainers</a></li>
                                        <li><a href="../../listings/Dieticians"><i class="fa fa-angle-right"></i> Dieticians</a></li>
                                        <li><a href="../../listings/Technicians"><i class="fa fa-angle-right"></i> Technicians</a></li>
                                        <li><a href="../../listings/Consultants"><i class="fa fa-angle-right"></i> Consultants</a></li>
                                        <li><a href="../../listings/Physiotherapists"><i class="fa fa-angle-right"></i> Physiotherapists</a></li>
                                    </ul>
                        </div>
                    </div>

                    <div class="col-lg-2 col-md-3 col-sm-3 col-6">
                        <div class="single-footer-widget">
                            <h6 class="footer_title">Quick Links</h6>
                                    <ul class="list_style">
                                        <li><a href="../../blog"><i class="fa fa-angle-right"></i> Blogs</a></li>
                                        <li><a href="../../events"><i class="fa fa-angle-right"></i> Events</a></li>
                                        <li><a href="../../about"><i class="fa fa-angle-right"></i> About Us</a></li>
                                        <li><a href="../../contact"><i class="fa fa-angle-right"></i> Contact Us</a></li>
                                        <li><a href="../../listings"><i class="fa fa-angle-right"></i> Directories</a></li>
                                    </ul>
                        </div>
                    </div>

                </div>
                <div class="border_line"></div>
                <div class="row footer-bottom d-flex justify-content-between align-items-center">
                    <div class="col-lg-3 col-sm-12 footer-social">
                        <a href="https://facebook.com/fitbora"><i class="fab fa-facebook"></i></a>
                        <a href="https://x.com/fitbora"><i class="fab fa-x-twitter"></i></a>
                        <a href="https://instagram.com/fitbora"><i class="fab fa-instagram"></i></a>
                        <a href="https://wa.me/256746006066"><i class="fab fa-whatsapp"></i></a>
                    </div>

                    <p class="col-lg-6 col-sm-12 footer-text m-0 text-center">
                      <a href="#">Fitbora</a> &copy; <script>document.write(new Date().getFullYear());</script>, All Rights Reserved<span class="flash">.</span></p>

                    <p class="col-lg-3 col-sm-12 footer-text m-0 text-center" style="font-size: 12px;">Powered by <a href="https://camonitor.online" target="_blank" style="color: #82848f;">Custom Assist Inc<span class="flash">.</span></a></p>

                </div>


            </div>

            
        </footer>
        <!--================ End footer Area  =================-->
        
        
        <!-- Optional JavaScript -->
        <!-- jQuery first, then Popper.js, then Bootstrap JS -->
        <script src="../../js/jquery-3.2.1.min.js"></script>
        <script src="../../js/popper.js"></script>
        <script src="../../js/bootstrap.min.js"></script>
        <script src="../../vendors/owl-carousel/owl.carousel.min.js"></script>
        <script src="../../js/jquery.ajaxchimp.min.js"></script>
        <script src="../../js/mail-script.js"></script>
        <script src="../../vendors/bootstrap-datepicker/bootstrap-datetimepicker.min.js"></script>
        <script src="../../vendors/nice-select/js/jquery.nice-select.js"></script>
        <script src="../../js/mail-script.js"></script>
        <script src="../../js/stellar.js"></script>
        <script src="../../vendors/lightbox/simpleLightbox.min.js"></script>
        <script src="../../js/custom.js"></script>
        <script src="../../js/video-on-scroll.js"></script>

        <script src="../../js/datatable/jquery.dataTables.min.js"></script>
        <script src="../../js/datatable/dataTable.bootstrap.min.js"></script>

       <script>
    const reviewBox = document.querySelector(".review-box");

setInterval(() =>{
    let xhr = new XMLHttpRequest();
    xhr.open("GET", "../../admin/counter/get-review/?listing_id=<?php echo $code; ?>", true);
    xhr.onload = ()=>{
      if(xhr.readyState === XMLHttpRequest.DONE){
          if(xhr.status === 200){
            let data = xhr.response;
            reviewBox.innerHTML = data;
            
          }
      }
    }
    xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xhr.send();
}, 500);
</script>

       <script>
    const countBox = document.querySelector(".count-box");

setInterval(() =>{
    let xhr = new XMLHttpRequest();
    xhr.open("GET", "../../admin/counter/get-review-count/?listing_id=<?php echo $code; ?>", true);
    xhr.onload = ()=>{
      if(xhr.readyState === XMLHttpRequest.DONE){
          if(xhr.status === 200){
            let data = xhr.response;
            countBox.innerHTML = data;
            
          }
      }
    }
    xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xhr.send();
}, 500);
</script>





<script>
$(document).ready(function() {
  var delay = 500;
  $('#newsletter').click(function(e){
    e.preventDefault();
    
    var username = $('#username').val();

    var newsletter = $('#newsletter').val();

    var email = $('#email').val();
        if(email == ''){
      $('.message_box').html(
      '<span style="color:#F7931D;">Enter an email address!</span>'
      );
      $('#email').focus();
            return false;
      }
    if( $("#email").val()!='' ){
      if( !isValidEmailAddress( $("#email").val() ) ){
      $('.message_box').html(
      '<span style="color:#F7931D;">Provided email address is incorrect!</span>'
      );
      $('#email').focus();
      return false;
      }
      }
    
          
      $.ajax
      ({
             type: "POST",
       url: "../../contact/newsletters/index.php",
             data: "email="+email+"&username="+username+"&newsletter="+newsletter,
       beforeSend: function() {
       $('.message_box').html(
       '<div align="center"><img src="../../image/ajax.gif" width="25" height="25"/></div>'
       );
       },    
             success: function(data)
       {
         setTimeout(function() {
                    $('.message_box').html(data);
                }, delay);
      
             }
       });
  });
      
});

//Email validation Function 
function isValidEmailAddress(emailAddress) {
    var pattern = /^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i;
    return pattern.test(emailAddress);
};
</script>




<script>
$(document).ready(function(){
  //inialize datatable
    $('#myTable').DataTable();

    //hide alert
    $(document).on('click', '.close', function(){
      $('.alert').hide();
    })
});
</script>


    </body>
</html>