<?php

if(!isset($_COOKIE['BeenBefore'])) {
    $FirstVisit = "Yes";
    
    $cookiename = "BeenBefore";
    $cookievalue = "Yes";
    setcookie($cookiename, $cookievalue ,time()+(365*86400));
} else {
    $FirstVisit = "No";	
}

$rnd = rand(1, 10000);

include $_SERVER['DOCUMENT_ROOT'] . '/SQL/dbconnect.php';

$Presenters = mysqli_query($mysqli_master, "SELECT * from `live-Presenters`");
$Rolodex = mysqli_query($mysqli_master, "SELECT * from `live-Rolodex`");
// $LiveNews = mysqli_query($mysqli_master, "SELECT * from `live-News-Top10`");

mysqli_close($mysqli_master);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Welcome to A1Radio</title>
<meta name="orb-verification" content="7fcebe12aa383987"/>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-title" content="A1Radio">
<meta name="application-name" content="A1Radio">

<meta property="og:site_name" content="A1Radio" />
<meta property="og:url" content="https://www.a1radio.co.uk/" />
<meta property="og:title" content="A1Radio - Online, Anytime" />
<meta property="og:image" content="https://www.a1radio.co.uk/img/Logo_ogg.png?v=2" />
<meta property="og:image:width" content="300" />
<meta property="og:image:height" content="300" />
<meta property="og:description" content="A1Radio is an Internet Radio station broadcasting from Peterborough in the UK.  Online, Anytime!" />
<meta property="og:type" content="website" />

<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@A1OnlineAnytime" />
<meta name="twitter:title" content="A1Radio.co.uk - Great Music, Online Anytime" />
<meta name="twitter:description" content="Welcome to A1Radio - Great music broadcasting over the internet 24/7.  Online, Anytime!" />
<meta name="twitter:image" content="https://www.a1radio.co.uk/img/Logo_ogg.png?v=2b" />
<meta name="twitter:url" content="https://www.a1radio.co.uk" />

<meta name="author" content="Gary Woodward" />
<meta name="description" content="A1Radio is an Internet Radio station broadcasting from Peterborough in the UK.  We broadcast 24/7 with live shows throughout the week, and you can interact with us on our Facebook page and online chatroom.  Online, Anytime!" />
<meta name="keywords" content="A1Radio, A1 Radio, A1, Internet Radio, Requests, Request Show, Peterborough, <?php 
while($row = $Presenters->fetch_assoc()) { echo $row['OnAirName'] . ', '; }
?>Radio Broadcasting, Online Anytime" />
<meta name="author" content="Gary Woodward" />
<meta name="robots" content="ALL" />
<meta name="revisit-after" content="7 days" />

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=<?php echo $rnd?>" media="(prefers-color-scheme: light)">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-d.png?v=<?php echo $rnd?>" media="(prefers-color-scheme: dark)">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32-d.png?v=<?php echo $rnd?>" media="(prefers-color-scheme: dark)">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16-d.png?v=<?php echo $rnd?>" media="(prefers-color-scheme: dark)">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png?v=<?php echo $rnd?>" media="(prefers-color-scheme: light)">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png?v=<?php echo $rnd?>" media="(prefers-color-scheme: light)">
<link rel="manifest" href="/site.webmanifest?v=<?php echo $rnd?>">
<link rel="mask-icon" href="/safari-pinned-tab.svgv=<?php echo $rnd?>" color="#992929">
<link rel="shortcut icon" href="/favicon.ico?v=<?php echo $rnd?>">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#992929">

<link rel="stylesheet" href="font-awesome/css/all.css?v=<?php echo $rnd?>">
<link rel="stylesheet" href="css/style.css?v=<?php echo $rnd?>">
    
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="js/standard.js?v=<?php echo $rnd?>"></script>
<script src="js/jquery.cookie.js?v=<?php echo $rnd?>"></script>
<script src="js/clock/moment.js"></script>
<script src="js/clock/moment-timezone-with-data.js"></script>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XZ3ZM0E91J"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-XZ3ZM0E91J');
</script>
<!-- PushAlert -->
<script type="text/javascript">
        (function(d, t) {
                var g = d.createElement(t),
                s = d.getElementsByTagName(t)[0];
                g.src = "https://cdn.pushalert.co/integrate_c8632531b3345197b77ebde948adeae8.js";
                s.parentNode.insertBefore(g, s);
        }(document, "script"));
</script>
<!-- End PushAlert -->
</head>
<body>
        <nav aria-label="Main Menu">
        <?php include('img/BigLogo.svg'); ?>
        <div id="fluff">
            <div id="slogan"></div>
            <div class="tod-clock">--- -- ---<br /><strong>--:----</strong></div>
        </div>  
        <div id="actuallinks" role="region" aria-label="Links">
            <a class="home" aria-current="true" href="/">HOME</a>
            <!-- <a class="news" href="/news">NEWS</a> -->
            <a class="about" href="/aboutus">ABOUT US</a>
            <a class="sched" href="/schedule">SCHEDULE</a>
            <a class="pres" href="/presenters">PRESENTERS</a>
            <a class="chat" href="/chat">CHAT</a>
            <a class="cont" href="/contact">CONTACT US</a>
            <a class="links" href="/links">LINKS</a>
        </div>
        <div id="sociallinks">
            <a class="social" href="https://www.facebook.com/OnlineAnytime" aria-label="A1Radio Facebook Page (External Link)">
                <picture>
                <source media="(prefers-color-scheme: dark)" srcset="img/social/dark_Facebook.svg">
                <img class="social" src="img/social/Facebook.svg" alt="Facebook Logo" title="Like Our Facebook Page"></picture></a>
            <a class="social" href="https://www.twitter.com/A1OnlineAnytime/" aria-label="A1Radio X Page (External Link)">
                <picture>
                    <source media="(prefers-color-scheme: dark)" srcset="img/social/dark_Twitter.svg">
                    <img class="social" src="img/social/Twitter.svg" alt="Twitter/X Logo" title="Follow Us On Twitter/X: @A1OnlineAnytime"></picture></a>
            <a class="social" href="https://bsky.app/profile/a1radio.bsky.social/" aria-label="A1Radio Bluesky Page (External Link)">
                <picture>
                    <source media="(prefers-color-scheme: dark)" srcset="img/social/dark_Bluesky.svg">
                    <img class="social" src="img/social/Bluesky.svg" alt="Bluesky Logo" title="Follow Us On Bluesky: a1radio.bsky.social"></picture></a>
        </div>
</nav>
<header>
    <div id="flipper">
        <ul class="flipper anim">
        <?php
                $a = 0;

                if ($Rolodex->num_rows == 0) {
                    echo '<li style="display: flex"><i class="fa fa-thumbs-up fa-lg fa-pull-left"></i>HELLO<br />Welcome To <strong>A1Radio</strong></li>';
                }
                else {
                    while ($row = $Rolodex->fetch_assoc()) {
                        echo '<li ' . ($a == 0 ? 'style="display: flex"' : 'style="display: none"') . '>' . $row['icon'] . '<span>'. $row['TextLine1'] . '<br />' . $row['TextLine2'] . '</span></li>' . "\n";

                        $a++;
                    }
                }
            ?>
        </ul>
    </div>
    <button class="menu">MENU</button>
    <button class="listen">LISTEN</button>
    <button class="requests">REQUEST</button>
    <button class="sms">SMS</button>
</header>
<main>
    <?php // if ($LiveNews -> num_rows > 0) {
        // echo '<div class="news" role="region" aria-label="News"><span>LATEST NEWS!</span><span><div>';
        
        // while($NewsArticle = $LiveNews->fetch_assoc())
        //    {	
        //    echo '<a href="news.php#news' . $NewsArticle['ID'] . '">' . strtoupper($NewsArticle['UserSaved']) . ': ' . $NewsArticle['Header'] . '</a>';
        //    }
        // echo '</div></span></div>';
        // }
    ?>
    <h1>WELCOME</h1>
        <?php include('body_index.htm') ?>
</main>
<nav id="mobilemenu" aria-label="Mobile Menu">
    <i class="close fa-solid fa-square-xmark"></i>
    <section class="links off" aria-label="Mobile Links">
        <div class="heading" role="region" aria-label="Mobile Links">MENU</div>
        <div class="content">
            <a class="home" aria-current="true" href="/">HOME</a>
            <!-- <a class="news" href="/news">NEWS</a> -->
            <a class="about" href="/aboutus">ABOUT US</a>
            <a class="sched" href="/schedule">SCHEDULE</a>
            <a class="pres" href="/presenters">PRESENTERS</a>
            <a class="chat" href="/chat">CHAT</a>
            <a class="cont" href="/contact">CONTACT US</a>
            <a class="links" href="/links">LINKS</a>
            <span style="--ao: 9">
            <a class="social" href="https://www.facebook.com/OnlineAnytime" aria-label="A1Radio Facebook Page (External Link)">
                    <picture>
                    <source media="(prefers-color-scheme: dark)" srcset="img/social/dark_Facebook.svg">
                    <img class="social" src="img/social/Facebook.svg" alt="Facebook Logo" title="Like Our Facebook Page"></picture></a>
                <a class="social" href="https://www.twitter.com/A1OnlineAnytime/" aria-label="A1Radio X Page (External Link)">
                    <picture>
                        <source media="(prefers-color-scheme: dark)" srcset="img/social/dark_Twitter.svg">
                        <img class="social" src="img/social/Twitter.svg" alt="Twitter/X Logo" title="Follow Us On Twitter/X: @A1OnlineAnytime"></picture></a>
                <a class="social" href="https://bsky.app/profile/a1radio.bsky.social/" aria-label="A1Radio Bluesky Page (External Link)">
                    <picture>
                        <source media="(prefers-color-scheme: dark)" srcset="img/social/dark_Bluesky.svg">
                        <img class="social" src="img/social/Bluesky.svg" alt="Bluesky Logo" title="Follow Us On Bluesky: a1radio.bsky.social"></picture></a>
                </span>
        </div>
    </section>
    <section class="streams off" aria-label="Mobile Stream Links">
        <div class="heading">STREAMS</div>
        <div class="content">
            <a class="mob" target="_blank" onclick="window.open('ListenLive.php?Res=Sp','pagename','resizable,height=245,width=574'); return false;"><strong>SUPER HD</strong>320kbps AAC+</a>
            <a class="mob" target="_blank" onclick="window.open('ListenLive.php?Res=Hi','pagename','resizable,height=245,width=574'); return false;"><strong>HIGH</strong>192kbps AAC+</a>
            <a class="mob" target="_blank" onclick="window.open('ListenLive.php?Res=Lo','pagename','resizable,height=245,width=574'); return false;"><strong>LOW</strong>96kbps AAC+</a>
            <span class="lic"><img src="img/licence/PRS.svg" title="PRS Logo" alt="PRS Licenced" /><img src="img/licence/PPL.svg" title="PPL Logo" alt="PPL Licenced" /></span>
        </div>
    </section>
</nav>
<footer>
    <div id="listens">
        <img src="img/licence/PRS.svg" title="PRS Logo" alt="PRS Licenced" /><img src="img/licence/PPL.svg" title="PPL Logo" alt="PPL Licenced" /><span class="tunein">TUNE IN</span>
        <button onclick="window.open('ListenLive.php?Res=Sp','pagename','resizable,height=245,width=574'); return false;" aria-label="SUPER 320kbps"><strong>SHD</strong>320kbps</button>
        <button onclick="window.open('ListenLive.php?Res=Hi','pagename','resizable,height=245,width=574'); return false;" aria-label="HIGH 192kbps"><strong>HIGH</strong>192kbps</button>
        <button onclick="window.open('ListenLive.php?Res=Lo','pagename','resizable,height=245,width=574'); return false;" aria-label="LOW 96kbps"><strong>LOW</strong>96kbps</button>
    </div>
    <div id="requests" data-display="0">
        <button id="launchreq" class="X" aria-label="REQUEST A SONG">
            REQUEST<br />A<br />SONG
        </button>
        <button id="launchlist" class="X" aria-label="VIEW REQUEST LIST">
            VIEW<br />REQUEST<br />LIST
        </button>
    </div>
    <div id="nowandnext" data-display="first">
        <span id="shownow"><ul></ul></span>
        <span id="shownext"><ul></ul></span>
    </div>
    <div id="presenternow">
    </div>
    <span id="visit">▲ Visit Profile</span>
</footer>
<dialog class="req">
    <div class="select">
        <div class="tab-group">
            <input id="tab1" name="tab" value="Request" type="radio" onclick="ChangeDialog('Ask')" />
            <label for="tab1">
                Make A Request
            </label>
        </div>
        <div class="tab-group">
            <input id="tab2" name="tab" value="List" type="radio" onclick="ChangeDialog('Show')" />
            <label for="tab2">
                View Requests
            </label>
        </div>
    </div>
    <div class="ph"></div>
</dialog>
</body>
</html>