<?php
########################################################
#	CREATED FOR WEATHER34 Aurora TEMPLATE MKII 		              						                
# 			WEATHER34  side menu	CSS/JS							                        
# 	                                                                                               
# 	Release: December 2023 Version Aurora MKII 				  	                                           
########################################################

?>


<a href="console-setup.php" target="_blank" data-title="Dashboard Setup">&nbsp;<?php echo $weather34settingsicon ?>
        <div class="link">Dashboard Admin<?php if ($password == '') {
                                                echo $weather34unlocked;
                                            } else echo $weather34locked; ?></div>
    </a><br>

    <?php //air quality CHART OPTION if yes
    //davis airlink & purple air
    if ($davisairquality == "yes" && $purpleairhardware == "yes") {
        echo '<a  href="air-quality-charts.php"  data-title="Air Quality">';
        echo 'AQI';
        echo '<div class="link">Air Quality Data</div></a><br>';
    }
    //davis airlink only
    else if ($davisairquality == "yes" && $purpleairhardware == "no") {
        echo '<a  href="davis-air-quality-almanac2.php"  data-lity data-title="Davis Air Quality">';
        echo 'AQI';
        echo '<div class="link">Air Quality Data</div></a><br>';
    }
    //purple air only
    else if ($davisairquality == "no" && $purpleairhardware == "yes") {
        echo '<a  href="purple-air-almanac2.php"  data-lity data-title="Purple Air Quality">';
        echo 'AQI';
        echo '<div class="link">Air Quality Data</div></a><br>';
    }
    //luftdaten only
    else if ($davisairquality == "no" && $purpleairhardware == "no" && $luftdatenhardware == "yes") {
        echo '<a  href="luftdaten-air-quality-almanac2.php"  data-lity data-title="Luftdaten Air Quality">';
        echo 'AQI';
        echo '<div class="link">Air Quality Data</div></a><br>';
    }
    ?>

    <?php //air quality indoor options if yes
    if ($indooricon == "yes" && $davisairquality == "yes" && $davisairqualitylocation == "indoor") {
        echo '<a  href="weather34-ev-air.php"  data-title="Indoor Enviroment">';
        echo $hometempmenu . '<div class="link">Indoor Air Quality</div></a><br>';
    } else if ($indooricon == "yes" && $luftdatenhardware == "yes" && $lufdatenairqualitylocation == "indoor") {
        echo '<a  href="weather34-ev-air-luftdaten.php"  data-title="Indoor Enviroment">';
        echo $hometempmenu . '<div class="link">Luftdaten Air Quality</div></a><br>';
    } else if ($indooricon == "yes") {
        echo '<a href="weather34-indoor-info-ev.php" data-lity data-title="Indoor Data"  data-title="Indoor Enviroment">';
        echo $hometempmenu . '<div class="link">Indoor Data</div></a><br>';
    } ?>

    <?php //lightning OPTION if positions 10,11,12
    if ($position10 == "weather34-lightning-chuck.php" or  $position11 == "weather34-lightning-chuck.php" or $position12 == "weather34-lightning-chuck.php") {
        echo '<a href="weather34-lightning-charts.php" data-lity data-title="Lightning Almanac">';
        echo $weather34_lightningdata;
        echo '<div class="link">Lightning Data</div></a><br>';
    } ?>

    <a href="forecastcharts/chartforecast.php" data-title="5 day Forecast"><?php echo $weather34foremenu ?>
        <div class="link">Forecast</div>
    </a> <br>

    <?php //metar option if yes
    if ($metar == 'yes') {
        echo '<a href="metarnearby.php" data-lity data-title="Local Airport">'.$metarlocal.'<div class="link">Local Airport</div></a><br>';
    } ?>

    <?php //webcam option if yes
    if (substr ($webcamdevice, 0, 3) == "yes") {
        echo '<a href="weather34-large-cam.php" data-lity data-title="Webcam">';
        echo $webcamicon2 . '<div class="link">Webcam</div></a><br>';
    } ?>

    <?php //sun moon meteor
    echo '<a href="weather34-sun-moon-page.php" data-lity data-title="Sun | Moon | Meteor Info">' . $weather34sunicon ?><div class="link">Sun | Moon Info</div></a><br>

    <?php // regional earthquake
    if (filesize('jsondata/eqnotification.txt') < 160) {
        echo "";
    } else echo '<a href="eqlist.php" data-lity data-title="Regional Earthquakes">' . $weather34eq . "<div class='link'>Regional Earthquakes</div></a><br>" ?>

    <a href="weather34-template-legend.php" data-lity data-title="Hardware Info"> <?php echo $weather34hinfo; ?><div class="link">Hardware Info</div></a><br>

    
    
    <div class="menuguides">Dashboard Layouts</div><br>
    <div class='weather34_sidemenu_menulayout'>
        <?php //menu layouts   
        echo "&nbsp;";
        echo '<a  href="weather34-dashboard.php" >1</a>';
        echo '<a  href="weather34-os2-tablet.php">2</a>';
        echo '<a  href="weather34-os-tablet.php">3</a>';
        echo '<a  href="weather34-tablet.php" >4</a>';
        echo '<a  href="weather34-tablet-2.php" >5</a>';
        echo '<a  href="weather34-full-layout.php">6</a>';
        echo '<a  href="weather34-2024-layout.php">7</a>';
        echo '<a  href="weather34-2024-layout-2.php">8</a>';
        echo '<a  href="weather34-2024-layout-3.php">9</a>';
     ?></div>

<br>
   
    
    <div class="menuguides">Available Units</div><br>
    <div class='weather34_sidemenu_menulayout'>
        <?php //menu units  
        echo "&nbsp;";
        echo '<a  href="?units=us" data-title="&deg;F+MPH">&deg;F</a>';
        echo '<a  href="?units=metric" data-title="&deg;C+KMH">&deg;C</a>';
        echo '<a href="?units=uk" data-title="&deg;C+MPH">UK</a>';
        echo '<a  href="?units=knots" data-title="&deg;C+KTS">KTS</a>';
        echo '<a  href="?units=scandinavia" data-title="&deg;C+MS">M/S</a>';
        ?></div> <br>

        <script>
        // weather34 Aurora MKII menu December 2023 CLOSE anywhere...
var open = true;
document.addEventListener("mouseup", function(event){
    var weather34menu = document.getElementById('weather34-menu2024');
    if(open == true && event.target != weather34menu && event.target.parentNode != weather34menu){
            closeNav();
            console.log("Closing");
    //check if the Weather34 menu is really closed
    } else if (open == false) {
        console.log("Weather34 sidemenu is closed by default")
    }  
})</script>
