MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 3.142.156.58
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/adisgauges.com/../mystudiob.co.in/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/adisgauges.com/../mystudiob.co.in/contact-us.php
<?php
    include_once('admin/config.php');
    
    function isAllowedMessage($message) {
        $allowedChars = '/^[a-zA-Z0-9,@. ]*$/';
        return preg_match($allowedChars, $message);
    }
    
    if ($_SERVER["REQUEST_METHOD"] === "POST") {
        if (isset($_POST['submit'])) {
            $name = $_POST['name'];
            $phone = $_POST['phone'];
            $email = $_POST['email'];
            // $subject = $_POST['subject'];
            $message = $_POST['message'];
            date_default_timezone_set("Asia/Kolkata");
            $currentTime = date("Y-m-d H:i:s");
            $errors = array();
    
            // Validate input
            if (empty($name)) {
                $errors[] = "Name field is required.";
            } elseif (!preg_match('/^[a-zA-Z ]+$/', $name)) {
                $errors[] = "Name can only contain alphabets.";
            }
    
            if (empty($email)) {
                $errors[] = "Email field is required.";
            } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
                $errors[] = "Invalid email format.";
            }
    
            if (empty($phone)) {
                $errors[] = "Phone field is required.";
            } elseif (!preg_match('/^\d{10}$/', $phone)) {
                $errors[] = "Phone number should have exactly 10 digits.";
            }
    
            // Sanitize input
            $name = filter_var($name, FILTER_SANITIZE_STRING);
            $phone = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);
            $email = filter_var($email, FILTER_SANITIZE_EMAIL);
            // $subject = filter_var($subject, FILTER_SANITIZE_STRING);
            $message = htmlspecialchars($message, ENT_QUOTES, 'UTF-8');
    
            // Check for potentially malicious content in the message
            if (!isAllowedMessage($message)) {
                $errors[] = "Your message contains potentially malicious content or disallowed characters.";
            }
    
    if (empty($errors)) {
        // Your existing code for successful submission
        $query = "INSERT INTO `tbl_queries` (`name`, `phone`, `email`, `message`, `datetime`) VALUES (?, ?, ?, ?, ?)";
        $stmt = mysqli_prepare($db, $query);
    
        if ($stmt) {
            mysqli_stmt_bind_param($stmt, "sssss", $name, $phone, $email, $message, $currentTime);
            $result = mysqli_stmt_execute($stmt);
            mysqli_stmt_close($stmt);
    
            if ($result) {
                $to = "digitalsaleem12@gmail.com";
                // $to = "rinkukundu.kuk@gmail.com";
                $subject = "New Query Submitted";
                $emailMessage = "A new query has been submitted:\n\n";
                $emailMessage .= "Name: $name\n";
                $emailMessage .= "Phone: $phone\n";
                $emailMessage .= "Email: $email\n";
                // $emailMessage .= "Subject: $subject\n";
                $emailMessage .= "Message: $message\n";
                
                $headers = "From: $email";
                
                if (mail($to, $subject, $emailMessage, $headers)) {
                echo "<script>
                window.alert('Successfully Sent! We will contact you soon');
                window.location.href = 'contact-us.html';
                </script>";
            } else {
               echo "Error sending email.";
                }
            } else {
                $errors[] = "Error in processing your request. Please try again later.";
            }
        } else {
            $errors[] = "Error in preparing the statement.";
        }
    } else {
        // Display validation errors in an alert
        echo "<script>
            var errorMessage = '";
        foreach ($errors as $error) {
            echo addslashes($error) . "\\n";
        }
        echo "';
            window.alert(errorMessage);
        </script>";
    }
        }
    }
?>
<!DOCTYPE html>

<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
<title>Contact Us - STUDIO B DENTAL SKIN & HAIR CLINIC</title>
<meta name="description" content="Visit our Clinic at Near Civil,Hospital, Jagadhri Distt, Yamunanagar | contact us at rinkukundu.kuk@gmail.com | +91-7404685585
" />

<meta name="page-topic" content="Contact Us">
<?php include 'top-link.php';?>
<style>
.service-icon-box a {
	height: 45px;
	width: 40px;
	line-height: 57px;
}
.mb-0d {
	margin-bottom: 0!important;
	padding-top: 10px;
}
.d-mt {
	margin-top: 10px !important;
}
.pd-10 {
	padding: 10px;
}
#contact_form{
    box-shadow:1px 1px 3px 3px grey;
    padding:16px;
}
</style>
</head>
<body class="">
<div id="wrapper">
  
  <?php include 'header.php';?>

  <div class="main-content">
    <section class="inner-header divider parallax layer-overlay overlay-white-5" data-bg-img="<?php echo $wspath?>images/bg/breadkumb.png">
      <div class="container pt-60 pb-60">
        <div class="section-content">
          <div class="row">
            <div class="col-md-12 text-center">
              <h2 class="title" style="color:white;">Contact Us</h2>
              <ol class="breadcrumb text-center  mt-10">
                <li><a href="<?php echo $wspath?>" style="color:white;">Home</a></li>
                <li class="active text-theme-colored " style="color:white;">Contact Us</li>
              </ol>
            </div>
          </div>
        </div>
      </div>
    </section>
   
    
    <section class="divider">
      <div class="container">
        <div class="row pt-30">
          <div class="col-md-4">
            <div class="row">
              <div class="col-xs-12 col-sm-12 col-md-12">
                <div class="icon-box left media bg-deep p-30 mb-20"> <a class="media-left pull-left" href="#"> <i class="pe-7s-map-2 text-theme-colored"></i></a>
                  <div class="media-body">
                    <h5 class="mt-0">Our Office Location</h5>
<p><?php echo $datac["address"]; ?></p>
                   
                  </div>
                </div>
              </div>
              <div class="col-xs-12 col-sm-6 col-md-12">
                <div class="icon-box left media bg-deep p-30 mb-20"> <a class="media-left pull-left" href="#"> <i class="pe-7s-call text-theme-colored"></i></a>
                  <div class="media-body">
                    <h5 class="mt-0">Contact Number</h5>
                    <p>Mobile:<span><a href="tel:<?php echo $datac["phone"]; ?>"><?php echo $datac["phone"]; ?></a></span></p>
                  </div>
                </div>
              </div>
              <div class="col-xs-12 col-sm-6 col-md-12">
                <div class="icon-box left media bg-deep p-30 mb-20"> <a class="media-left pull-left" href="#"> <i class="pe-7s-mail text-theme-colored"></i></a>
                  <div class="media-body">
                   <h3 class="title">Email</h3>
                                <p><a href="mailto:<?php echo $datac["email"]; ?>">
                                        <?php echo $datac["email"]; ?>
                                    </a></p>
                  </div>
                </div>
              </div>
             
            </div>
          </div>
          <div class="col-md-8">
            <h3 class="line-bottom mt-0 mb-30">Interested in discussing?</h3>
            <form id="contact_form"action="<?php $_PHP_SELF?>" method="post">

              <div class="row">
                <div class="col-sm-12">
                  <div class="form-group">
                    <label>Name <small>*</small></label>
                    <input name="name" class="form-control" type="text" placeholder="Enter Name" required>
                    <?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-12">
                  <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-12">
                  <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}" 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 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>

              <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">
                <input name="form_botcheck" class="form-control" type="hidden" value="" />
                <button type="submit" class="btn btn-dark btn-theme-colored btn-flat mr-5" data-loading-text="Please wait..." name="submit">Send your message</button>
                <!--<button type="reset" class="btn btn-default btn-flat btn-theme-colored">Reset</button>-->
              </div>
            </form>
            <!--<script>-->
            <!--  $("#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.php();-->
            <!--      form_btn.php(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).php(form_btn_old_msg);-->
            <!--          $(form_result_div).php(data.message).fadeIn('slow');-->
            <!--          setTimeout(function(){ $(form_result_div).fadeOut('slow') }, 6000);-->
            <!--        }-->
            <!--      });-->
            <!--    }-->
            <!--  });-->
            <!--</script>-->
          </div>
        </div>
      </div>
    </section>
  </div>
   <section>
      <div class="container-fluid pt-0 pb-0">
        <div class="">
               <iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d110378.5330765845!2d77.291474!3d30.170589999999997!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x390efbe4a6d1dd71%3A0x93ff2e2235c41515!2sCivil%20Hospital%20Jagadhri!5e0!3m2!1sen!2sin!4v1707735754560!5m2!1sen!2sin" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
            </div>
      </div>
    </section>
  <section style="background-color:#0cb8b6; padding:10px;">
    <div class="container" style="padding:10px 0px;">
      <div class="row">
        <div class="col-md-10">
          <h2 style="color:#fff;">Get In Touch With Us!!!!</h2>
        </div>
        <div class="col-md-2"> <a class="rd-mr" href="tel:+91-7404685585" style="position:relative; top:25px;">Contact Us <i class="fa fa-angle-double-right"></i></a> </div>
      </div>
    </div>
  </section>
  <?php include 'footer.php'?>
  <a class="scrollToTop" href="#"><i class="fa fa-angle-up"></i></a>
</div>
<!--<script src="js/custom.js"></script>-->
</body>
</html>

MMCT - 2023