<?php include_once ('include/head.php'); ?>
    
    <body>
    
    <!-- ***** Preloader Start ***** -->
    <!--<div id="preloader">-->
    <!--    <div class="jumper">-->
    <!--        <div></div>-->
    <!--        <div></div>-->
    <!--        <div></div>-->
    <!--    </div>-->
    <!--</div>  -->
    <!-- ***** Preloader End ***** -->
    
    
    <!-- ***** Header Area Start ***** -->
    <?php include_once ('include/header.php'); ?>
    <!-- ***** Header Area End ***** -->
    
    <?php
     $slug1 = $_GET['slug'];
    $slug = $_GET['slugt'];
   // echo "SELECT * FROM tbl_top_category where slug='$slug1'";
     $home = mysqli_query($mysqli, "SELECT * FROM tbl_top_category where slug='$slug1'");
        while($rok = mysqli_fetch_array($home))
        {
        $tid = $rok['tcat_id']; 
        
        }
        if($tid == '')
        {
             ?>
    <script>window.location.href = "https://swamiajayji.com/404";
</script>
<?php

        }
    $det = mysqli_query($mysqli, "SELECT * FROM `tbl_product` where slug='$slug'");
    while($roj = mysqli_fetch_array($det))
    {
        $name = $roj['p_name'];
        $desc = $roj['p_description'];
        $p_short_description = $roj['p_short_description'];
        $ides = $roj['p_id'];
    }
    ?>

    <!-- ***** About Area Starts ***** -->
    <section class="section" id="about">
        <div class="container">
            <div class="row">
                <div class="col-lg-6 col-md-6 col-xs-12 mb-4">
                    <div class="left-text-content" data-aos="zoom-out-down" data-aos-duration="800" class="aos-init aos-animate">
                        <div class="section-heading">
                            
                            <h2><?php echo $name; ?></h2>
                        </div>
                        <p><?php echo $desc; ?></p>
                    </div>
                </div>
                <div class="col-lg-6 col-md-6 col-xs-12 mb-4">
                    <div class="right-content">
                        <div class="thumb" data-aos="zoom-in-up">
                            <?php
                            $img = mysqli_query($mysqli, "SELECT * FROM `tbl_product_photo` where p_id=$ides");
                            while($rok = mysqli_fetch_array($img))
                            {
                                $photo = $rok['photo'];
                            }
                            ?>
                            
                            <img src="<?php path(); ?>/admin/assets/images/product-image/<?php echo $photo; ?>" alt="">
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-lg-8 col-md-8 col-xs-12 mb-4">
                    <div class="left-text-content" data-aos="zoom-in-up">
                        
                        <p><?php echo $p_short_description; ?></p>
                    </div>
                </div>


<?php
            if(isset($_POST['submit']))
            {
                $name=$_POST['name_quote'];
$phone=$_POST['phone'];
$email=$_POST['email_quote'];
$subject=$_POST['pooja_type'];
$message=$_POST['message_quote'];
   
$to = "swamiajay@gmai.com";
$subject = "Website Enquiry Data";

$output ="
<html>
<head>
<title>Send Messages</title>
</head>
<body>
<p>Send Messages!</p>
<table border='1'>
<tr>
<th>Name</th>
<th>Phone</th>
<th>Email</th>
<th>Pooja Type</th>
<th>Address</th>
<th>Message</th>
</tr>
<tr>
<td>$name</td>
<td>$phone</td>
<td>$email</td>
<td>$subject</td>
<td>$message</td>
</tr>
</table>
</body>
</html>
";

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: <webmaster@example.com>' . "\r\n";
$headers .= 'Cc: myboss@example.com' . "\r\n";

$mail_send = mail($to,$subject,$output,$headers);   
if($mail_send){
   echo "Email Sent GET Quates Successfully"; 
}else{
    echo "Something Went Wrongs";
}
            }
            ?>
            
                <div class="col-lg-4 col-md-4 col-xs-12 mb-4">
                    <div class="contact-form"  data-aos="zoom-out-down" data-aos-duration="800" class="aos-init aos-animate">
                        <form id="contact" class="contact" action="" method="post" style="background-color: #ff5d40;">
                          <div class="row">
                                <div class="col-lg-12">
                                    <h4>Request a Free Quote!</h4>
                                </div>
                                <div class="col-lg-6 col-sm-12">
                                    <fieldset>
                                        <input name="name_quote" type="text" id="name" placeholder="Your Name*" required="">
                                    </fieldset>
                                </div>
                                <div class="col-lg-6 col-sm-12">
                                    <fieldset>
                                        <input name="email_quote" type="text" id="email" pattern="[^ @]*@[^ @]*"
                                            placeholder="Your Email Address" required="">
                                    </fieldset>
                                </div>
                                <div class="col-lg-6 col-sm-12">
                                    <fieldset>
                                        <input name="phone" type="text" id="phone" class="phone" placeholder="Phone Number*"
                                            required="">
                                    </fieldset>
                                </div>

                                <div class="col-md-6 col-sm-12">
                                    <fieldset>
                                        <select value="time" name="pooja_type" id="time">
                                            <option value="">Pooja Type</option>
                                            <?php
                                            $service = mysqli_query($mysqli, "SELECT * FROM tbl_top_category where show_on_menu='1'");
                            while($row = mysqli_fetch_array($service))
                            {
                                $tcat_name = $row['tcat_name'];
                                $tcat_id = $row['tcat_id'];
                                $slug_one = $row['slug'];
                                            ?>
                                            <option value="<?php echo $tcat_name; ?>"><?php echo $tcat_name; ?></option>
                                            <?php
                            }
                            ?>
                                        </select>
                                    </fieldset>
                                </div>
                                <div class="col-lg-12">
                                    <fieldset>
                                        <textarea name="message_quote" rows="6" id="message" placeholder="Message"
                                            required=""></textarea>
                                    </fieldset>
                                </div>
                                <div class="col-lg-12">
                                    <fieldset>
                                        <button type="submit" name="quote" id="form-submit" class="main-button-icon">Book Pandit Now</button>
                                    </fieldset>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>

        </div>
    </section>
    <!-- ***** About Area Ends ***** -->

    <!-- ***** Footer Start ***** -->
    <?php include_once ('include/footer.php'); ?>


  </body>
</html>