<?php
require_once "../admin/private/initialize.php";
$_SESSION['url'] = $_SERVER['REQUEST_URI'];

if (isset($_GET['company'])) {

    $vendors = Vendor::find_by_cat_url($_GET['company']);
    $id = $vendors->id;
    $contact = ContactProfile::find_vendor($vendors->id);

    $business = BusinessProfile::find_vendor_id($vendors->id);

    $others = OtherProfile::find_vendor_id($vendors->id);

    $plans = Order::find_vender($vendors->id);

    $s_p = Product::find_vendor_id($vendors->id);

    if ($plans) {

        $plan_details = Plan::find_by_id($plans->premium_id);
    }

    $title = ucfirst(strtolower($vendors->vendor_company)) . ' in ' . strtolower($vendors->city) . ', ' . strtolower($vendors->vendor_state) . ', india - Worldsindia';

    $s_description = ucfirst(strtolower($vendors->vendor_company)) . ' is registered company with Worldsindia.' . ' ' . ucfirst(strtolower($vendors->vendor_company)) . ' is a leading suppliers, exporters, wholesaler, & manufacturers of ' . strtolower($s_p->product_name) . ' in ' . strtolower($vendors->city) . ', ' . strtolower($vendors->vendor_state) . ', india.';
    $s_keywords = strtolower($vendors->vendor_company) . ', suppliers, manufacturers, exporters, ' . strtolower($s_p->product_name) . ', india, ' . strtolower($vendors->vendor_state);
}

?>
<!DOCTYPE html>
<html lang="en">

<head>
    <base href="<?php echo $v ?>">
    <title><?php echo $title ?></title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta name="description" content="" />
    <meta name="keywords" content="">
    <meta name="author" content="" />
    <meta name="MobileOptimized" content="320">
    <!-- favicon links-->
    <link rel="icon" href="../../assets/images/favicon.png" type="image/png" />
    <!-- main css -->
    <link rel="stylesheet" href="css/fonts.css" />
    <link rel="stylesheet" href="css/bootstrap.css" />
    <link rel="stylesheet" href="css/font-awesome.css" />
    <link rel="stylesheet" href="css/magnific-popup.css" />
    <link rel="stylesheet" href="css/custom_animation.css" />
    <!--revolution-->
    <link href="js/plugin/revolution/css/settings.css" rel="stylesheet" type="text/css">
    <link href="js/plugin/revolution/css/layers.css" rel="stylesheet" type="text/css">
    <link href="js/plugin/revolution/css/navigation.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="js/plugin/owl/owl.carousel.css" />
    <link rel="stylesheet" href="css/style.css" media="screen" />
    <link rel="stylesheet" href="css/extra.css" rel="stylesheet" type="text/css" />
    
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Audiowide|Sofia|DM+Serif+Display:ital@1">
    
    
</head>

<body>
    
    
    <!--main wrapper start-->
    <div id="wrapper">
        <div class="hm_home_style1">
            <!--top_header start-->
            <?php include 'includes/top-bar.php' ?>
            <!--menu start-->
            <?php include 'includes/header.php' ?>
            <!--banner start-->
            <?php $banners = CatalogueBanner::find_by_cat_id($id); 
                if(count($banners) > 0){
            ?>
            <style>
                @media only screen and (max-width: 768px) {
  .rev_slider_wrapper,
  .fullscreen-container,
  .rev_slider,
  .fullscreenbanner {
    height: 300px !important; /* Set desired height for mobile */
    max-height: 300px;
    overflow: hidden;
  }

  .rev-slidebg {
    object-fit: cover !important;
    height: 100% !important;
    width: 100% !important;
  }

  .tp-caption {
    font-size: 16px !important;
    line-height: 22px !important;
    padding: 5px 10px !important;
  }

  /* Optional: Reduce banner text and spacing for mobile */
  .tp-caption.tp-resizeme {
    font-size: 18px !important;
    line-height: 28px !important;
  }
}

            </style>
            <div class="hm_banner_wrapper">
                <div id="rev_slider_1068_1_wrapper" class="rev_slider_wrapper fullscreen-container" data-alias="levano4export" data-source="gallery" style="background-color:transparent;padding:0px;">
                   <div id="rev_slider_1068_1" class="rev_slider fullscreenbanner" style="display:none;" data-version="5.3.0.2" data-responsive="on">
                        <ul>
                  <?php foreach ($banners as $ban) {  ?>                            
                            <li data-index="rs-3010" data-transition="boxfade" data-slotamount="7" data-hideafterloop="0" data-hideslideonmobile="off" data-easein="default" data-easeout="default" data-masterspeed="1000" data-thumb="" data-rotate="0" data-fstransition="boxfade" data-fsmasterspeed="1000" data-fsslotamount="7" data-saveperformance="off" data-title="Intro" data-param1="" data-param2="" data-param3="" data-param4="" data-param5="" data-param6="" data-param7="" data-param8="" data-param9="" data-param10="" data-description="">
                                <!-- MAIN IMAGE -->
                                <div class="tp-caption tp-shape tp-shapewrapper " id="slide-2800-layer-7" data-x="['center','center','center','center']" data-hoffset="['0','0','0','0']" data-y="['middle','middle','middle','middle']" data-voffset="['0','0','0','0']" data-width="full" data-height="full" data-whitespace="nowrap" data-type="shape" data-basealign="slide" data-responsive_offset="off" data-responsive="off" data-frames='[{"from":"opacity:0;","speed":500,"to":"o:1;","delay":0,"ease":"Power4.easeOut"},{"speed":1000,"to":"opacity:0;","ease":"Power4.easeInOut"}]' data-textAlign="['left','left','left','left']" data-paddingtop="[0,0,0,0]" data-paddingright="[0,0,0,0]" data-paddingbottom="[0,0,0,0]" data-paddingleft="[0,0,0,0]" style="z-index: 5;background-color:rgba(0, 0, 0, 0.60);border-color:rgba(0, 0, 0, 0);border-width:0px;"> </div>
                                <img class="rev-slidebg"
     src="../../vender/<?php echo $ban->picture_path(); ?>"
     data-lazyload="./../../vender/<?php echo $ban->picture_path(); ?>"
     data-bgposition="center center"
     data-bgfit="cover"
     data-bgrepeat="no-repeat"
     data-no-retina
     alt="banner image">

                                 
                                 <!-- LAYER NR. 1 -->
                                <div class="tp-caption sfb sfb tp-resizeme" data-x="center" data-y="center" data-hoffset="0" data-voffset="-150" data-speed="1500" data-start="1000" data-easing="easeOutBounce" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-fontsize="['55','50','40','30']" data-frames='[{"from":"x:[105%];z:0;rX:45deg;rY:0deg;rZ:90deg;sX:1;sY:1;skX:0;skY:0;","mask":"x:0px;y:0px;","speed":2000,"to":"o:1;","delay":1000,"split":"chars","splitdelay":0.05,"ease":"Power4.easeInOut"},{"delay":"wait","speed":1000,"to":"y:[100%];","mask":"x:inherit;y:inherit;","ease":"Power2.easeInOut"}]' data-endeasing="Power4.easeIn" style="font-size:55px;color:#FFFFFF;line-height:140px;text-transform:uppercase;font-weight:600;text-shadow: -4px 4px 3px rgba(51, 51, 51, 0.35);z-index:100;font-family: 'Roboto Slab', serif;letter-spacing:5px;">
                                   <?php echo $ban->banner_name ?>
                                </div>

                                 <!-- LAYER NR. 3 -->
                                <div class="tp-caption NotGeneric-SubTitle   tp-resizeme" id="slide-3045-layer-5" data-x="['center','center','center','center']" data-hoffset="['10','10','10','10']" data-y="['middle','middle','middle','middle']" data-voffset="['40','40','30','30']" data-width="none" data-height="none" data-whitespace="nowrap" data-type="text" data-responsive_offset="on" data-frames='[{"from":"y:[100%];z:0;rX:0deg;rY:0;rZ:0;sX:1;sY:1;skX:0;skY:0;opacity:0;","mask":"x:0px;y:[100%];s:inherit;e:inherit;","speed":1500,"to":"o:1;","delay":2000,"ease":"Power4.easeInOut"},{"delay":"wait","speed":1000,"to":"y:[100%];","mask":"x:inherit;y:inherit;s:inherit;e:inherit;","ease":"Power2.easeInOut"}]' data-textAlign="['center','left','left','left']" data-paddingtop="[25,0,0,0]" data-paddingright="[33,0,0,0]" data-paddingbottom="[10,0,0,0]" data-paddingleft="[33,0,0,0]" style="z-index: 6; white-space: nowrap;text-transform:capitalize;letter-spacing:1px;    font-family: 'Roboto', sans-serif;">
                                    <!--<a href="<?php echo $base_url ?><?php echo $_GET['company'] ?>#quote_request" class="hm_btn" target="_blank" style="margin-left:10px;font-family: 'Roboto', sans-serif;">Inquiry </a>-->
                                </div>

                            </li>
    <?php } ?>
                             </ul>
                    </div>
                </div>
            </div>
            <?php } ?>
          <style>
    .about-us-img {
    max-width: 100%;
    width: 100%;
    height: 257px;
    max-height: 400px;
    /*object-fit: cover;*/
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 80px;
}
@media (max-width: 767px) {
    .about-us-img {
    height: 160px;
    margin-top: 20px;
    }
}
  @media (max-width: 767px) {
    .hm_about_wrapper {
      text-align: center;
      margin-top: -325px;
    }
  }
  
</style>
           <div class="hm_about_wrapper">
    <input type="hidden" id="company_name" value="<?php echo $_GET['company'] ?>">
    <div class="container">
        <div class="row align-items-center">
            <?php
                if ($contact->about_image) {
                    $about_path = "../../vender/" . $contact->about_path();
                    if ($about_path && file_exists($about_path)) {
                        $a_image = $about_path;
                    } else {
                        $a_image = "images/about-welcome2.jpg"; // Static default image
                    }
                } else {
                    $a_image = "images/about-welcome2.jpg"; // Static default image
                }
            ?>
            <div class="col-lg-6 col-md-6 col-sm-12">
                <div class="hm_about_img">
                    <img src="<?php echo $a_image ?>"
                         alt="About Us"
                         class="about-us-img img-fluid">
                </div>
            </div>
     
                        <div class="col-lg-6 col-md-6">
                            <div class="hm_about_data">
                               <h1 style="font-family: 'Poppins', sans-serif;">
    <span class="hm_color" style="color: #272d58;">Welcome</span> To <?php echo $vendors->vendor_company ?>
</h1>
<p style="font-family: 'Poppins', sans-serif;">
    <?php echo $business->company_detail ?>
</p>
<style>
    .hm_btn:before, .cart_icon a:before{
        background-color: #272d58;
    }
</style>
<a href="<?php echo $_SESSION['url'] ?>/about" class="hm_btn" style="font-family: 'Poppins', sans-serif;">read more</a>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--New Arrivals section start-->
            <div class="hm_arrivals_wrapper" style="font-family: 'Poppins', sans-serif;">
                <div class="container">
                    <div class="row">
                        <div class="col-lg-12 col-md-12">
                            <h1 class="hm_heading"><span class="hm_color">Our</span> Products</h1>
                        </div>
                    </div>
                    
                  
                    
                    
                    <div class="hm_product_wrapper">
                <div class="container">
                    <div class="row">
                        <div class="new_pro_inner">
                        <?php $vendor_products = Product::find_by_vendor($vendors->id);
                            foreach($vendor_products as $v_pro){
                        ?>
                            <div class="col-lg-4 col-md-4 col-sm-6">
                                <div class="new_pro_box" style="margin-bottom: 20px;">
                                    <div class="new_pro_img new-set-img">
                                        <img src="../../vender/<?php echo $v_pro->picture_path() ?>" alt="Product_Name" class="img-responsive" />
                                    </div>
                                    <div class="new_pro_data" style="height: 150px;">
                                        <h3 style="font-family: 'Poppins', sans-serif;">
                                            <a href="<?php echo $base_url?>product-detail/<?php echo $v_pro->product_url ?>"><?php echo $v_pro->product_name ?></a></h3>
                                        <p><?php echo substr($v_pro->product_description,0,75) ?></p>
                                        <span class="pro_price" style="color:#4f575a;">Inquiry Now</span>
                                        <span class="cart_icon"><a href="javascript:;" class="popup-with-form" id="<?php echo encrypt_data($v_pro->id) ?>"><i class="fa fa-mail-forward" aria-hidden="true"></i></a></span>
                                    </div>
                                </div>
                            </div>
                            <!--2-->
                            <?php } ?>
                        </div>
                    </div>
                </div>
            </div>
                </div>
            </div>
            <!--Inquiry section start-->
            <div class="hm_choose_wrapper" id="quote_request">
                <div class="container">
                    <div class="row">
                        <div class="col-lg-8 col-md-8 pull-right padding_left">
                            <h1 class="hm_heading text-left"><span class="hm_color" style="color: #272d58;">QUOTE </span> REQUEST</h1>
                            <div class="hm_choose_data">
                                <div class="inq-form text-center">
                                    <form action="send" method="post">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <input type="text" class="form-control" id="name" name="name" required placeholder="Name">
                                            </div>
                                        </div>
                                        <input type="hidden" value="<?php echo encrypt_data($vendors->vendor_email) ?>">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <input type="email" class="form-control" id="email" name="email" required placeholder="Email">
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <input type="text" class="form-control" id="city" name="subject" required placeholder="Subject">
                                            </div>
                                        </div>
                                        <input type="hidden" name="vendor_company_name" value="<?php echo $_GET['company'] ?>">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <input type="text" class="form-control" id="mobile" name="number" required placeholder="Your Mobile Number">
                                            </div>
                                        </div>

                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <input type="text" class="form-control" id="company" name="company_name" required placeholder="Company Name Here">
                                            </div>
                                        </div>

                                        <div class="col-md-12">
                                            <div class="form-group textarea">
                                                <textarea class="form-control" name="message" rows="3" id="message" required placeholder="Message"></textarea>
                                            </div>
                                            <div class="con_btn">
                                                <button type="submit" name="quote_request" class="hm_btn submit_frm"> Submit Request</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--footer start-->
            <?php include 'includes/footer.php' ?>
            <!-- Footer End -->
            <!--popup inquiry form-->
            <div class="hm_login_form_overlay">
                <div class="hm_login_form" id="m_details">

                </div>
            </div>

        </div>
        <!--main wrapper-->
    </div>
    <!--script-->
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/bootstrap.js"></script>
    <script type="text/javascript" src="js/wow.min.js"></script>
    <script type="text/javascript" src="js/plugin/owl/owl.carousel.min.js"></script>
    <script type="text/javascript" src="js/jquery.magnific-popup.js"></script>
    <!--Revolution slider js-->
    <script src="js/plugin/revolution/js/jquery.themepunch.tools.min.js" type="text/javascript"></script>
    <script src="js/plugin/revolution/js/jquery.themepunch.revolution.min.js" type="text/javascript"></script>
    <script src="js/plugin/revolution/js/revolution.extension.navigation.min.js" type="text/javascript"></script>
    <script src="js/plugin/revolution/js/revolution.extension.slideanims.min.js" type="text/javascript"></script>
    <script src="js/plugin/revolution/js/revolution.extension.layeranimation.min.js" type="text/javascript"></script>
    <script src="js/plugin/revolution/js/revolution.extension.parallax.min.js" type="text/javascript"></script>
    <script src="js/plugin/revolution/js/revolution.extension.kenburn.min.js" type="text/javascript"></script>
    <!--Revolution slider js-->
    <script type="text/javascript" src="js/custom.js"></script>
    <script>
        $(document).ready(function() {
            $('.popup-with-form').on('click', function() {
                
                var p_d = $(this).attr("id");
                var v_c = $("#company_name").val();
                $.ajax({

                    type: 'post',
                    url: 'send_inquiry',
                    data: {
                        id: p_d,
                        v_c: v_c,
                    },
                    success: function(data) {
                        $('#m_details').html(data);
                       $('.hm_login_form_overlay').addClass('login_open');
                       $('body').addClass('login_overflow');
                    }
                });
            });
            
        });
    </script>
</body>

</html>