<?php
include "classes/class.loader.php";
?>
<style>
    body {
        background-color: black;
    }
</style>
<div id="overlay"
    style="display:block;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.5);z-index:9999;">
    <div style="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;">
        <!-- <img src="images/loader.gif" alt="loading..." style="width:50px;height:50px;" /> -->
        <p style="color:white;font-size:1.5em;">Loading...</p>
    </div>
</div>
<?php
if (isset($_POST['credits'])) {
    $email = new email();
    $email->add_address($_SESSION['email'], $_SESSION['username']);
    $email->add_address("walruslector@gamil.com", "Jana");
    $email->add_address("unleashed.offleashed@gamil.com", "Rika");
    $email->subject("Unleashed - Credits Added");
    $email->body("
        <html>
            <head>
                <style>
                    body { font-family: Arial, sans-serif; }
                    h1 { color: #333; }
                    p { color: #555; }
                </style>
            </head>
            <body>
                <h1>Dear Customer,</h1>
                <p>Your credits have been added to your account successfully. You can now enjoy our services to the fullest.</p>
                <p>If you have any questions, feel free to contact our support team.</p>
                <p>Best regards,</p>
                <p>The Unleashed Team</p>
            </body>
        </html>
    ");
    // $email->send();
    // header("location: home.php");
    echo "<script>window.location.href='home.php';</script>";
}
if (isset($_POST['booking_id'])) {
    $email = new email();
    $email->add_address($_SESSION['email'], $_SESSION['username']);
    $email->add_address("walruslector@gamil.com", "Jana");
    $email->add_address("unleashed.offleashed@gamil.com", "Rika");
    $email->subject("Unleashed - Booking Confirmation");
    $email->body(" <html>
            <head>
                <style>
                    body { font-family: Arial, sans-serif; }
                    h1 { color: #333; }
                    p { color: #555; }
                </style>
            </head>
            <body>
                <h1>Dear Customer,</h1>
                <p>Your booking has been created, Please wait for the confirmation email..</p>
                <p>If you have any questions, feel free to contact our support team.</p>
                <p>Best regards,</p>
                <p>The Unleashed Team</p>
            </body>
        </html>");
    // $email->send();
    // header("location: home.php");
    echo "<script>window.location.href='home.php';</script>";

}

if (isset($_GET['credits'])) {
    $email = new email();
    $email->add_address($_SESSION['email'], $_SESSION['username']);
    $email->add_address("walruslector@gamil.com", "Jana");
    $email->add_address("unleashed.offleashed@gamil.com", "Rika");
    $email->subject("Unleashed - Credits Added");
    $email->body(" <html>
            <head>
                <style>
                    body { font-family: Arial, sans-serif; }
                    h1 { color: #333; }
                    p { color: #555; }
                </style>
            </head>
            <body>
                <h1>Dear Customer,</h1>
                <p>Your credits have been added to your account successfully. You can now enjoy our services to the fullest.</p>
                <p>If you have any questions, feel free to contact our support team.</p>
                <p>Best regards,</p>
                <p>The Unleashed Team</p>
            </body>
        </html>");
    // $email->send();
    // header("location: home.php");
    echo "<script>window.location.href='home.php';</script>";
}
if (isset($_GET['booking_id'])) {
    $email = new email();
    $email->add_address($_SESSION['email'], $_SESSION['username']);
    $email->add_address("walruslector@gamil.com", "Jana");
    $email->add_address("unleashed.offleashed@gamil.com", "Rika");
    $email->subject("Unleashed - Booking Confirmation");
    $email->body("<html>
            <head>
                <style>
                    body { font-family: Arial, sans-serif; }
                    h1 { color: #333; }
                    p { color: #555; }
                </style>
            </head>
            <body>
                <h1>Dear Customer,</h1>
                <p>Your booking has been created, Please wait for the confirmation email..</p>
                <p>If you have any questions, feel free to contact our support team.</p>
                <p>Best regards,</p>
                <p>The Unleashed Team</p>
            </body>
        </html>");
    // $email->send();
    // header("location: home.php");
    echo "<script>window.location.href='home.php';</script>";

}