<?php include 'header.php';
$com_id = $_GET['id'];
if(!isset($com_id) || empty($com_id))
{
header('location:index.html', true);
echo "<script>window.location='index.html'</script>";
}
$select_community= $con->prepare("SELECT * FROM tbl_community WHERE id=:id");
$select_community->bindParam(':id', $com_id);
$select_community->execute();
$number = $select_community->rowCount();
if(!$number)
{
header('location:index.html', true);
echo "<script>window.location='index.html'</script>";
}
$fetch_community = $select_community->fetch(PDO::FETCH_ASSOC);
?>
<section id="menu_transparent">
<div class="container">
<div class="col-md-12 banner_top" >
<div class="row">
<div class="col-md-7">
<h2><?php echo $fetch_community['com_name']; ?></h2>
<p><?php echo htmlspecialchars_decode(substr($fetch_community['com_details'],0,220).' ....'); ?></p>
</div>
<div class="col-md-5 banner_img_right">
<img src="images/banner_img_right.png" class="img-responsive">
</div>
</div>
</div>
</div>
</section>
<section>
<div class="container">
<div class="col-md-12" style="margin-top: 6%;">
<div class="row">
<img width="100%" src="com_main_images/<?php echo $fetch_community['com_main_image']; ?>" alt="" />
<div class="product">
<div class="single-inner">
<div class="images" style="width: 100%;">
<div class="project-slider">
<div class="owl-carousel sync2">
<?php
$select_slider= $con->prepare("SELECT * FROM tbl_com_slider_images WHERE com_id=:com_id");
$select_slider->bindParam(':com_id', $com_id);
$select_slider->execute();
while($fetch_slider = $select_slider->fetch(PDO::FETCH_ASSOC))
{
?>
<div class="item">
<a href="com_original_image/<?php echo $fetch_slider['image_name']; ?>" data-rel="prettyPhoto[product-gallery]">
<img class="img-responsive" src="com_resized_image/<?php echo $fetch_slider['image_name']; ?>" alt="" />
</a>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="plant_description">
<div class="container">
<div class="col-md-12">
<div class="row">
<h2><?php echo $fetch_community['com_name']; ?> Description</h2>
<?php echo htmlspecialchars_decode($fetch_community['com_details']); ?>
</div>
</div>
</div>
</section>
<section id="product_white">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="row">
<?php
$pl_related_community = $fetch_community['related_com'];
foreach (explode(',' , $pl_related_community) as $each_community)
{
$select_related_community= $con->prepare("SELECT * FROM tbl_community WHERE id=:com_id");
$select_related_community->bindParam(':com_id', $each_community);
$select_related_community->execute();
$fetch_related_community = $select_related_community->fetch(PDO::FETCH_ASSOC);
?>
<div class="col-md-3 col-sm-6 search_blok">
<img src="com_images/<?php echo $fetch_related_community['com_image']; ?>" class="img-responsive">
<a href="community-detail.php?id=<?php echo $fetch_related_community['id']; ?>"><h3><?php echo $fetch_related_community['com_name']; ?></h3></a>
<p><?php echo substr(htmlspecialchars_decode($fetch_related_community['com_details']),0,110).' .....'; ?><p>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
</section>
<?php include 'footer.php'?> |