/
home
/
smartexorg
/
public_html
/
New File
New Folder
Upload
Terminal
DB Connect
HOME
Edit File: query-form1.php
<?php // error_reporting(0); include_once "config.php"; date_default_timezone_set('Asia/Calcutta'); $date = date("Y-m-d H:i:s"); // define('MAXSIZE', 10 * 1024 * 1024); // allow max 10 MB function clean($string) { $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens. return preg_replace('/[^.A-Za-z0-9\-]/', '', $string); // Removes special chars. } if (isset($_POST['visitorq']) == "active") { $firmname = mysqli_real_escape_string($link, $_POST['firmname']); $firstname = mysqli_real_escape_string($link, $_POST['firstname']); $email = mysqli_real_escape_string($link, $_POST['email']); $mobile = mysqli_real_escape_string($link, $_POST['mobile']); $description = mysqli_real_escape_string($link, $_POST['description']); $abouttheproject = mysqli_real_escape_string($link, $_POST['abouttheproject']); $drawingoftheproject = mysqli_real_escape_string($link, $_POST['drawingoftheproject']); $image3d = mysqli_real_escape_string($link, $_POST['image3d']); $completedproject = mysqli_real_escape_string($link, $_POST['completedproject']); $credentials = mysqli_real_escape_string($link, $_POST['credentials']); $videos = mysqli_real_escape_string($link, $_POST['videos']); $photos = mysqli_real_escape_string($link, $_POST['photos']); $areaproject = mysqli_real_escape_string($link, $_POST['areaproject']); $projectlocation = mysqli_real_escape_string($link, $_POST['projectlocation']); $materialused = mysqli_real_escape_string($link, $_POST['materialused']); $theme = mysqli_real_escape_string($link, $_POST['theme']); $architecture = mysqli_real_escape_string($link, $_POST['architecture']); $interiors = mysqli_real_escape_string($link, $_POST['interiors']); $name = $firstname . ' ' . $lastname; setcookie('smname', $name, time() + (10 * 365 * 24 * 60 * 60)); setcookie('smemail', $email, time() + (10 * 365 * 24 * 60 * 60)); setcookie('smmobile', $mobile, time() + (10 * 365 * 24 * 60 * 60)); $mob = "/^[7-9][0-9]{9}$/"; $nam = "/^[a-zA-Z ]*$/"; if (empty($firmname)) { echo $errors = "Please Enter Firm Name"; echo "<script>$('#firmname').focus(); $('#firmname').addClass('focus-red is-invalid'); </script>"; } else if (empty($firstname)) { echo $errors = "Please Enter Your First Name"; echo "<script>$('#firstname').focus(); $('#firstname').addClass('focus-red is-invalid'); </script>"; } else if (!preg_match($nam, $firstname)) { echo $errors = "Please Provide Valid First Name"; echo "<script>$('#firstname').focus(); $('#firstname').addClass('focus-red is-invalid'); </script>"; } else if (empty($email)) { echo $error = 'Please Enter Your Email'; echo "<script>$('#email').focus(); $('#email').addClass('focus-red is-invalid');</script>"; } else if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { echo $error = 'Please Enter Valid Email Id'; echo "<script>$('#email').focus(); $('#email').addClass('focus-red is-invalid');</script>"; } else if (empty($description)) { echo $errors = "Please Enter Your Description"; echo "<script>$('#description').focus();$('#description').addClass('focus-red is-invalid');</script>"; } else if (empty($drawingoftheproject)) { echo $errors = "Please Enter Your Drawing of the Project"; echo "<script>$('#drawingoftheproject').focus();$('#drawingoftheproject').addClass('focus-red is-invalid');</script>"; } else if (empty($image3d)) { echo $errors = "Please Enter Your 3D Images"; echo "<script>$('#image3d').focus();$('#image3d').addClass('focus-red is-invalid');</script>"; } else if (empty($completedproject)) { echo $errors = "Please Enter Your Completed Project"; echo "<script>$('#completedproject').focus();$('#completedproject').addClass('focus-red is-invalid');</script>"; } else if (empty($photos)) { echo $errors = "Please Enter upload photos"; echo "<script>$('#photos').focus();$('#photos').addClass('focus-red is-invalid');</script>"; } else if (empty($areaproject)) { echo $errors = "Total Area of the Project"; echo "<script>$('#areaproject').focus();$('#areaproject').addClass('focus-red is-invalid');</script>"; } else if (empty($projectlocation)) { echo $errors = "Please Enter Your Project Location"; echo "<script>$('#projectlocation').focus();$('#projectlocation').addClass('focus-red is-invalid');</script>"; } else if (empty($mobile)) { echo $errors = "Please Enter Material Used"; echo "<script>$('#mobile').focus();$('#mobile').addClass('focus-red is-invalid');</script>"; } else if (empty($materialused)) { echo $errors = "Please Enter Your Mobile Number"; echo "<script>$('#materialused').focus();$('#materialused').addClass('focus-red is-invalid');</script>"; } else if (empty($theme)) { echo $errors = "Please Enter Theme"; echo "<script>$('#theme').focus();$('#theme').addClass('focus-red is-invalid');</script>"; } else if (empty($architecture)) { echo $errors = "Please Enter Architecture name"; echo "<script>$('#architecture').focus();$('#architecture').addClass('focus-red is-invalid');</script>"; } else if (empty($interiors)) { echo $errors = "Please Enter Interiors name"; echo "<script>$('#interiors').focus();$('#interiors').addClass('focus-red is-invalid');</script>"; } else { $query = mysqli_query($link, "INSERT INTO `visitor_querynew`(`firstname`, `firmname`, `email`, `mobile`, `description`, `abouttheproject`, `drawingoftheproject`, `image3d`, `completedproject`, `credentials`, `videos`, `photos`, `areaproject`, `projectlocation`, `materialused`, `theme`, `architecture`, `interiors`, `date`) VALUES ('$firstname', '$firmname', '$email', '$mobile', '$description', '$abouttheproject', '$drawingoftheproject', '$image3d', '$completedproject', '$credentials', '$videos', '$photos', '$areaproject', '$projectlocation', '$materialused', '$theme', '$architecture', '$interiors', '$date')") or die("Something went wrong in query"); $information = ' <html> <head> <title>Enquiry Details</title> </head> <table width="80%" border="0" bordercolor="red" align="center" cellpadding="2" cellspacing="2" bgcolor="#EEEEEE" > <caption>' . $name . ' has filled the Enquiry Form & Details are given below :</caption> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Name:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $datatitle . ' ' . $name . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Mobile:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $mobile . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Emaile:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $email . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Description:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $description . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Drawing of the Project:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $drawingoftheproject . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">3D Images:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $image3d . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Completed Project:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $completedproject . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">No Credentials of a firm / or a person:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $credentials . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Videos:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $videos . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Photos:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $photos . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Area Project:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $areaproject . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Project Location:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $projectlocation . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Material Used:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $materialused . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Theme:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $theme . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Architecture:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $architecture . '</td> </tr> <tr valign="top" class="text"> <td valign="middle" style="font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; color:#000000; padding:10px; border:1px solid #999999;">Interiors:</td> <td style="width:50%; padding:10px; border:1px solid #999999;">' . $interiors . '</td> </tr> </table> </body> </html>'; $to = implode(", ", [ "etestlead@gmail.com", "smartexevents@gmail.com", "$email", ]); $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: ' . $email . ' <noreply@ecorp.co.in> ' . "\n"; $subject = "Smartex Visitor Registration"; if ((mail($to, $subject, $information, $headers)) || ($query)) { $gifmsg = '<div style="color: #000; max-width:720px"> <h4 style="color: #000;">Dear, ' . $name . '</h4> <p>Thank you for your Project Submission. We have received your response.</p> <p><strong>Warm regards,</strong></p> <p><strong>Team BMR & Smartex</strong></p> </div>'; $to = implode(", ", [ "$email", "smartexevents@gmail.com", ]); $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "Bcc: yash@buildingmaterialreporter.com,\r\n"; $headers .= 'From: admin@smartex.org.in <noreply@smartex.org.in> ' . "\n"; $subject = "SmartEx Confirmation"; mail($to, $subject, $gifmsg, $headers); echo "<script>window.location.href = 'thank-you.php'</script>"; } else { echo '<script> alert("Sorry Oops Problem is occured");</script>'; } } }
Save
Cancel