<?php session_start();
include("includes/db_config.php"); 
if (isset($_POST['submit'])) {
  extract($_POST);

   date_default_timezone_set('Asia/Kolkata');
 $date = date('Y-m-d H:i:s');
$ip=$_SERVER['REMOTE_ADDR'];
  $sql="INSERT into enquiry(name,email,phone,subject,message,created_date,ip_address) values ('$name','$email','$phone','$subject','$message','$date','$ip')";
   $result = mysqli_query($conn, $sql);
   if($result){
       echo '<script>alert("Thank You! We Will Get Back To You.")</script>'; 
   }

} ?><!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content=" ">
    <meta name="author" content="">
    <title>Orange Groceries</title>
    <?php include("includes/css.php");?>
</head>

<body>
    <?php include("includes/header.php");?>

    <section class="pt-3 pb-3 page-info section-padding border-bottom bg-white">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <a href="https://orangegroceries.com/index.php"><strong><span class="mdi mdi-home"></span> Home</strong></a> <span class="mdi mdi-chevron-right"></span> <a href="#">Contact Us</a>
                </div>
            </div>
        </div>
    </section>
   <section class="section-padding">
         <div class="container">
            <div class="row">
               <div class="col-lg-4 col-md-4 text-dark">
                  <h3 class="mt-1 mb-5">Get In Touch</h3>
				  <h6 class="text-dark"><i class="mdi mdi-home-map-marker"></i> Address :</h6> 
                  <p class=""> Hyderabad, Telangana- India </p>
                  <h6 class="text-dark"><i class="mdi mdi-phone"></i> Phone :</h6>
                  <p><a href="tel:09876543210">+91-9876543210</a></p>
               
                  <h6 class="text-dark"><i class="mdi mdi-email"></i> Email :</h6>
                  <p><a href="mailto:support@orangegroceries.com">support@orangegroceries.com</a></p> 
                  <div class="footer-social"><span>Follow : </span>
                     <a href="#" target="_new"><i class="mdi mdi-facebook"></i></a>
                     <a href="#" target="_new"><i class="mdi mdi-twitter"></i></a>
                     <a href="#" target="_new"><i class="mdi mdi-instagram"></i></a> 
                  </div>
               </div>
               <div class="col-lg-8 col-md-8 bg-white">
                   <div class="row ">
               <div class="col-lg-12 col-md-12 section-title text-left mb-4">
                  <h2>Contact Us</h2>
               </div>                        
               <form class="col-lg-12 col-md-12" method="post" name="sentMessage" id="contactForm">
                    <center><h3 style="color:green;"></h3></center>  
                  <div class="control-group form-group">
                     <div class="controls">
                        <label>Full Name <span class="text-danger">*</span></label>
                        <input type="text" placeholder="Full Name" class="form-control" id="name" name="name" required="required" data-validation-required-message="Please enter your name.">
                        <p class="help-block"></p>
                     </div>
                  </div>
                  <div class="row">
                     <div class="control-group form-group col-md-6">
                        <label>Phone Number <span class="text-danger">*</span></label>
                        <div class="controls">
                           <input type="text" placeholder="Phone Number" class="form-control" id="phone" required="required" pattern="[1-9]{1}[0-9]{9}" name="phone" data-validation-required-message="Please enter your phone number.">
                        <div class="help-block"></div></div>
                     </div>
                     <div class="control-group form-group col-md-6">
                        <div class="controls">
                           <label>Email Address <span class="text-danger">*</span></label>
                           <input type="email" placeholder="Email Address" class="form-control" id="email" required="required" name="email" data-validation-required-message="Please enter your email address.">
                        <div class="help-block"></div></div>
                     </div>
                  </div>
                    
                     <div class="control-group form-group">
                     <div class="controls">
                        <label>Subject <span class="text-danger">*</span></label>
                        <input type="text" placeholder="Subject" class="form-control" id="name" required="required" name="subject" data-validation-required-message="Please enter your Subject.">
                        <p class="help-block"></p>
                     </div>
                  </div> 
                  <div class="control-group form-group">
                     <div class="controls">
                        <label>Message <span class="text-danger">*</span></label>
                        <textarea rows="4" cols="100" placeholder="Message" name="message" class="form-control" id="message" required="" data-validation-required-message="Please enter your message" maxlength="999" style="resize:none"></textarea>
                     <div class="help-block"></div></div>
                  </div>
                  <div id="success"></div>
                  <!-- For success/fail messages -->
                  <button name="submit" value="submit" type="submit" class="btn btn-success">Send Message</button>
               </form>
            </div>
               </div>
            </div>
         </div>
      </section>
    <?php include("includes/footer.php");?>
    <?php include("includes/js.php");?>

    <script>
        $(document).ready(function() {
            $("#add_addresss").click(function() {
                $("#show_address").toggle();
            });
        });

    </script>
</body>

</html>
