| Server IP : 192.169.170.185 / Your IP : 216.73.216.97 Web Server : Apache System : Linux p3plmcpnl495852.prod.phx3.secureserver.net 4.18.0-553.52.1.lve.el8.x86_64 #1 SMP Wed May 21 15:31:29 UTC 2025 x86_64 User : akhilnew ( 1712764) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/akhilnew/public_html/ |
Upload File : |
<?php
require_once('inc/config.php');
require_once('required/Sendgrid.php');
$pagename = filter_input(INPUT_GET, 'pagename', FILTER_SANITIZE_STRING);
$pagename = trim($mysqli->real_escape_string($pagename));
if (!$pagename) {
die('Page not found. [404]');
}
$stmt = $mysqli->prepare("SELECT websitename, fromname, fromemail, replyname, replyemail FROM settings LIMIT 1") or die('Something went worng.');
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($websitename, $fromname, $fromemail, $replyname, $replyemail);
$stmt->fetch();
$stmt->close();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!isset($_POST['zipcode']) or $_POST['zipcode'] !== '' or strlen($_POST['zipcode']) > 0) {
die(json_encode(array('t' => 'You are not authorized user.', 's' => false)));
}
if (preg_match('/[\p{Cyrillic}]/u', $_POST['message'])) {
die(json_encode(array('t' => 'You are not authorized user.', 's' => false)));
}
$name = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING);
$name = trim($mysqli->real_escape_string($name));
$email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL);
$email = trim($mysqli->real_escape_string($email));
$country = filter_input(INPUT_POST, 'country', FILTER_SANITIZE_STRING);
$country = trim($mysqli->real_escape_string($country));
$phonecode = filter_input(INPUT_POST, 'phonecode', FILTER_SANITIZE_STRING);
$phonecode = trim($mysqli->real_escape_string($phonecode));
$phone = filter_input(INPUT_POST, 'phone', FILTER_SANITIZE_STRING);
$phone = trim($mysqli->real_escape_string($phone));
$message = filter_input(INPUT_POST, 'message', FILTER_SANITIZE_STRING);
$message = trim($mysqli->real_escape_string($message));
$message = str_replace('\r\n', PHP_EOL, $message);
$recaptcha_response = filter_input(INPUT_POST, 'recaptcha_response', FILTER_SANITIZE_STRING);
$recaptcha = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=6LdSR1gpAAAAAL4iIvRdlkBTj9Ti7NyjVkm4-Ta3&response=' . $recaptcha_response);
$recaptcha = json_decode($recaptcha);
if (empty($name)) {
die(json_encode(array('t' => 'Please enter your name.', 's' => false)));
} elseif (empty($email)) {
die(json_encode(array('t' => 'Please enter your email address.', 's' => false)));
} elseif (filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
die(json_encode(array('t' => 'Please enter a valid email address.', 's' => false)));
} elseif(empty($country) or empty($phonecode)) {
die(json_encode(array('t' => 'Please select your country.', 's' => false)));
} elseif((empty($phone) && strlen($phone) == 0)) {
die(json_encode(array('t' => 'Please enter your phone number.', 's' => false)));
} elseif($phonecode == '+91' && strlen($phone) !== 10) {
die(json_encode(array('t' => 'Please enter 10 digits phone number.', 's' => false)));
} elseif (empty($message)) {
die(json_encode(array('t' => 'Please enter your message.', 's' => false)));
} else {
if ($recaptcha->success == true && $recaptcha->score >= 0.5 && $recaptcha->action == 'contact') {
if (file_exists('../temp/BlockedWords.php')) {
require_once('../temp/BlockedWords.php');
if ($blocked = BlockedWords::check($email, $message)) {
die(json_encode(array('t' => $blocked, 's' => false)));
}
} else {
die(json_encode(array('t' => 'Something went worng.', 's' => false)));
}
require_once('../temp/Subscriptionenquiry.php');
$id = Subscriptionenquiry::submit($pagename, $name, $email, $country, $phonecode . '-' . $phone, $message);
$phoneWithCode = $phonecode . '-' . $phone;
$message = nl2br($message);
$wsubject = "Subscription Enquiry Received. UID: #{$id}";
$wmessage = <<<EOJ
<table brder="0" cellpadding="0" cellspacing="0" style=float:left;width:500px;background:#fff><tr><td align="left" style="background:#1b2e72;border-bottom:3px solid #f6cc00;padding:12px 15px;color:#98afdb;font-size:17px;text-transform:uppercase" valign="middle">{$name}<td align="right" style="background:#1b2e72;border-bottom:3px solid #f6cc00;padding:12px 15px;color:#98afdb;font-size:17px;text-transform:uppercase" valign="middle">ID: {$id}<tr><td align="left" style="background:#fff;border:1px solid #ddd;border-top:none;padding:12px 15px;color:#000;font-size:12px" valign="middle" colspan="2"><p style="float:left;width:100%;margin:0 0 5px">Hi {$websitename}<p style="float:left;width:100%;margin:0 0 10px">You have received a subscription enquiry from {$name}.<p style="float:left;width:100%;margin:0 0 10px"><b>DETAILS:</b><p style="float:left;width:100%;margin:0 0 10px"><b>PAGE:</b> {$pagename}<p style="float:left;width:100%;margin:0 0 10px"><b>NAME:</b> {$name}<p style="float:left;width:100%;margin:0 0 10px"><b>E-MAIL:</b> {$email}<p style="float:left;width:100%;margin:0 0 10px"><b>PHONE:</b> <a href="tel:{$phoneWithCode}">{$phoneWithCode}</a><p style="float:left;width:100%;margin:0 0 10px"><b>MESSAGE:</b> {$message}</table>
EOJ;
$csubject = "Subscription Enquiry Received. UID: #{$id}";
$cmessage = <<<EOJ
<table brder="0" cellpadding="0" cellspacing="0" style="float:left;width:500px;background:#fff"><tr><td align="left" valign="middle" style="background:#1b2e72;border-bottom:3px solid #f6cc00;padding:12px 15px;color:#98afdb;font-size:17px;text-transform:uppercase">{$name}</td><td align="right" valign="middle" style="background:#1b2e72;border-bottom:3px solid #f6cc00;padding:12px 15px;color:#98afdb;font-size:17px;text-transform:uppercase">ID: {$id}</td></tr><tr><td align="left" valign="middle" colspan="2" style="background:#fff;border:1px solid #ddd;border-top:none;padding:12px 15px;color:#000;font-size:12px"><p style="float:left;width:100%;margin:0 0 5px">Hello {$name}</p><p style="float:left;width:100%;margin:0 0 10px">Thank you for contacting the {$websitename}.</p><p style="float:left;width:100%;margin:0 0 25px">We have received your subscription enquiry and shall reply you within 24 hours. If you don't get any reply please email us at <b>akiniksubs@gmail.com</b>.</p><br><br><p style="float:left;width:100%;margin:0 0 3px">You can download our latest journal subscription form from the following link.</p><br><p style="float:left;width:100%;margin:0 0 3px"><a href="https://www.akinik.com/SubscriptionForm.pdf" target="_blank">https://www.akinik.com/SubscriptionForm.pdf</a></p><br clear="both"><br clear="both"><br clear="both"><p style="float:left;width:100%;margin:0 0 3px">Kind Regards,</p><p style="float:left;width:100%;margin:0 0 3px">Akhil Gupta</p><p style="float:left;width:100%;margin:0 0 3px">Manager</p><p style="float:left;width:100%;margin:0 0 3px">{$websitename}</p><p style="float:left;width:100%;margin:0 0 3px">Phone: +91-8178042476</p><p style="float:left;width:100%;margin:0 0 30px">Web: {$baseurl}</p><p style="float:left;width:100%;margin:0"><img src="{$imageurl}tree.png" alt="Tree" style="float:left"><b style="float:left;margin:13px 0 0 10px;color:#093">Please consider the environment before you print this email.</b></p></td></tr></table>
EOJ;
$sendgrid1 = new Sendgrid();
$sendgrid1->from = $fromname;
$sendgrid1->fromEmail = $fromemail;
$sendgrid1->reply = $name;
$sendgrid1->replyEmail = $email;
$sendgrid1->send('akiniksubs@gmail.com', $wsubject, $wmessage);
$sendgrid2 = new Sendgrid();
$sendgrid2->from = $fromname;
$sendgrid2->fromEmail = $fromemail;
$sendgrid2->reply = $replyname;
$sendgrid2->replyEmail = $replyemail;
$sendgrid2->send($email, $csubject, $cmessage);
require_once('../temp/Whatsapp.php');
Whatsapp::send($phonecode . $phone, 'HX5613ae7f0e35afcd6048a63043c91e3f', 'MGe969ff43ea654548ccaf8273c835aaf1');
die(json_encode(array('t' => 'Your enquiry has been submitted!', 's' => true)));
} else {
die(json_encode(array('t' => 'Robot verification failed.', 's' => false)));
}
}
}
$stmt = $mysqli->prepare("SELECT * FROM pages WHERE name = ? LIMIT 1") or die('Something went worng.');
$stmt->bind_param('s', $pagename);
$stmt->execute();
$stmt->store_result();
$count_page = $stmt->num_rows();
$stmt->close();
if ($count_page !== 1) {
die('Page not found. [404]');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Subscription Enquiry</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
font-family: 'Poppins', sans-serif;
font-size: 14px;
background: #888;
font-weight: 400;
}
* {
box-sizing: border-box;
}
b {
font-weight: 500;
}
.card {
border-radius: 12px;
}
.card-head {
background: #0259b9;
height: 150px;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
position: relative;
}
.card-body form label {
text-transform: uppercase;
font-weight: 500;
font-size: 12px;
}
.card-body form .form-control,.card-body form .form-select {
font-size: 14px;
}
.card-body form button,
.loading {
background: #0259b9;
border: none;
font-weight: 400;
font-size: 14px;
padding: 8px 16px;
}
.loading {
opacity: 0.75;
cursor: default;
}
.toast-body {
font-size: 16px;
}
.grecaptcha-badge {
visibility: hidden !important;
}
</style>
</head>
<body class="overflow-y-scroll">
<?php
$countries = '';
$stmt = $mysqli->prepare("SELECT nicename, phonecode FROM country WHERE phonecode != '0' ORDER BY nicename");
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($nicename, $phonecode);
while($stmt->fetch()):
$countries .= '<option value="' . $nicename . '" data-phonecode="+' . $phonecode . '" ' . ($phonecode == '91' ? 'selected' : '') . '>' . $nicename . '</option>';
endwhile;
$stmt->close();
echo <<<EOJ
<div style="background: #0259b9;">
<div class="container py-2">
<div class="row">
<div class="col-4 col-sm-6 d-flex align-items-center">
<a href="{$baseurl}" class="d-inline-block"><img src="{$imageurl}logo-default.png" alt="{$websitename}" title="{$websitename}" width="36" height="36" /></a>
<b class="text-white ms-2 d-none d-sm-inline-block" style="font-size:18px;">{$websitename}</b>
</div>
<div class="col-8 col-sm-6 d-flex justify-content-end">
<a href="{$baseurl}" title="Home" class="btn btn-light me-1" style="font-size:14px;">Home</a>
<a href="{$baseurl}contact" title="Contact Us" class="btn btn-light" style="font-size:14px;">Contact Us</a>
</div>
</div>
</div>
</div>
EOJ;
?>
<div class="container my-4">
<div class="row">
<div class="col-sm-12 col-lg-6 offset-lg-3">
<div class="card border-0 overflow-hidden" id="removable">
<div class="card-head text-center px-2">
<h5 class="text-white mb-2">Request For Subscription Enquiry</h5>
<b class="text-white mb-0">Please provide your contact details.</b>
</div>
<div class="card-body">
<form action="<?php echo $baseurl; ?>subscription-enquiry/<?php echo $pagename; ?>" method="post" name="enquiryform" id="enquiryform" onsubmit="return p(this)">
<input type="hidden" name="zipcode" value="" readonly>
<input type="hidden" name="recaptcha_response" id="recaptchaResponse">
<div class="row">
<div class="col-md-6 mb-2">
<label for="name">name</label>
<input type="text" name="name" id="name" class="form-control" />
</div>
<div class="col-md-6 mb-2">
<label for="email">email</label>
<input type="text" name="email" id="email" class="form-control" />
</div>
</div>
<div class="row">
<div class="col-12 col-md-6 mb-2">
<label for="country">Country</label>
<select name="country" class="form-select" onchange="phonecode.value = this.value ? event.target.options[event.target.selectedIndex].dataset.phonecode : '';">
<option value="" selected="selected">Select country</option>
<?php echo $countries; ?>
</select>
</div>
<div class="col-12 col-md-6 mb-2">
<label for="phone">whatsapp number</label>
<div class="input-group">
<input type="text" name="phonecode" id="phonecode" value="+91" class="input-group-text" style="width:55px;padding:0;text-align:center;background:#eee;outline:none;font-size:14px;" readonly />
<input type="text" name="phone" id="phone" class="form-control" />
</div>
</div>
</div>
<div class="row">
<div class="col mb-3">
<label for="message">message</label>
<textarea rows="5" cols="5" name="message" id="message" class="form-control" style="height: 70px;"></textarea>
</div>
</div>
<div class="row">
<div class="col text-center">
<button type="submit" name="submit" class="btn btn-primary">Submit Enquiry</button>
<div class="loading btn btn-primary" hidden>Please wait...</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div id="liveToast" class="toast align-items-center border-0 position-fixed top-50 start-50 translate-middle overflow-hidden" role="alert" aria-live="polite" aria-atomic="true" data-bs-delay="10000" data-bs-animation="false"></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" defer></script>
<script src="https://www.google.com/recaptcha/api.js?render=6LdSR1gpAAAAANGL6NHCNF33osMAjWSBZFEQeDYs"></script>
<script>
grecaptcha.ready(function () {
grecaptcha.execute('6LdSR1gpAAAAANGL6NHCNF33osMAjWSBZFEQeDYs', { action: 'contact' }).then(function (token) {
document.getElementById('recaptchaResponse').value = token;
});
});
function p($) {
$.submit.disabled = true;
$.submit.hidden = true;
document.querySelector('.loading').hidden = false;
const toastBootstrap = bootstrap.Toast.getOrCreateInstance(document.getElementById('liveToast'));
fetch(`<?php echo $baseurl; ?>subscription-enquiry/<?php echo $pagename; ?>`, {
method: 'post',
mode: 'same-origin',
cache: 'no-cache',
headers: {
'Accept': 'application/json'
},
body: new FormData($)
})
.then(r => r.json())
.then(r => {
liveToast.innerHTML = `<div style="min-width: 320px;" class="d-flex ${r.s == true ? 'bg-success' : 'bg-danger'}"><div class="toast-body text-white">${r.t}</div><button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button></div>`;
if (r.s == true) {
$.reset();removable.remove();
} else {
$.submit.disabled = false;
$.submit.hidden = false;
document.querySelector('.loading').hidden = true;
grecaptcha.execute('6LdSR1gpAAAAANGL6NHCNF33osMAjWSBZFEQeDYs', { action: 'contact' }).then(function (token) {
document.getElementById('recaptchaResponse').value = token;
});
}
})
.catch(e => {
liveToast.innerHTML = `<div class="d-flex bg-danger"><div class="toast-body text-white">${e}</div><button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button></div>`;
})
.finally(() => {
toastBootstrap.show();
});
return false;
}
</script>
</body>
</html>