isSMTP(); $mail->Host = ‚smtp.websupport.cz‘; $mail->SMTPAuth = true; $mail->Username = ‚loans@promo.usetreme.eu‘; $mail->Password = ‚Horc1k+258‘; $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; $mail->Port = 465; $mail->CharSet = ‚UTF-8‘; $mail->setFrom(‚loans@promo.usetreme.eu‘, $senderName); $mail->addAddress($to); $mail->addReplyTo(‚info@usetreme.eu‘, ‚Podpora Usetreme.eu‘); $mail->isHTML(true); $mail->Subject = $subject; $mail->Body = $htmlContent; $mail->AltBody = $plainText; $mail->send(); return true; } catch (Exception $e) { return false; } } // — BACKEND LOGIKA — if (isset($_GET[‚action‘])) { header(‚Content-Type: application/json‘); // Ošetření vstupů $amount = isset($_POST[‚amount‘]) ? intval(str_replace(‚ ‚, “, $_POST[‚amount‘])) : 0; $nameRaw = isset($_POST[‚name‘]) ? trim(strip_tags($_POST[‚name‘])) : “; $email = isset($_POST[‚email‘]) ? trim(strtolower($_POST[‚email‘])) : “; // Jméno pro oslovení $nameParts = explode(‚ ‚, $nameRaw); $firstName = (count($nameParts) > 0) ? $nameParts[0] : $nameRaw; $lastName = (count($nameParts) > 1) ? end($nameParts) : “; // BLACKLIST $blacklist = [‚@uoou.gov.cz‘, ‚@konecta-group.com‘, ‚@homecredit.cz‘, ‚@csas.cz‘, ‚@csob.cz‘, ‚@srovnejto.cz‘, ‚@ehub.cz‘, ‚@leadgenia.com‘, ‚@usetreno.cz‘, ‚kkiercek@gmail.com‘, ‚edwardslusi21@gmail.com‘]; $isBlacklisted = false; foreach ($blacklist as $bad) { if (strpos($email, $bad) !== false) { $isBlacklisted = true; break; } } // — AKCE: PRVNÍ KROK (Admin + První potvrzující email) — if ($_GET[‚action‘] == ‚process‘) { if ($amount < 500 || empty($nameRaw) || empty($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)) { echo json_encode(['status' => ‚error‘, ‚message‘ => ‚Vaše emailová adresa je blokována.‘]); exit; } // Logika přesměrování $redirectLink = ‚https://leadgenia3.com/link/VRifqRHeS2?affS1=vlastni-kaskada‘; if ($amount > 10000 && $amount <= 15000) $redirectLink = 'https://leadgenia3.com/link/VRifqRHeS2?affS1=vlastn%C3%AD+kaskada'; elseif ($amount > 15000 && $amount <= 20000) $redirectLink = 'https://leadgenia3.com/leadgenia/9755f816-1949-45ce-8219-7872fe0b439e/usetreme?affS1=vlastni-kaskada'; elseif ($amount > 20000 && $amount <= 100000) $redirectLink = 'https://leadgenia3.com/link/jw29QS0Hfu?affS1=vlastni-kaskada'; elseif ($amount > 100000 && $amount <= 200000) $redirectLink = 'https://leadgenia3.com/leadgenia/70cfb09c-de02-49f4-8c04-bd4f371c10e9/usetreme?affS1=vlastni-kaskada'; elseif ($amount > 200000) $redirectLink = ‚https://leadgenia3.com/leadgenia/a552cd05-f834-4516-abec-72a179f00d9d/usetreme‘; // Admin notifikace $admin_subject = $isBlacklisted ? „⚠️ [BLACKLIST] LEAD: $nameRaw“ : „⚡ LEAD: $nameRaw“; $admin_body = „
Nová žádost
Jméno: $nameRaw
Email: $email
Částka: $amount Kč
Status: “ . ($isBlacklisted ? „BLOKOVÁNO“ : „V pořádku“) . „
„; sendSecureMail(„lead@usetreme.eu“, $admin_subject, $admin_body, „Lead: $nameRaw“); if (!$isBlacklisted) { // Newsletter registrace $tnp_url = „https://www.usetreme.eu/?na=s“; $postData = [‚ne‘ => $email, ‚nn‘ => $firstName, ‚ns‘ => $lastName, ‚nl[]‘ => ‚1‘, ‚optin‘ => ‚single‘]; $ch = curl_init($tnp_url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_exec($ch); curl_close($ch); // EMAIL 1 – Odeslat ihned $fomoDate = date(‚d. m. Y‘, strtotime(‚+48 hours‘)); $fomoTime = date(‚H:i‘, strtotime(‚+48 hours‘)); $formattedAmount = number_format($amount, 0, ‚,‘, ‚ ‚); $email_style = „max-width:600px;margin:0 auto;font-family:Arial,sans-serif;color:#333;line-height:1.6;border:1px solid #eee;border-radius:8px;overflow:hidden;“; $header_bar = „
„; $footer_bar = „
Tento e-mail byl odeslán na základě Vaší poptávky na Usetreme.eu.
„; $btn_style = „display:inline-block;background:#ff7a00;color:#fff;padding:15px 30px;text-decoration:none;border-radius:6px;font-weight:bold;margin-top:20px;“; $h1 = „Dobrý den, $firstName, Vaše předschálená hotovost je připravena.“; $p1 = „Na základě Vaší žádosti jsme pro Vás předběžně schválili limit
$formattedAmount Kč.
⚠️
Pozor: Tato rezervace je platná pouze do
$fomoDate $fomoTime.“; $html1 = „
„; sendSecureMail($email, „DŮLEŽITÉ: Rezervace limitu $formattedAmount Kč vyprší za 48 hodin“, $html1, $h1); echo json_encode([‚status‘ => ‚success‘, ‚redirectUrl‘ => $redirectLink]); } else { echo json_encode([‚status‘ => ‚blocked‘, ‚redirectUrl‘ => ‚https://www.usetreme.eu/nabidka-pujcek-pro-dnesni-den‘]); } exit; } // — AKCE: DRUHÝ EMAIL (Během odpočtu) — if ($_GET[‚action‘] == ‚send_second‘ && !$isBlacklisted) { $email_style = „max-width:600px;margin:0 auto;font-family:Arial,sans-serif;color:#333;line-height:1.6;border:1px solid #eee;border-radius:8px;overflow:hidden;“; $footer_bar = „
Tento e-mail byl odeslán na základě Vaší poptávky na Usetreme.eu.
„; $btn_style = „display:inline-block;background:#ff7a00;color:#fff;padding:15px 30px;text-decoration:none;border-radius:6px;font-weight:bold;margin-top:20px;“; $h2 = „Mimořádná nabídka: První půjčka ZDARMA až 20.000 Kč“; $html2 = „