<?php
require('db.php');
include "x.php";
?>
<!doctype html>
<html lang="en">
  <head>
    
     <?php include "include/meta.php"; ?>

     <?php include "include/css.php"; ?>

  </head>
  <body>
<?php include "include/header.php"; ?>


<section class="w3l-contact-breadcrum">
  <div class="breadcrum-bg py-sm-5 py-4">
    <div class="container py-lg-3">
      <h2>Contact Us</h2>
      <p><a href="index.php">Home</a> &nbsp; / &nbsp; Contact</p>
    </div>
  </div>
</section>
<!-- contact -->
<section class="w3l-contacts-12" id="contact">
    <div class="contact-top pt-5">
        <div class="container py-md-3">
            
            <div class="row cont-main-top">
               
                <!-- contact address -->
                <div class="contact col-lg-6">
                    <div class="cont-subs">
                        <div class="cont-add">
                            
                           <div class="cont-add-rgt">
                            <h4><span class="fa fa-map-marker" aria-hidden="true"></span>  Address</h4>
                            <p class="contact-text-sub"><?php echo $user_rows['uaddress1']; ?></p>
                          
                       
                        </div>
                        <div class="cont-add-lft">
                            
                       </div>
                    </div>
                        <div class="cont-add add-2">
                            
                           <div class="cont-add-rgt">
                            <h4><span class="fa fa-envelope" aria-hidden="true"></span> Email:</h4>
                            <a href="mailto:<?php echo $user_rows['umail']; ?>">
                                <p class="contact-text-sub"><?php echo $user_rows['umail']; ?></p>
                            </a>
                        </div>
                        
                    </div>
                        <div class="cont-add">
                           
                            <div class="cont-add-rgt">
                                 <h4><span class="fa fa-phone" aria-hidden="true"></span> Phone:</h4>
                                 <a href="tel:+7-800-999-800">
                                    <p class="contact-text-sub">+91-<?php echo $user_rows['uothcontact'];?>
                                    </p>
                                 </a>
                            </div>
                            
                        </div>
                        <div class="cont-add add-3">
                           
                            <div class="cont-add-rgt">
                                 <h4>Find Us On</h4> <br>
                                 <div class="main-social-1 mt-2">
                                    <a href="<?php echo $user_rows['ufburl']; ?>" class="facebook"><span class="fa fa-facebook"></span></a>
                                    <a href="<?php echo $user_rows['utwitter']; ?>" class="twitter"><span class="fa fa-twitter"></span></a>
                                    <a href="<?php echo $user_rows['uinsta']; ?>" class="instagram"><span class="fa fa-instagram"></span></a>
                                    <a href="<?php echo $user_rows['uyoutube']; ?>" class="google-plus"><span class="fa fa-youtube"></span></a>
                                    <a href="<?php echo $user_rows['linkdin']; ?>" class="linkedin"><span class="fa fa-linkedin"></span></a>
                                </div>
                            </div>
                            <div class="cont-add-lft">
                               
                           </div>
                        </div>
                    </div>
                </div>
                <!-- //contact address -->
                 <!-- contact form -->
                 <div class="contacts12-main col-lg-6 mt-lg-0 mt-5">
                   <div class="cont-subs">
                    <form action="" method="post" class="main-input" style="padding: 16px;">
                        <div class="top-inputs d-grid">
                            <input type="text" placeholder="Name" name="conname" id="conname" required="">
                            <input type="email" name="conemail" placeholder="Email" id="conemail" required="">
                        </div>
                        <input type="text" placeholder="Phone Number" name="conno" id="conno" required="">
                        <textarea placeholder="Message" name="conmessage" id="conmessage" required=""></textarea>
                        <div class="text-right">
                            <button type="submit" class="btn btn-theme2" name="consubmit">Submit Now</button>
                        </div>
                    </form>
                   </div> 
                </div>
                <!-- //contact form -->
            </div>
        </div>
        <!-- map -->
        <div class="map">
            
           <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d58185.06319573705!2d91.99442470357047!3d24.291869205227112!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x37518f3bd206c92d%3A0x5cad918b366f4a5b!2sSaint%20Xavier&#39;s%20High%20School!5e0!3m2!1sen!2sin!4v1668431034602!5m2!1sen!2sin" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
           
           
            
        
        </div>
        <!-- //map -->
    </div>
</section>
<!-- //contact -->

<?php include "include/footer.php"; ?>
<?php include "include/js.php"; ?>

</body>

</html>
<!-- // grids block 5 -->


<?php
  if (isset($_POST['consubmit'])) {
    $conname = mysqli_real_escape_string($con, strip_tags($_POST['conname']));
    $conno = mysqli_real_escape_string($con, strip_tags($_POST['conno']));
    $conemail = mysqli_real_escape_string($con, strip_tags($_POST['conemail']));
    $conmessage = mysqli_real_escape_string($con, strip_tags($_POST['conmessage']));

    $conref = $x;

    $concreatedon = date("j F, Y, g:i a");

    $ins_sql = "INSERT INTO contact (conname, conno, conemail, conmessage, conref, concreatedon) VALUES ( '$conname', '$conno', '$conemail', '$conmessage', '$conref', '$concreatedon')";

    // echo "<pre>";print_r($ins_sql);exit();

    if( mysqli_query($con, $ins_sql) ){
        ?>
        <script>
            alert("Details Sent Successfully");
            window.location = "contact.php";
        </script>
        <?php
    }
    else{
        ?>
        <script>
            alert("Something's Wrong");
            window.location = "contact.php";
        </script>
        <?php
    }
  }
?>              