Есть файл Galvene.php
<?php // Example 27-2: header.php
  session_start();

echo <<<_INIT
<!DOCTYPE html> 
<html>
  <head>
    <meta charset='utf-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1'> 
    <link rel='stylesheet' href='jquery.mobile-1.4.5.min.css'>
    <link rel='stylesheet' href='styles.css' type='text/css'>
    <script src='javascript.js'></script>
    <script src='jquery-2.2.4.min.js'></script>
    <script src='jquery.mobile-1.4.5.min.js'></script>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Manrope&display=swap" rel="stylesheet">

_INIT;

  require_once 'functions.php';

  $userstr = 'Viesis';

  if (isset($_SESSION['user']))
  {
    $user     = $_SESSION['user'];
    $loggedin = TRUE;
  }
  else $loggedin = FALSE;

echo <<<_MAIN
    <title>Uzskaite</title>
  </head>
  <body>

  <a href="https://rezeknestehnikums.lv/" id="logo-header"></a>
_MAIN;

if ($loggedin) {
  echo <<<_LOGGEDIN
  <button id="Dezures" onclick="showTable('table1'); hideTextContainer();">Dežurēs</button>
  <button id="Audzēkņu-Uzskaite" onclick="showTable('table2'); hideTextContainer();">Audzēkņu uzskaite</button>
  <div id="ZilsUzskaitesFons"></div>
  <div id="FonaTekstura"></div>
  <div id="ZalsTabulasFons"></div>
  <div id="TabulasZona">
      <div id="table1" class="table-container">
          <?php include 'table_1.php'; ?>
      </div>
      <div id="table2" class="table-container">
          <?php include 'table_2.php'; ?>
      </div>
      <div id="text-container">
          <p>Izveleties datu bazi augšeja saites daļa</p>
      </div>
  </div>
  <button id="PogaPievienosana" onclick="openModal()">Pievienot</button>
  <div id="modal" class="modal"></div>
  <a href="ielogoties.php" id="PogaIziet">Iziet</a>
  <button id="TekstaPogaMeklēt">
      <div id="search"></div>Meklēt
  </button>
  <button id="TekstaPogaMainit">Mainit</button>
  <div id="TabulasVirsraksts">Datu baze</div>
  _LOGGEDIN;
} else {
  echo <<<_GUEST
  <div id="ZalsFons"></div>
  <div id="FonaTekstura"></div>
  <button id="SadalaPieteiktiesPiekluvejs" onclick="show('LoginForm'); hideTextContainer();">Pieteikties piekļuvej</button>
  <button id="SadalaIelogoties" onclick="show('RegisterForm'); hideTextContainer();">Ielogoties</button>
  <div id="LoginForm" class="table-container">
      <?php include 'Ielogoties.php'; ?>
  </div>
  <div id="RegisterForm" class="table-container">
      <?php include 'PieteiksanasPiekluvej.php'; ?>
  </div>
  _GUEST;
}
?>



Есть файл functions.php
<?php // Example 27-1: functions.php
  $dbhost  = '10.0.114.137';    // Unlikely to require changing
  $dbname  = 'meiksans';   // Modify these...
  $dbuser  = 'meiksans';   // ...variables according
  $dbpass  = '7450';   // ...to your installation

  $connection = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
  if ($connection->connect_error) die("Fatala kļuda");
  echo 
  "<br>";

  function createTable($name, $query)
  {
    queryMysql("CREATE TABLE IF NOT EXISTS $name($query)");
    echo "Tabula '$name' ir izveidota vai jau eksiste.<br>";
  }

  function queryMysql($query)
  {
    global $connection;
    $result = $connection->query($query);
    if (!$result) die("Fatala kļuda");
    return $result;
  }

  function destroySession()
  {
    $_SESSION=array();

    if (session_id() != "" || isset($_COOKIE[session_name()]))
      setcookie(session_name(), '', time()-2592000, '/');

    session_destroy();
  }

  function sanitizeString($var)
  {
    global $connection;
    $var = strip_tags($var);
    $var = htmlentities($var);
    if (get_magic_quotes_gpc())
      $var = stripslashes($var);
    return $connection->real_escape_string($var);
  }

  function showProfile($user)
  {
    if (file_exists("$user.jpg"))
      echo "<img src='$user.jpg' style='float:left;'>";

    $result = queryMysql("SELECT * FROM profiles WHERE user='$user'");

    if ($result->num_rows)
    {
      $row = $result->fetch_array(MYSQLI_ASSOC);
      echo stripslashes($row['text']) . "<br style='clear:left;'><br>";
    }
    else echo "<p>Nav apraksta!</p><br>";
  }

  function showTable(tableId) {
    var tables = document.getElementsByClassName('table-container');
    for (var i = 0; i < tables.length; i++) {
      tables[i].style.display = 'none';
    }
    document.getElementById(tableId).style.display = 'block';
  }

  function hideTextContainer() {
    var textContainer = document.getElementById('text-container');
    textContainer.style.display = 'none';
  }

    function openModal() {
      var modal = document.getElementById('modal');
      modal.style.display = 'block';
    }

    function show($formId) {
      echo "document.getElementById('RegisterForm').style.display = 'none';";
      echo "document.getElementById('LoginForm').style.display = 'none';";
      echo "document.getElementById('$formId').style.display = 'block';";
      echo "hideTextContainer();"; // Optionally hide the text container
    }
    

    function closeModal() {
      var modal = document.getElementById('modal');
      modal.style.display = 'none';
    }

            // Take information from table
            $sqltable1 = "SELECT * FROM dežures";
            $sqltable2 = "SELECT * FROM audzekņu uzskaite";
            $result1 = $connection->query($sqltable1);
            $result2 = $connection->query($sqltable2);
            $table = "-";
?>