<?php

require "databasedisplay.php";
$mysql = new DatabaseDisplay("employees", 2, "employees", 102);
$mysql->gettingStuff();
require_once "databaseconnect.php";
if (!isset($_GET["page"])) {
    $_GET["page"] = 0;
}
if (!isset($_GET["park"])) {
    if ($_GET["page"] > 0) {
        $idstart = 1 + $_GET["page"] * 10;
    } else {
        $idstart = 1;
    }
} else {
    $idstart = $_GET["park"];
}
$dbc = new DatabaseDisplay("parks_db", 0, "national_parks", 10);
$innawoods = $dbc->gettingStuff($idstart);
$post = [];
function parkArray($innawoods)
{
    for ($i = 0; $i < count($innawoods); $i++) {
        $parks[$i] = $innawoods[$i];
    }
    return $parks;
}
function postArray($parks)
{
    $i = 0;
    while ($i < count($parks)) {
        if ($i % 2 == 0) {
            if (isset($parks[$i]["description"])) {
                $post[$i] = "<div class='park right'><div class='noopacity'><div class='title'><a href='?park=" . $parks[$i]["id"] . "'>" . $parks[$i]["name"] . "</a></div><div class='locales'>" . $parks[$i]["location"] . "</div><div class='date-established'>" . $parks[$i]["date_established"] . "</div><div class='area-acres'>" . $parks[$i]["area_in_acres"] . " Acres</div><div class='description'>" . $parks[$i]["description"] . "</div></div></div>";