<?php
include_once("include/main.inc.php");
$admin_res=getAdminDetails();
$pg= "contact";
$page_metatitle = "Best Fertility & IVF Centre in Santacruz, Vikhroli East, Bhandup West, Mumbai";
$page_metakey = "IVF Centre in Santacruz, IVF Centre in Vikhroli East, IVF Centre in Bhandup West, Sunshine Fertility & IVF Center, Sunshine Fertility & IVF Center Mumbai, Sunshine Fertility & IVF CenterSantacruz, Sunshine Fertility & IVF Center India";
$page_metadesc = "Book An Appointmen with IVF Doctors &  Infertility Specialist  in Santacruz, Vikhroli East, Bhandup West, Mumbai - Sunshine Fertility & IVF Centre, Best Fertility & IVF Centre in Santacruz.";
$referer = $_SERVER['HTTP_REFERER'];
    $ip=$_SERVER['REMOTE_ADDR'];
    $mobileNumber = "";
    if (isset($_POST['submit-contact']))
    {
        $name = !empty($_POST['names'])?$_POST['names']:'';
        $email = !empty($_POST['emails'])?$_POST['emails']:'';
        $mobileNumber = (!empty($_POST['mobiles']))?$_POST['mobiles']:'';
        $location = !empty($_POST['locations'])?$_POST['locations']:'';
        $message = !empty($_POST['messages'])?$_POST['messages']:'';
      if(strpos($message,'#')!==false || strpos($message,'%')!==false || strpos($message,'@')!==false || strpos($message,'&')!==false || strpos($message,'~')!==false || strpos($message,'https')!==false || strpos($message,'http')!==false || strpos($message,'www')!==false || strpos($message,'?')!==false || strpos($message,'/')!==false){
      $errMsg ='URL(s) and special characters are not allowed!';
  } else {    
            if($name != '' && $email != '' && $mobileNumber != '' && $location != '' && $message != '' && $ip != '' ){
if(strlen($mobileNumber)==10){
//$qry=mysql_query($sql_ens);	
	//reCAPTCHA validation
               if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) {

        $secret = '6Lf6jT0iAAAAAEapAXKmph4SQwiH24I7sTcF6h_3';
		//get verify response data
        $data = array( 'secret' => $secret, 'response' => $_POST['g-recaptcha-response'] ); $verify = curl_init(); curl_setopt($verify, CURLOPT_URL, "https://www.google.com/recaptcha/api/siteverify"); curl_setopt($verify, CURLOPT_POST, true); curl_setopt($verify, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($verify, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($verify, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($verify); //var_dump($response);
        $response = json_decode($response);
        if (!$response->success) {
            $errMsg = 'Please click on the reCAPTCHA box.';
        }	
        
        if($response->success) {

            $sql_ens="insert into tbl_enquiry set en_name='$name', en_email='$email', en_mobile='$mobileNumber', en_country='$location', en_comment='$message', en_url='$referer', en_date=now()";
            $qry=mysqli_query($dbconn,$sql_ens);

            $subject = utf8_encode('Webpulseindia.com '.' - '. $admin_res['subject']);
            $htmlContent = "
            Customer Details:

            Url: ".$referer."

            Name: ".$name."

            Email: ".$email."

            Mobile: ".$mobileNumber."

            Location:".$location."

            Message: ".$message."
            ";
            
            $to =  $admin_res['email'];
$to2 = $admin_res['cc'];
$to3 = $admin_res['bcc'];
            
   $headers = 'From: '.'Webpulseindia.com'.' enquiry@webpulseindia.com' . "\r\n" .
            'Reply-To:  '.$name.'<'.$email.'>' . "\r\n" .
            'X-Mailer: PHP/' . phpversion();
            @mail($to,$subject,$htmlContent,$headers);
            @mail($to2,$subject,$htmlContent,$headers);
            @mail($to3,$subject,$htmlContent,$headers);
            $succMsg = 'Thank you for your enquiry. Our team will contact you soon.';
       }  
} else { $errMsg ='Robot verification failed, please try again.';}
} else { $errMsg ='Please Enter 10 Digit Mobile Number';}
} else { $errMsg ='All the fields are Mandatory!';}
}
}

?>
<!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><?=$page_metatitle?></title>
 <meta name="description" content="<?=$page_metadesc?>" >
 <meta name="keywords" content="<?=$page_metakey?>" >
    <?php include "app_top.php"; ?>
</head>

<body>
    <?php include "app_header.php"; ?>

    <section class="heading_banner" style="background-image: url(<?=theme_url?>images/contact-us.jpg)">
        <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 text-center">
                    <h1 class="cat_title">Contact Us</h1>
                    <div class="clearfix"></div>
                    <div class="cat_title2">We Are Available For You</div>
                </div>
            </div>
        </div>
    </section>

    <!-- Breadcrumb-->
    <section class="inner_breadcrumb hidden_xs">
        <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">
                    <ul class="breadcrumb">
                        <li><a href="<?=site_url?>" title="Home">Home</a></li>
                        <li class="active">Contact Us</li>
                    </ul>
                </div>
            </div>
        </div>
    </section>


    <!-- Home About-->
    <section class="contact_page">
        <div class="container">
            <div class="contact_form_grid1">
                <div class="row">
                    <div class="col-xxl-5 col-xl-5 col-lg-5 col-md-5 col-sm-12 col-12 contact_details">
                        <h2>Contact Information</h2>
                        <p>Write to us or call us, get quick response powered by our advanced coustomer support team .</p>
                        <ul class="address_list">
                            <li><span class="fa fa-map-marker"></span> <?=$admin_res['address']?></li>


                            <li><a href="tel:<?=$admin_res['phone']?>" title="Call us"><span class="fa fa-phone"></span> Call: <?=$admin_res['phone']?></a></li>
                            <li><a href="https://api.WhatsApp.com/send?phone=<?=$admin_res['phone']?>" title="Whatsapp Now"><span class="fa fa-whatsapp"></span> Whatsapp: <?=$admin_res['phone']?></a></li>
                            <li><a href="<?=$admin_res['website']?>" title="<?=$admin_res['website']?>"><span class="fa fa-globe"></span> <?=$admin_res['website']?></a></li>
                        </ul>
                        <h3>Get in Touch</h3>
                        <ul class="social_list">
                            <?php if(facebook()){ ?>
                            <li><a href="<?php echo facebook();?>" target="blank"><i class="fa fa-facebook-f"></i></a>
                            </li>
                            <?php } ?>
                            <?php if(twitter()){ ?>
                            <li><a href="<?php echo twitter();?>" target="blank"><i class="fa fa-twitter"></i></a>
                            </li>
                            <?php } ?>
                            <?php if(instagram()){ ?>
                            <li><a href="<?php echo instagram();?>" target="blank"><i class="fa fa-instagram"></i></a>
                            </li>
                            <?php } ?>
                            <?php if(linkedin()){ ?>
                            <li><a href="<?php echo linkedin();?>" target="blank"><i class="fa fa-linkedin"></i></a>
                            </li>
                            <?php } ?>
                            <?php if(youtube()){ ?>
                            <li><a href="<?php echo youtube();?>" target="blank"><i class="fa fa-youtube"></i></a>
                            </li>
                            <?php } ?>
                        </ul>
                    </div>
                    <div class="col-xxl-7 col-xl-7 col-lg-7 col-md-7 col-sm-12 col-12 form_grid">
                        <h4>We want to hear from you!</h4>
                        <form name="contact-form" method="post" id="contact_form">
                            <script src="https://www.google.com/recaptcha/api.js" async defer></script>
                            <?php if(!empty($errMsg)): ?><div class="alert alert-danger alert-dismissible fade show"><?php echo $errMsg; ?><button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div><?php endif; ?>
                            <?php if(!empty($succMsg)): ?><div class="alert alert-success alert-dismissible fade show"><?php echo $succMsg; ?><button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div><?php endif; ?>
                            <div class="row">
                                <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">
                                    <div class="form-group">
                                        <input class="form-control" type="text" name="names" placeholder="Full Name*" required>
                                    </div>
                                </div>
                                <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">
                                    <div class="form-group">
                                        <input class="form-control" type="email" name="emails" placeholder="Email ID*" required>
                                    </div>
                                </div>
                                <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">
                                    <div class="form-group">
                                        <input class="form-control" type="tel" name="mobiles" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" maxlength="10" placeholder="Phone No*" required>
                                    </div>
                                </div>
                                <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-6 col-sm-6 col-12">
                                    <div class="form-group">
                                        <input class="form-control" type="text" name="locations" placeholder="Location*" required>
                                    </div>
                                </div>
                                <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                                    <div class="form-group">
                                        <textarea class="form-control" rows="5" placeholder="Comments Here*" required name="messages"></textarea>
                                    </div>
                                </div>
                                <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                                    <div class="form-group" style="margin-bottom: 0;">
                                        <div class="g-recaptcha" data-sitekey="6Lf6jT0iAAAAACzJctoG1Vcppxw_i7sj6-ed6IZ9"></div>
                                    </div>
                                </div>
                                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                    <div class="form-group">
                                        <button type="submit" name="submit-contact" class="read_more">Submit</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <iframe class="contact_map" src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d7539.545355194225!2d72.932769!3d19.117626!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0xdfe7dd500eba8515!2sSunshine%20Fertilty%20%26%20IVF%20Centre!5e0!3m2!1sen!2sin!4v1655124222631!5m2!1sen!2sin" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>

    <?php include "app_footer.php";?>
    <?php include "app_bottom.php";?>
</body>

</html>
