<?php
include_once("include/main.inc.php");
$homepage = mysqli_query($dbconn, "select * from static_pages where pageID='1'");
$home_res = mysqli_fetch_array($homepage);
@extract($_REQUEST);
$admin_res = getAdminDetails();
$pg = "home";
$ca_nam1 = $_REQUEST['cid'];
$ca_nam1 = ucwords(str_replace("-", " ", $cid));
$loc_sql = mysqli_query($dbconn, "SELECT * FROM location_tbl where locationName='$ca_nam1'");
$location = mysqli_fetch_array($loc_sql);
$location_id = $location['parentID'];
$home_sub_specific = mysqli_query($dbconn, "select * from location_content_tbl where category_id='0' AND location_id='0'");
$home_sub_general = mysqli_query($dbconn, "select * from location_content_tbl where category_id='0' AND location_id='0'");
$content_count = mysqli_num_rows($home_sub_specific);
if ($content_count > 0) {
    $homesubdomain = mysqli_fetch_array($home_sub_specific);
    
$page_metatitle = str_replace('hotkeyword1',$homesubdomain[keyword1],str_replace('hotkeyword2', $homesubdomain[keyword2], str_replace('{location}', $ca_nam1, $homesubdomain['meta_title'])));

$page_keyword = str_replace('hotkeyword1',$homesubdomain[keyword1],str_replace('hotkeyword2', $homesubdomain[keyword2], str_replace('{location}', $ca_nam1, $homesubdomain['meta_keyword'])));

$page_metadesc = str_replace('hotkeyword1',$homesubdomain[keyword1],str_replace('hotkeyword2', $homesubdomain[keyword2],str_replace('companyname', $admin_res[companyName], str_replace('phone', $admin_res[phone], str_replace('{location}', $ca_nam1, $homesubdomain['meta_description'])))));

    //    content
    $page_contentdesc = $homesubdomain['description'];
    $page_short_desc = $homesubdomain['short_description'];

    //    specific location content
} else {
    $homesubdomain = mysql_fetch_array($home_sub_general);
    $page_metatitle = $homesubdomain['meta_title'];
    $page_keyword = $homesubdomain['meta_keyword'];
    $page_metadesc = $homesubdomain['meta_description'];
    $page_contentdesc = $homesubdomain['description'];
    $page_short_desc = $homesubdomain['short_description'];
    //    general content
}
$page_desc = str_replace('{location}', $ca_nam1, $page_contentdesc);
$page_short_desc = str_replace('{location}', $ca_nam1, $page_short_desc);

$h1 = explode(',',$page_metatitle);
if (mysqli_num_rows($loc_sql) > 0) {
} else {
     header("Location: ".site_url);
    exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php echo $page_metatitle;?></title>
    <meta name="description" content="<?php echo $page_metadesc;?>">
    <meta name="keywords" content="<?php echo $page_keyword;?>">
    <?php include 'app_top.php'; ?>
</head>

<body class="homepage">
    
    <?php include 'app_header_sub.php'; ?>

    <div class="home_slider">
    <div class="swiper mySwiper">
    <div class="swiper-wrapper">
    <?php $sql_banner=mysqli_query($dbconn,"Select * from banner_tbl where status='Y' ORDER BY bannerorder");
        while($result_banner=mysqli_fetch_array($sql_banner)){ 
             $link =  $result_banner['bannerUrl']!=null ? site_url."/".$result_banner['bannerUrl'] : "javascript:void(0);" ;
            ?>
      <div class="swiper-slide">
      <a href="<?=$link?>"><img src="<?=site_url();?>/uploaded-files/banner-image/<?=$result_banner['bannerImage'];?>" title="<?=$result_banner['personName'];?> in <?= $ca_nam1; ?>" alt="<?=$result_banner['personName'];?> in <?= $ca_nam1; ?>"></a>
      <?php if($result_banner['tagline']!=null){ ?>
                <div class="carousel-caption banner_inner d-flex">
                    <div class="container align-self-center">
                        <div class="banner_info">
                            <div class="title_1"><?=$result_banner['personName'];?></div>
                            <p><?=$result_banner['tagline'];?></p>
                        </div>
                    </div>
                </div>
                <?   }
            ?>
      </div>
      <?php  } ?>

    </div>
    <div class="swiper-button-next"></div>
    <div class="swiper-button-prev"></div>
    <div class="swiper-pagination"></div>
  </div>

        <svg class="path_type_1" preserveAspectRatio="none" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg">
            <path d="M0 0 L70 100 L100.1 0 L100.1 100 L0 100 Z" fill="#fff" stroke="#fff" stroke-width="-1"></path>
            <path d="M0 0 L0 0 L50 100 L100 0 L100 0 Z" fill="transparent"></path>
        </svg>
    </div>


     <!--Features-->
    <div class="w-p-s-home-feture">
        <div class="container">
            <div class="row">
                <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-3 col-sm-3 col-6 wow fadeInDown" data-wow-delay=".2s">
                    <div class="wprt-icon-text">
                        <div class="icon">
                            <img src="<?=theme_url?>images/quality.png" alt="Quality Approved Products" title="Quality Approved Products">
                        </div>
                        <div class="title_01">Quality Approved Products</div>
                    </div>
                </div>

                

                <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-3 col-sm-3 col-6 wow fadeInDown" data-wow-delay=".4s">
                    <div class="wprt-icon-text">
                        <div class="icon">
                            <img src="<?=theme_url?>images/distribution-network.png" alt="Widespread Distribution Network" title="Widespread Distribution Network">
                        </div>
                        <div class="title_01">Widespread Distribution Network</div>

                    </div>
                </div>

                <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-3 col-sm-3 col-6 wow fadeInDown" data-wow-delay=".5s">
                    <div class="wprt-icon-text">
                        <div class="icon">
                            <img src="<?=theme_url?>images/expertise.png" alt="Professional Team support" title="Professional Team support">
                        </div>
                        <div class="title_01">Professional Team support</div>    
                    </div>
                </div>

                <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-3 col-sm-3 col-6 wow fadeInDown" data-wow-delay=".6s">
                    <div class="wprt-icon-text">
                        <div class="icon">
                            <img src="<?=theme_url?>images/delivered.png" alt="Prompt Product Delivery" title="Prompt Product Delivery">
                        </div>
                        <div class="title_01">Prompt Product Delivery</div>


                    </div>
                </div>

            </div>
        </div>
    </div>

    <div class="service_category">
        <div class="container">
            <?php 
$plySql = mysqli_query($dbconn,"select * from category_tbl where catID='2' and status='Y'" );
$plyres = mysqli_fetch_array($plySql);
$laminsql = mysqli_query($dbconn,"select * from category_tbl where catID='3' and status='Y'" );
$laminres =   mysqli_fetch_array($laminsql);
            ?>
            <div class="row">
                <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 grid_1 wow fadeInLeft" data-wow-delay=".1s">
                    <div class="img-wrap">
                        <img src="<?=site_url();?>/uploaded-files/category/banners/<?=$plyres['catBanner'];?>" alt="<?=$plyres['displayName']?> in <?= $ca_nam1; ?>" title="<?=$plyres['displayName']?> in <?= $ca_nam1; ?>">
                    </div>
                </div>
                <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 grid_1 wow fadeInRight" data-wow-delay=".2s">
                    <div class="service_content">
                        <div class="center_box">
                            <div class="title_3"><a href="<?= site_url; ?>/<?= getValidFileName($ca_nam1); ?>/<?= getValidFileName($plyres['catName']); ?>.htm" title="<?=$plyres['displayName']?> in <?= $ca_nam1; ?>"><?=$plyres['displayName']?> in <?= $ca_nam1; ?></a></div>
                            <p><?=$plyres['catDesc']?></p>
                            <a class="facilities_btn" href="<?= site_url; ?>/<?= getValidFileName($ca_nam1); ?>/<?= getValidFileName($plyres['catName']); ?>.htm" title="View More">View More</a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 grid_2 wow fadeInRight" data-wow-delay=".4s">
                    <div class="img-wrap">
                        <img src="<?=site_url();?>/uploaded-files/category/banners/<?=$laminres['catBanner'];?>" alt="<?=$laminres['displayName']?> in <?= $ca_nam1; ?>" title="<?=$laminres['displayName']?> in <?= $ca_nam1; ?>">
                    </div>
                </div>

                <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 grid_2 order-xxl-first order-xl-first order-lg-first order-md-first order-sm-last order-last wow fadeInLeft" data-wow-delay=".3s">
                    <div class="service_content">
                        <div class="center_box">
                            <div class="title_3"><a href="<?= site_url; ?>/<?= getValidFileName($ca_nam1); ?>/<?= getValidFileName($laminres['catName']); ?>.htm" title="<?=$laminres['displayName']?> in <?= $ca_nam1; ?>"><?=$laminres['displayName']?> in <?= $ca_nam1; ?></a></div>
                            <p><?=$laminres['catDesc'];?></p>
                            <a class="facilities_btn" href="<?= site_url; ?>/<?= getValidFileName($ca_nam1); ?>/<?= getValidFileName($laminres['catName']); ?>.htm" title="View More">View More</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

     <!--Home About-->
    <section class="home_about-web-pulse">
        <svg class="path_type_1 top" preserveAspectRatio="none" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg">
            <path d="M0 0 L30 100 L100 0 L100 100 L0 100 Z" fill="#fff" stroke="#fff" stroke-width="-1"></path>
            <path d="M0 0 L0 0 L50 100 L100 0 L100 0 Z" fill="rgba(255,255,255,0.0)"></path>
        </svg>
        <div class="container">
            <div class="row">
                <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                    <div class="home_about_content wow fadeInDown" data-wow-delay=".1s">
                        <h1>Mineral Water Purification Plant in <?= $ca_nam1; ?></h1>
                        <?=$page_desc; ?>
                        <!-- <div class="youtube_video">
                            <div class="video-section">
                                <div class="video-inner" style="background-image: url(https://img.youtube.com/vi/0EFvmj6zDsw/sddefault.jpg);">
                                    <div class="video-content">
                                        <a data-fancybox="" href="https://www.youtube.com/watch?v=0EFvmj6zDsw" class="video-btn wow zoomIn animated" data-wow-delay="00ms" data-wow-duration="1500ms" style="visibility: visible; animation-duration: 1500ms; animation-delay: 0ms; animation-name: zoomIn;"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                                                <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path>
                                            </svg></a>
                                    </div>
                                </div>
                            </div>
                        </div> -->
                        <a href="<?= site_url; ?>/about.htm" class="read_more_btn" title="More About Us">More About Us</a>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="services-block-six col-xxl-3 col-xl-3 col-lg-3 col-md-3 col-sm-6 col-12 wow fadeInLeft" data-wow-delay=".3s">
                    <div class="inner">
                        <div class="icon"><img src="<?=theme_url?>images/nature-of-business.png" alt="Nature of Business" title="Nature of Business"></div>
                        <div class="title_3">Nature of Business</div>
                        <p>Manufacturer, Supplier, Exporter</p>
                    </div>
                </div>

                <div class="services-block-six col-xxl-3 col-xl-3 col-lg-3 col-md-3 col-sm-6 col-12 wow fadeInDown" data-wow-delay=".4s">
                    <div class="inner">
                        <div class="icon"><img src="<?=theme_url?>images/year-of-establishment.png" alt="Year of Establishment" title="Year of Establishment"></div>
                        <div class="title_3">Year of Establishment</div>
                        <p>2012</p>
                    </div>
                </div>

                <div class="services-block-six col-xxl-3 col-xl-3 col-lg-3 col-md-3 col-sm-6 col-12 wow fadeInDown" data-wow-delay=".5s">
                    <div class="inner">
                        <div class="icon"><img src="<?=theme_url?>images/Legal-Status-of-Firm.png" alt="Legal Status of Firm" title="Legal Status of Firm"></div>
                        <div class="title_3">Legal Status of Firm</div>
                        <p>Limited Company (Ltd./Pvt.Ltd.)</p>
                    </div>
                </div>

                <div class="services-block-six col-xxl-3 col-xl-3 col-lg-3 col-md-3 col-sm-6 col-12 wow fadeInRight" data-wow-delay=".6s">
                    <div class="inner">
                        <div class="icon"><img src="<?=theme_url?>images/gst.png" alt="GST Number" title="GST Number"></div>
                        <div class="title_3">GST Number</div>
                        <p>09AASCS0396J1ZM</p>

                    </div>
                </div>

            </div>
        </div>



        <svg class="path_type_1" preserveAspectRatio="none" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg">
            <path d="M0 0 L70 100 L100 0 L100 100 L0 100 Z" fill="#fff" stroke="#fff" stroke-width="-1"></path>
            <path d="M0 -1 L0 0 L50 100 L100 0 L100 -1 Z" fill="rgba(255,255,255,0.0)"></path>
        </svg>
    </section>
    <?php $popular = mysqli_query($dbconn,"select * from category_tbl where parentID!='0' and status='Y' limit 5" ); 
    if(mysqli_num_rows($popular)){?>
    <!-- Home Featured-->
    <section class="webpulse_home_featured">
        <div class="container">
            <div class="title" >Our Popular Products</div>
            <div class="clearfix"></div>
            <div class="row">
                <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                    <div id="featuredProducts" class="wps_featured owl-carousel">
                        <?php  while($popular_res=mysqli_fetch_array($popular)) { ?>
                        <div class="feature_item">
                            <div class="inner-box">
                                <div class="image-box">
                                    <figure class="image"><img src="<?= getImage($popular_res['catImage'], 400, 400, $popular_res['catName'], "/uploaded-files/category/images/");?>" alt="<?=$popular_res['catName']?> in <?= $ca_nam1; ?>" title="<?=$popular_res['catName']?> in <?= $ca_nam1; ?>"></figure>
                                    <div class="overlay-link">
                                        <a href="<?= site_url; ?>/<?= getValidFileName($ca_nam1); ?>/<?= getValidFileName($popular_res['catName']); ?>.htm" class="lightbox-image" title="<?=$popular_res['catName']?> in <?= $ca_nam1; ?>"><span class="icon fa fa-external-link"></span></a>
                                    </div>
                                </div>
                                <div class="lower-content">
                                    <h4 class="tt"><a href="<?= site_url; ?>/<?= getValidFileName($ca_nam1); ?>/<?= getValidFileName($popular_res['catName']); ?>.htm" title="<?=$popular_res['catName']?> in <?= $ca_nam1; ?>"><?=$popular_res['displayName']?></a></h4>
                                    <div class="text"><?=substr($popular_res['catDesc'],0,115);?> ...</div>
                                    <a href="<?= site_url; ?>/<?= getValidFileName($ca_nam1); ?>/<?= getValidFileName($popular_res['catName']); ?>.htm" class="read_more_btn" title="Read More">Read More</a>
                                </div>
                            </div>
                        </div>
                        <?php  } ?>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <?php  } ?>

    <section class="web-pulse-choose">
        <svg class="path_type_1 top" preserveAspectRatio="none" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg">
            <path d="M0 0 L30 100 L100 0 L100 100 L0 100 Z" fill="#fff" stroke="#fff" stroke-width="-1"></path>
            <path d="M0 0 L0 0 L50 100 L100 0 L100 0 Z" fill="rgba(255,255,255,0.0)"></path>
        </svg>
        <div class="container">
            <div class="row">
                <div class="col-xxl-5 col-xl-5 col-lg-5 col-md-5 hidden_xs wow fadeInLeft" data-wow-delay=".3s">
                    <img class="ming" src="<?=theme_url?>images/worker.png" alt="worker" title="worker">
                </div>
                <div class="col-xxl-7 col-xl-7 col-lg-7 col-md-7 col-sm-12 col-12">
                    <div class="home_right_sec wow fadeInLeft" data-wow-delay=".3s">
                        <div class="title">Top Products</div>
                        <div class="clearfix"></div>
                        <div class="row">
                            <?php $top_cat = mysqli_query($dbconn,"select * from category_tbl where parentID='1' and status='Y' limit 4" ); 
    if(mysqli_num_rows($top_cat)){
            while($topcat_res=mysqli_fetch_array($top_cat)) { ?>
                            <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 col-sm-6 wow fadeInRight" data-wow-delay=".4s">
                                <a href="<?= site_url; ?>/<?= getValidFileName($ca_nam1); ?>/<?= getValidFileName($topcat_res['catName']); ?>.htm" title="<?=$topcat_res['displayName']?> in <?= $ca_nam1; ?>">
                                    <div class="service-box">
                                        <div class="service-flip theme-bg">
                                            <div class="service-flip-images" style="background: url('<?=site_url?>/uploaded-files/category/images/<?=$topcat_res[catImage]?>');">
                                                <div class="service-flip-title">
                                                    <h4 class="title_02"><?=$topcat_res['displayName']?></h4>
                                                </div>
                                                <div class="flip-icon"><i class="fa fa-link"></i></div>
                                            </div>

                                        </div>

                                    </div>
                                </a>
                            </div>
                            <?php  } } ?>

                        </div>
                    </div>
                </div>
            </div>
        </div>
        <svg class="path_type_2 home-left" width="21%" height="170" viewBox="0 0 100 102" preserveAspectRatio="none">
            <path d="M0 100 L100 100 L0 10 Z"></path>
        </svg>
        <svg class="path_type_2 home-right" width="80%" height="170" viewBox="0 0 100 102" preserveAspectRatio="none">
            <path d="M0 100 L100 100 L100 50 Z"></path>
        </svg>
    </section>


    

    <?php include 'app_footer_sub.php'; ?>
    <?php include 'app_bottom.php'; ?>
</body>

</html>
