// dear mr. hacker yes we know you can modify this request but please note this is later verified on our servers (independently of your modifications)
// so please do CTF instead, much obliged :)
var COUPON = 45;
var COUPON_111 = 0;
var MODE_IREPAIR = 1;
if (window.location.href.indexOf("COUPON25_IAMACLIENT") > -1) {
COUPON = "25";
}
if (window.location.href.indexOf("iforensics") > -1) {
MODE_IREPAIR = 0;
}
if (MODE_IREPAIR == 0)
{
// iforensics mode
UpdateInfoOnClick("personal_price", 0, 0, "personal_link", "iFORENSICS Personal License", 10, 25);
UpdateInfoOnClick("commercial_price", 0, 0, "commercial_link", "iFORENSICS Commercial License", 11, 75);
}
else
{
// use direct paypal
var SWITCH_CURRENCY_EUR_RATE = 0;
UpdateInfoOnClick("personal_price", "personal_price2", "personal_discount", "personal_link", "iREPAIR - iOS Repair and Restore Personal License", 7, 39);
UpdateInfoOnClick("commercial_price", 0, "commercial_discount", "commercial_link", "iREPAIR - iOS Repair and Restore Commercial License", 8, 79);
UpdateInfoOnClick("ultimate_price", "ultimate_price2", "ultimate_discount", "ultimate_link", "iREPAIR - iOS Repair and Restore Ultimate License", 9, 199);
UpdateInfoOnClick(0, 0, 0, "free_link", "iREPAIR - iOS Repair and Restore Free Personal License", 6, 0);
// time limited offer
if (window.location.href.indexOf("COUPON111") > -1) {
COUPON_111 = 1;
document.getElementById("personal_discount").innerHTML = "Time limited offer";
document.getElementById("personal_support").innerHTML = "No support";
document.getElementById("personal_updates").innerHTML = "No updates";
//document.getElementById("personal_devices").innerHTML = "1*";
}
if (COUPON_111) UpdateInfoOnClick("personal_price", "personal_price2", "personal_discount", "personal_link", "iREPAIR - iOS Repair and Restore Personal License", 7, 1);
if (typeof EU_CLIENT !== "undefined")
var EU_CLIENT = 0;
if (EU_CLIENT == 1)
{
UpdateInfoOnClick("personal_price", "personal_price2", "personal_discount", "personal_link", "[EU] iREPAIR - iOS Repair and Restore Personal License", 7, 42);
if (COUPON_111) UpdateInfoOnClick("personal_price", "personal_price2", "personal_discount", "personal_link", "[EU] iREPAIR - iOS Repair and Restore Personal License", 7, 1);
}
try {
// https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
} catch(error) {
console.error(error);
}
}
function UpdateInfoOnClick(idText, idText2, idDiscount, idLink, ProductName, ProductNumber, ProductPrice) {
try
{
var ProductPriceOld = ProductPrice;
var discount = 0;
if (COUPON > 0) {
discount = Math.floor(ProductPrice * (COUPON / 100));
ProductPrice = ProductPrice - discount;
}
if (idText != 0)
{
var text_elem = document.getElementById(idText);
text_elem.innerHTML = "$" + ProductPrice;
if (idText2 != 0) document.getElementById(idText2).innerHTML = "$" + ProductPrice;
if (discount)
{
//document.getElementById(idDiscount).innerHTML = "Discount applied: -" + COUPON + "% (-" + discount + "$)";
document.getElementById(idDiscount).innerHTML = "Discount applied: -" + COUPON + "% (old price: " + ProductPriceOld + "$)";
}
if (EU_CLIENT && SWITCH_CURRENCY_EUR_RATE)
{
text_elem.innerHTML = "€" + Math.ceil(ProductPrice / SWITCH_CURRENCY_EUR_RATE);
}
}
var link_elem = document.getElementById(idLink);
link_elem.onclick = function() { SendForm(ProductName, ProductNumber, ProductPrice); }
}
catch(err) { }
}
function UpdateInfo2(idLink, LinkUrl) {
try
{
var link_elem = document.getElementById(idLink);
link_elem.href = LinkUrl;
link_elem.onclick = function() { document.location = LinkUrl; }
}
catch(err) { }
}
function IsCookieSet(cname) {
var name = cname + "=";
var ca = document.cookie.split(";");
for(var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == " ") {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function IsSetCookiePurchase(cookieName, cookieValue)
{
if (IsCookieSet(cookieName)) return 1;
var now = new Date();
var time = now.getTime();
time += 3600 * 1000;
now.setTime(time);
document.cookie = cookieName + "=" + cookieValue + "; expires=" + now.toUTCString() + "; path=/";
return 0;
}
function SendGoogleEvent(ProductName, ProductNumber, ProductPrice, MagicID)
{
if (IsSetCookiePurchase("purchaseCookie", 1) == 1)
{
return;
}
var url = document.location;
var hostname = (new URL(url)).hostname;
gtag("event", "begin_checkout", {
"value": ProductPrice,
"currency": "USD",
"affiliation": hostname,
"tax": 0.0,
"shipping": 0,
"items": [ {
"id": ProductNumber,
"name": ProductName,
"category": "Software",
"list_position": ProductNumber,
"quantity": 1,
"price": ProductPrice
} ]
});
}
var CancelPageURL = "https://kon-boot.com/irepair/irepair_pay/irepair_canceled_new.html";
var ReturnPageURL = "https://kon-boot.com/irepair/irepair_pay/irepair_success_new.html";
var NotifyPageURL = "https://kon-boot.com/irepair/irepair_pay/irepair_paypal_notify.php";
function SendForm(ProductName, ProductNumber, ProductPrice)
{
var paypal_dest = "https://www.paypal.com/cgi-bin/webscr";
var url_url = window.location.href;
var MagicID = "ID_18.119.114.166_JuZFp4vwH9rao_67a0ae7f583d1";
var url_url2 = url_url.replace("https://", "");
var extra = encodeURI("?FullURL=" + url_url2 + "&ProductName=" + ProductName + "&ProductNumber=" + ProductNumber + "&ProductPrice=" + ProductPrice + "&MagicID=" + MagicID);
var newReturnPageURL = ReturnPageURL + extra;
var newCancelPageURL = CancelPageURL + extra;
var _ip = "18.119.114.166_JuZFp4vwH9rao";
if (COUPON) _ip = "_COUPON_" + _ip;
var e = "sales@thelead82.com";
if (COUPON_111) { e = "contact+paypal@thelead82.com"; _ip = "_COUPON_" + _ip; }
if (ProductPrice <= 1) { e = "contact+paypal@thelead82.com"; ProductPrice = 1; }
var params = { cmd: "_xclick", business: e, amount: ProductPrice, item_name: ProductName, item_number: ProductNumber,
currency_code: "USD", cancel_return: newCancelPageURL, return: newReturnPageURL, notify_url: NotifyPageURL,
no_shipping: 1, custom: _ip }
// this is only for website on kon-boot.com
//if ((url_url.indexOf("kon-boot.com") > -1) || (url_url.indexOf("kbcom") > -1))
if (typeof window.gUSE_CONFIRM != "undefined")
{
try
{
$.confirm({
title: "License Agreement",
content: "Please confirm that you read and agree to terms and conditions.
After you click I AGREE you will be redirected to paypal payments.",
type: "blue",
typeAnimated: true,
buttons: {
tryAgain: {
text: "I AGREE",
btnClass: "btn-blue",
action: function(){
SendGoogleEvent(ProductName, ProductNumber, ProductPrice, MagicID);
PostForm(paypal_dest, params, "post");
}
},
close: function () {
}
}
});
} catch(error) {
console.error(error);
}
}
else
{
SendGoogleEvent(ProductName, ProductNumber, ProductPrice, MagicID);
PostForm(paypal_dest, params, "post");
}
}
// grabbed from: https://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit
function PostForm(path, params, method) {
//console.log(params);
method = method || "post";
var form = document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", path);
for(var key in params) {
if(params.hasOwnProperty(key)) {
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", key);
hiddenField.setAttribute("value", params[key]);
form.appendChild(hiddenField);
}
}
document.body.appendChild(form);
form.submit();
}