MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 3.16.47.89
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/uttamnagarproperties.com/../theservicemen.co.in/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/uttamnagarproperties.com/../theservicemen.co.in/contactus-p.php
<title>Contact Us | The Service Men</title>
<meta name="Visit Us | Tundla Firozabad, Uttar Pradesh, India - 283204 | info@theservicemen.co.in | 7500964101" content="Free Web tutorials">
  <meta name="keywords" content="HTML, CSS, JavaScript">
<?php include 'headtags.php';?>
<?php include 'header.php';?>  
   <style type="text/css">

         .contact-head h1
    {
        margin-top:200px;
    }
    .form-floating>label{
        left:10 ;
    }
    form{
        box-shadow:1px 1px 3px 3px grey;
        padding:20px;
        width:100%;
        border-radius:20px;
    }
   </style>
   
   <div style="background-color:black; height:300px;" class="container-fluid">
   <div class="row">
       <div class="contact-head text-center text-white">
           <h1>Contact</h1>
       </div>
   </div>
</div>


<?php
include_once('admin/config.php');

if ($_SERVER["REQUEST_METHOD"] === "POST") {
    if (isset($_POST['submit'])) {
        $name = $_POST['name'];
        $email = $_POST['email'];
        $phone = $_POST['phone'];
        $subject = $_POST['subject'];
        $message = $_POST['message'];

        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 `tb7_user_issue` (`name`, `email`, `phone`, `subject`, `message`) VALUES (?, ?, ?, ?, ?)";
            $stmt = mysqli_prepare($db, $query);
            mysqli_stmt_bind_param($stmt, "sssss", $name, $email, $phone, $subject,  $message);
            $result = mysqli_stmt_execute($stmt);
            mysqli_stmt_close($stmt);

            if ($result) {
                // Sending email
                // $to = "saifinoushad294@gmail.com";
                $to = "info@theservicemen.co.in";
                $subject = "New Query Submitted";
                $emailMessage = "A new query has been submitted:\n\n";
                $emailMessage .= "Name: $name\n";
                $emailMessage .= "Email: $email\n";
                $emailMessage .= "Phone: $phone\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 = '$wspath' + 'contactus-p';
                </script>";
                } else {
                echo "Error sending email.";
                }
            } else {
               echo "Error";
               }
        }
    }
 }
?>



   

 <section id="contact" class="contact">
      <div class="container" data-aos="fade-up">

        <div class="section-title">
          <h2>Contact</h2>
          <p>Contact Us</p>
        </div>

        

        <div class="row mt-5">
 <?php
include 'admin/config.php';
 $sql = "SELECT * FROM tb1_admin";
 $run = mysqli_query($db,$sql);
 while($data = mysqli_fetch_assoc($run)){
 ?>
          <div class="col-lg-4">
            <div class="info">
              <div class="address">
                <i class="bi bi-geo-alt"></i>
                <h4>Location:</h4>
                <p><?php echo $data['admin_address']?></p>
              </div>

              <div class="email">
                <i class="bi bi-envelope"></i>
                <h4>Email:</h4>
                <p><?php echo $data['admin_email']?></p>
              </div>

              <div class="phone">
                <i class="bi bi-phone"></i>
                <h4>Call:</h4>
                <p><?php echo $data['admin_phone']?></p>
              </div>

            </div>

          </div>
        <?php
    }
    ?>  
    
    <div class="col-lg-8 mt-5 mt-lg-0">
            <form action="<?php $_PHP_SELF?>" method="POST">
                <div class="form-floating mb-3">
                  <input type="text" class="form-control" name="name" id="floatingInput" placeholder="name">
                  <label for="floatingInput">Enter Your Full Name</label>
                </div>
                <div class="form-floating  mb-3">
                  <input type="email" class="form-control" name="email" id="floatingPassword" placeholder="name@gmail.com">
                  <label for="floatingPassword"> Enter Email </label>
                </div>
                <div class="row">
                <div class="form-floating col mb-3">
                  <input type="text" class="form-control" name="phone" id="floatingPassword" placeholder="Phone">
                  <label for="floatingPassword"> Enter Phone No.</label>
                </div>
                <div class="form-floating col mb-3">
                  <input type="text" class="form-control" name="subject" id="floatingPassword" placeholder="Phone">
                  <label for="floatingPassword"> Subject</label>
                </div>
                </div>
                <div class="form-floating mb-3">
                  <input type="text" class="form-control" name="message" id="floatingPassword" placeholder="Phone">
                  <label for="floatingPassword"> Massage</label>
                </div>
                <div class="text-center">
                    <input type="submit" name="submit" style=" background-color: #ea622b;
    color: #FFFFFF;
    cursor: pointer;
    height: 55px;
    text-transform: uppercase;
    margin: 0;
    border: none; width:600px;"  value="Send Massage">
                </div>
            </form>
          </div>
    </div>
    <div>
          <iframe style="border:0; width: 100%; height: 270px;" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3608.3096210893705!2d83.26587607415614!3d25.260167929149553!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x398e3c7fd771b1fd%3A0xf52916bf23f4da64!2sDelhi%20-%20Kolkata%20Hwy%2C%20Gautam%20Nagar%2C%20Chandauli%2C%20Uttar%20Pradesh!5e0!3m2!1sen!2sin!4v1709623926552!5m2!1sen!2sin" frameborder="0" allowfullscreen></iframe>
        </div>

      </div>
    </section>
    <?php include 'footer.php';?>

MMCT - 2023