<?php
$poleStanic = array();
$poleTopologii = array();
$poleSpoju = array();

global $poleStanic;
global $poleTopologii;
global $poleSpoju;

include "connection.php";
$pokracovat = true;

if ($ANONYMOUS_MODE) {
  $poleStanic = null;
  $poleTopologii = null;
  $poleSpoju = null;
} else {
  if ($connection) {


    $query = "SELECT * FROM topologie";
    $result = mysqli_query($connection, $query);

    if ($result) {
      while ($row = mysqli_fetch_assoc($result)) {
        array_push($poleTopologii, $row);
      }
    }


    $query2 = "SELECT * FROM stanice";
    $result2 = mysqli_query($connection, $query2);


    if ($result2) {
      while ($row = mysqli_fetch_assoc($result2)) {
        array_push($poleStanic, $row);
      }
    }

    $query3 = "SELECT * FROM spoje";
    $result3 = mysqli_query($connection, $query3);

    if ($result3) {
      while ($row = mysqli_fetch_assoc($result3)) {
        array_push($poleSpoju, $row);
      }
    }

  }
}
mysqli_close($connection);

?>