'; // Connect to DB $con = new mysqli($SQL_SERVER, $SQL_USER, $SQL_PASSWORD, $SQL_DATABASE, $SQL_PORT); if ($con->connect_error) { quit(); } $stmt = $con->prepare("SELECT secondLevel.name AS name, status.color AS color FROM secondLevel JOIN status ON secondLevel.status_id = status.id WHERE secondLevel.parent_id = (SELECT id FROM topLevel WHERE name = ?)"); $stmt->bind_param("s", $tile); $stmt->execute(); $result = $stmt->get_result(); $ret = $result->fetch_all(MYSQLI_ASSOC); if ($ret != False) { $tiles = []; foreach($ret as $row) { $tiles[$row["name"]] = $row["color"]; } $y = 405; for ($i = $lat; $i < $lat + 10; $i++) { $x = 0; for ($j = $lon; $j < $lon + 10; $j++) { $name = $we . clipNumber($j, 3) . $sn . clipNumber($i, 2); echo ''; $x += 45; } $y -= 45; } } for ($i = 45; $i < 450; $i += 45) { echo ''; echo ''; } echo ''; $stmt = $con->prepare("SELECT status.name AS status, COUNT(*) AS sCount, status.color AS color FROM secondLevel JOIN status ON secondLevel.status_id = status.id WHERE secondLevel.parent_id = (SELECT id FROM topLevel WHERE name = ?) GROUP BY status.id ORDER BY priority"); $stmt->bind_param("s", $tile); $stmt->execute(); $result = $stmt->get_result(); $ret = $result->fetch_all(MYSQLI_ASSOC); echo '
'; foreach ($ret as $row) { echo ''; } if (isset($_GET["minor"])) { $sql = 'SELECT * FROM information_schema.tables WHERE table_name = "tile" AND table_schema = "' . $SQL_DATABASE . '"'; $ret = $con->query($sql)->fetch_all(MYSQLI_ASSOC); if (!empty($ret)) { $stmt = $con->prepare("SELECT status.name AS status, COUNT(*) AS sCount, status.color AS color FROM tile JOIN status ON tile.status_id = status.id WHERE tile.parent_id = (SELECT id FROM secondLevel WHERE name = ?) GROUP BY status.id ORDER BY priority"); $stmt->bind_param("s", $_GET["minor"]); $stmt->execute(); $result = $stmt->get_result(); $ret = $result->fetch_all(MYSQLI_ASSOC); echo '
Tile Name' . $tile . '
' . $row["status"] . '' . $row["sCount"] . '
'; echo ''; foreach ($ret as $row) { echo ''; } } echo '
Tile Name' . $_GET["minor"] . '
' . $row["status"] . '' . $row["sCount"] . '
'; // if (isset($_POST["form"])) // { echo '

'; // } } echo '
'; } ?>