| 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/journalofpoliticalscience.com/ |
Upload File : |
<?php
if (file_exists('inc/config.php')) {
require_once('inc/config.php');
} else {
die('Required file doesn\'t exist.');
}
function getVisitorData() {
$country = isset($_COOKIE['vi_country']) ? $_COOKIE['vi_country'] : null;
$currency = isset($_COOKIE['vi_currency']) ? $_COOKIE['vi_currency'] : null;
$expiration = time() + (365 * 24 * 60 * 60);
if ($country && $currency) {
return ['country' => $country, 'currency' => $currency];
} else {
$clientIp = null;
if (isset($_SERVER['HTTP_CLIENT_IP']) && filter_var($_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP)) {
$clientIp = $_SERVER['HTTP_CLIENT_IP'];
} elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && filter_var($_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP)) {
$clientIp = $_SERVER['HTTP_X_FORWARDED_FOR'];
} elseif (isset($_SERVER['REMOTE_ADDR']) && filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP)) {
$clientIp = $_SERVER['REMOTE_ADDR'];
}
if ($clientIp) {
$url = "http://ip-api.com/json/{$clientIp}";
$response = file_get_contents($url);
$data = json_decode($response, true);
if ($data && $data['status'] === 'success') {
$country = $data['country'];
$currency = $country == 'India' ? 'INR' : 'USD';
setcookie('vi_country', $country, $expiration, '/');
setcookie('vi_currency', $currency, $expiration, '/');
return ['country' => $country, 'currency' => $currency];
}
}
setcookie('vi_country', 'India', $expiration, '/');
setcookie('vi_currency', 'INR', $expiration, '/');
return ['country' => 'India', 'currency' => 'INR'];
}
}
$getVisitorData = getVisitorData();
$displayCurrency = $getVisitorData['currency'] === 'INR' ? '₹' : '$';
$refnumber = isset($_GET['refnumber']) ? str_replace(' ', '', $mysqli->real_escape_string($_GET['refnumber'])) : null;
$stmt = $mysqli->prepare("SELECT websitename, websiteemail, fromname, fromemail, replyname, replyemail FROM settings ORDER BY settingsid DESC LIMIT 1") or die('An error occurred. Please try after some time.');
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($websitename, $websiteemail, $fromname, $fromemail, $replyname, $replyemail);
$stmt->fetch();
$stmt->close();
$stmt = $mysqli->prepare("SELECT title FROM archives WHERE (refnumber = ? AND status = 'enabled') LIMIT 1") or die('An error occurred. Please try after some time.');
$stmt->bind_param('s', $refnumber);
$stmt->execute();
$stmt->store_result();
$count_rows = $stmt->num_rows();
$stmt->bind_result($article_title);
$stmt->fetch();
$stmt->close();
if ($count_rows == 0) {
die('No article found.');
}
if (file_exists('inc/buyarticle.php')) {
require_once 'inc/buyarticle.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();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Buy Article</title>
<link rel="shortcut icon" href="<?php echo $imageurl;?>favicon.ico" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" 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">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<style>
body {
font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 400;
}
* {
box-sizing: border-box;
}
b {
font-weight: 400;
}
.form-control,
.form-select {
font-size: 14px;
}
.btn-submitter:disabled {
color: transparent !important;position: relative;
}
.btn-submitter:disabled::after {
content: 'Please wait...';position: absolute;top: 0;bottom: 0;left: 0;right: 0;color: #fff;display: flex;justify-content: center;align-items: center;
}
</style>
</head>
<body>
<div class="bg-primary">
<div class="container py-1">
<div class="d-flex align-items-center justify-content-between">
<div>
<a href="<?php echo $baseurl; ?>" class="d-inline-block">
<img src="<?php echo $imageurl; ?>logo.png" alt="<?php echo $websitename; ?>" title="<?php echo $websitename; ?>" width="40" height="40" />
</a>
</div>
<div>
<a href="<?php echo $baseurl; ?>" title="Home" class="btn btn-light me-1" style="font-size:14px;">Home</a>
<a href="<?php echo $baseurl; ?>contact" title="Contact Us" class="btn btn-light" style="font-size:14px;">Contact Us</a>
</div>
</div>
</div>
</div>
<div class="container my-5">
<div class="row">
<div class="col-sm-12 col-lg-6 offset-lg-3">
<form action="<?php echo $baseurl; ?>buyarticle/<?php echo $refnumber; ?>" method="post" name="paymentform" id="paymentform" onsubmit="return makePayment(this)">
<input type="hidden" name="zipcode">
<input type="hidden" name="recaptcha_response" class="recaptcha_response">
<div class="card border-0 shadow overflow-hidden">
<div class="card-head text-center px-2 py-3 bg-primary">
<h5 class="text-white mb-2">Make Payment</h5>
<b class="text-white mb-0">Please provide your details.</b>
</div>
<div class="card-body">
<div class="row row-cols-1 row-cols-sm-2 row-gap-3">
<div class="col">
<label for="name" class="form-label">Name</label>
<input type="text" name="name" id="name" class="form-control" />
</div>
<div class="col">
<label for="email" class="form-label">Email</label>
<input type="text" name="email" id="email" class="form-control" />
</div>
<div class="col">
<label for="country" class="form-label">Country</label>
<select name="country" id="country" class="form-select" onchange="phonecode.value = this.value ? event.target.options[event.target.selectedIndex].dataset.phonecode : '';setCookie(this.value);">
<?php echo $countries; ?>
</select>
</div>
<div class="col">
<label for="phone" class="form-label">Phone</label>
<div class="input-group">
<input type="text" name="phonecode" id="phonecode" value="+91" class="input-group-text px-0" style="width:55px;background:#eee;outline:none;font-size:14px;" readonly />
<input type="text" name="phone" id="phone" class="form-control" />
</div>
</div>
</div>
<br clear="all">
<div><b>Payable Amount:</b> <?php echo $displayCurrency . ' ' . ($getVisitorData['currency'] === 'INR' ? '100' : '5'); ?></div>
</div>
<div class="card-footer">
<button type="submit" name="submit" class="btn btn-primary btn-submitter w-100">Pay Now</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div style="z-index: 9999;" 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://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.33/moment-timezone-with-data-10-year-range.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous" defer></script>
<script id="recaptcha_script" src="https://www.google.com/recaptcha/api.js?render=6Lfx1JEpAAAAAKA5CC4_ESZzo73sUKoYngCLxxT0" defer></script>
<script defer>
document.addEventListener('DOMContentLoaded', function () {
initCaptcha();
document.getElementById('phone').addEventListener('input', function(event) {
// Remove any non-numeric characters and leading zeros
let value = event.target.value.replace(/\D/g, ''); // Remove non-numeric characters
value = value.replace(/^0+/, ''); // Remove leading zeros
event.target.value = value;
});
document.getElementById('country').value = getCookie('vi_country');
const selectElement = document.getElementById('country');
const dataInfo = selectElement.options[selectElement.selectedIndex].dataset.phonecode;
document.getElementById('phonecode').value = dataInfo;
});
function makePayment($this) {
$this.submit.disabled = true;
const toastBootstrap = bootstrap.Toast.getOrCreateInstance(document.getElementById('liveToast'));
fetch($this.action, {method: 'post', mode: 'same-origin', cache: 'no-cache', headers: {'Accept': 'application/json'}, body: new FormData($this)}).then(response => response.json())
.then(response => {
if (response.s === false) {
$this.submit.disabled = false; initCaptcha();
liveToast.innerHTML = `<div style="min-width: 320px;" class="d-flex ${response.s == true ? 'bg-success' : 'bg-danger'}"><div class="toast-body text-white">${response.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 (response.u) {
window.location.href = response.u;
}
if (response.html) {
document.body.insertAdjacentHTML('beforeend', response.html);
if (response.pg && response.pg === 'icici') {
var paymentParameters = $("iciciform").serializeArray().filter(function(item) {
return item.value !== "";
}).reduce(function(obj, item) {
obj[item.name] = item.value;
return obj;
}, {});
const sharedSecret = "whq5A>yk@1HR";
var messageSignatureContent = [];
const ignoreSignatureParameteres = ["hashExtended"];
Object.keys(paymentParameters).filter(key => !ignoreSignatureParameteres.includes(key)).sort().forEach(function(key, index) {
messageSignatureContent.push(paymentParameters[key]);
});
const messageSignature = CryptoJS.HmacSHA256(messageSignatureContent.join("|"), sharedSecret);
const messageSignatureBase64 = CryptoJS.enc.Base64.stringify(messageSignature);
$("input[name='hashExtended']").val(messageSignatureBase64);
}
document.redirect.submit();
}
})
.catch(e => {
$this.submit.disabled = false;
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;
}
function initCaptcha() {
grecaptcha.ready(function () {
grecaptcha.execute(new URL(document.getElementById("recaptcha_script").src).searchParams.get('render'), { action: 'payment' }).then(function (token) {
document.querySelectorAll('.recaptcha_response').forEach((e) => {
e.value = token;
});
});
});
}
function setCookie($country) {
const expires = new Date(Date.now() + 1825 * 864e5).toUTCString();
document.cookie = 'vi_country=' + encodeURIComponent($country) + '; expires=' + expires + '; path=/';
document.cookie = 'vi_currency=' + encodeURIComponent($country == 'India' ? 'INR' : 'USD') + '; expires=' + expires + '; path=/';
}
function getCookie(name) {
let value = "; " + document.cookie;
let parts = value.split("; " + name + "=");
if (parts.length === 2) return parts.pop().split(";").shift();
return 'India';
}
</script>
</body>
</html>