diff --git a/style.css b/css/style.css
similarity index 100%
rename from style.css
rename to css/style.css
diff --git a/scripts/README.md b/external/README.md
similarity index 100%
rename from scripts/README.md
rename to external/README.md
diff --git a/scripts/searchTable.js b/external/searchTable.js
similarity index 100%
rename from scripts/searchTable.js
rename to external/searchTable.js
diff --git a/scripts/sortTable.js b/external/sortTable.js
similarity index 100%
rename from scripts/sortTable.js
rename to external/sortTable.js
diff --git a/admin.php b/public/admin.php
similarity index 93%
rename from admin.php
rename to public/admin.php
index ae2e446..69231e8 100644
--- a/admin.php
+++ b/public/admin.php
<?php
- include "connect.php";
- include "kirjautunut.php";
+ include "../src/connect.php";
+ include "../src/kirjautunut.php";
if (!$op) { // Jos ei opettaja, potki pois
// Redirect
- $newURL = "index.php";
+ $newURL = "../public/index.php";
header('Location: '.$newURL);
die();
}
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hallintapaneeli</title>
- <link rel="stylesheet" type="text/css" href="style.css">
+ <link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<body>
- <?php include "header.php"; ?>
+ <?php include "../src/header.php"; ?>
<h1>
Käyttäjät
</h1>
diff --git a/harjoittelupaikat.php b/public/harjoittelupaikat.php
similarity index 86%
rename from harjoittelupaikat.php
rename to public/harjoittelupaikat.php
index 2e241f2..99de0bb 100644
--- a/harjoittelupaikat.php
+++ b/public/harjoittelupaikat.php
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Harjoittelupaikat</title>
- <link rel="stylesheet" type="text/css" href="style.css">
+ <link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<body>
- <?php include "header.php"; ?>
+ <?php include "../src/header.php"; ?>
<h1>
Harjoittelupaikat
</h1>
- <a href="uusharjoittelupaikka.php">Lisää harjoittelupaikka</a>
+ <a href="../src/uusharjoittelupaikka.php">Lisää harjoittelupaikka</a>
<main>
<section>
<div class="table-container">
<th>Ohjaaja</th>
<th>Yhteystiedot</th>
</tr>
- <?php include "hae_harjoittelupaikat.php"; ?>
+ <?php include "../public/hae_harjoittelupaikat.php"; ?>
</table>
</div>
</section>
diff --git a/index.php b/public/index.php
similarity index 93%
rename from index.php
rename to public/index.php
index afd4d09..343eeba 100755
--- a/index.php
+++ b/public/index.php
<?php
// Täällä teemme listan henkilöistä jotka ovat taulukossa, alempana tiedostossa renderöimme ne
-include "kirjautunut.php";
+include "../src/kirjautunut.php";
// Käytä connect.php
-include "connect.php";
+include "../src/connect.php";
// SQL komento: saadaan oppilaat
$sql = "SELECT * FROM oppilaat";
$result = $conn->query($sql); // Aja komento
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Harjoittelupaikat</title>
- <link rel="stylesheet" type="text/css" href="style2.css">
+ <link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<body>
- <?php include "header.php"; ?>
+ <?php include "../src/header.php"; ?>
<main>
<section>
<h1>
if (isset($_GET['id']) and $tyyppi['id'] === $_GET['id']) // Jos tyyppi on muokattavissa
{
// Muuttaa normaalin tr rivin tableksi
- echo "<form action='muokkaa.php' method='POST'>";
+ echo "<form action='../src/muokkaa.php' method='POST'>";
echo "<input type='hidden' id='id' name='id' value={$tyyppi['id']}>";
echo "<td> <input type='text' name='nimi' id='nimi' value='" . $tyyppi["nimi"] . "'> </td>";
echo "<td> <input type='text' name='paikka' id='paikka' value='" . $tyyppi["paikka"] . "'> </td>";
echo "<td>" . $tyyppi["muuta"] . "</td>";
if ($op or ($logged_in and $tunnus === $tyyppi['nimi'])) { // Jos opettaja tai muokkaa omia tietoja
echo "<td>" . // Poista nappi
- "<form action='poista.php' method='POST'>
+ "<form action='../src/poista.php' method='POST'>
<input type='hidden' id='nimi' name='nimi' value={$tyyppi['nimi']}>
<input type='submit' value='Poista'>
</form>";
echo "" . // Muokkaa nappi
- "<form action='index.php?id={$tyyppi['id']}' method='GET'>
+ "<form action='../public/index.php?id={$tyyppi['id']}' method='GET'>
<input type='hidden' id='id' name='id' value={$tyyppi['id']}>
<input type='submit' value='Muokkaa'>
</form>"
<footer>
<hr>
<p>© Harjoittelupaikat 2025</p>
- <a href="index.html">Takaisin alkuun</a>
+ <a href="/public/index.php">Takaisin alkuun</a>
</footer>
<script>
var inputs = document.querySelectorAll('input'); // get the input element
this.style.width = this.value.length + "ch";
}
</script>
- <script src="./scripts/searchTable.js"></script>
- <script src="./scripts/sortTable.js"></script>
+ <script src="../external/searchTable.js"></script>
+ <script src="../external/sortTable.js"></script>
</body>
</html>
diff --git a/kirjautuminen.php b/public/kirjautuminen.php
similarity index 73%
rename from kirjautuminen.php
rename to public/kirjautuminen.php
index 5637023..516b726 100644
--- a/kirjautuminen.php
+++ b/public/kirjautuminen.php
<title>Kirjaudu</title>
</head>
<body>
- <header>
- <h1>
- Harjoittelupaikkoja
- </h1>
- <hr>
- <nav>
- <a href="index.php">Harjoittelupaikat</a>
- <span>·</span>
- <a href="kirjautuminen.php">Kirjaudu sisään</a>
- <span>·</span>
- <a href="uusopiskelija.php">Lisää uusi opiskelija</a>
- <hr>
- </nav>
- </header>
+ <?php include "../src/header.php" ?>
<main>
<section>
- <form action="kirjaudu.php" method="POST">
+ <form action="../src/kirjaudu.php" method="POST">
<fieldset>
<legend>Kirjaudu sisään</legend>
<label for="nimi">Nimi:</label>
<footer>
<hr>
<p>© Harjoittelupaikat 2025</p>
- <a href="index.php">Takaisin alkuun</a>
+ <a href="../public/index.php">Takaisin alkuun</a>
</footer>
</body>
</html>
diff --git a/register.php b/public/register.php
similarity index 90%
rename from register.php
rename to public/register.php
index eee8aee..74fe488 100644
--- a/register.php
+++ b/public/register.php
<title>Rekisteröidy</title>
</head>
<body>
- <?php include "header.php" ?>
+ <?php include "../src/header.php" ?>
<main>
<section>
- <form action="logic.register.php" method="POST">
+ <form action="../src/logic.register.php" method="POST">
<fieldset>
<legend>Luo Käyttäjä</legend>
<label for="nimi">Nimi:</label>
<footer>
<hr>
<p>© Harjoittelupaikat 2025</p>
- <a href="index.php">Takaisin alkuun</a>
+ <a href="../public/index.php">Takaisin alkuun</a>
</footer>
</body>
</html>
diff --git a/uusharjoittelupaikka.php b/public/uusharjoittelupaikka.php
similarity index 90%
rename from uusharjoittelupaikka.php
rename to public/uusharjoittelupaikka.php
index d72f364..d52092f 100644
--- a/uusharjoittelupaikka.php
+++ b/public/uusharjoittelupaikka.php
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lisää Harjoittelupaikka</title>
- <link rel="stylesheet" type="text/css" href="style.css">
+ <link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<body>
- <?php include "header.php"; ?>
+ <?php include "../src/header.php"; ?>
<main>
<section>
<h1>
Lisää harjoittelupaikka
</h1>
- <form action="lisaa_harjoittelupaikka.php" method="POST">
+ <form action="../src/lisaa_harjoittelupaikka.php" method="POST">
<fieldset>
<legend>
Harjoittelupaikan tiedot
<footer>
<hr>
<p>© Harjoittelupaikat 2025</p>
- <a href="index.php">Takaisin alkuun</a>
+ <a href="../public/index.php">Takaisin alkuun</a>
</footer>
</body>
</html>
diff --git a/uusopiskelija.php b/public/uusopiskelija.php
similarity index 94%
rename from uusopiskelija.php
rename to public/uusopiskelija.php
index 4bac247..03bd1a6 100644
--- a/uusopiskelija.php
+++ b/public/uusopiskelija.php
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lisää opiskelija</title>
- <link rel="stylesheet" type="text/css" href="style.css">
+ <link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<body>
- <?php include "header.php"; ?>
+ <?php include "../src/header.php"; ?>
<main>
<section>
<h1>
Lisää opiskelija
</h1>
- <form action="lisaa.php" method="POST">
+ <form action="../src/lisaa.php" method="POST">
<fieldset>
<legend>
Oppilaan tiedot
<footer>
<hr>
<p>© Harjoittelupaikat 2025</p>
- <a href="index.php">Takaisin alkuun</a>
+ <a href="../public/index.php">Takaisin alkuun</a>
</footer>
</body>
</html>
diff --git a/connect.php b/src/connect.php
similarity index 100%
rename from connect.php
rename to src/connect.php
diff --git a/hae_harjoittelupaikat.php b/src/hae_harjoittelupaikat.php
similarity index 94%
rename from hae_harjoittelupaikat.php
rename to src/hae_harjoittelupaikat.php
index 213ae26..06b335a 100644
--- a/hae_harjoittelupaikat.php
+++ b/src/hae_harjoittelupaikat.php
<?php
-include "connect.php";
+include "../src/connect.php";
$sql = "SELECT * FROM harjoittelupaikat";
$result = $conn->query($sql);
diff --git a/header.php b/src/header.php
similarity index 87%
rename from header.php
rename to src/header.php
index f30c1bc..3568ce5 100644
--- a/header.php
+++ b/src/header.php
<header>
<?php
-include "kirjautunut.php";
+include "../src/kirjautunut.php";
$conn->close();
?>
<hr>
<nav>
- <a href="index.php">Opiskelijoiden harjoittelupaikat</a>
+ <a href="../public/index.php">Opiskelijoiden harjoittelupaikat</a>
<span>·</span>
- <a href="harjoittelupaikat.php">Harjoittelupaikat</a>
+ <a href="../public/harjoittelupaikat.php">Harjoittelupaikat</a>
<span>·</span>
<?php
if ($logged_in){
echo "Kirjauduttu sisään, tervetuloa {$tunnus}";
echo "<span>·</span>";
- echo "<a href='kirjaudu_ulos.php'>Kirjaudu ulos</a>";
+ echo "<a href='../src/kirjaudu_ulos.php'>Kirjaudu ulos</a>";
if ($op) {
echo "<span>·</span>";
echo "<a href='admin.php'>Admin paneeli</a>";
diff --git a/kirjaudu.php b/src/kirjaudu.php
similarity index 88%
rename from kirjaudu.php
rename to src/kirjaudu.php
index 121f0a2..398f457 100644
--- a/kirjaudu.php
+++ b/src/kirjaudu.php
$nimi = $_POST["nimi"];
$salasana = $_POST["salasana"];
// Tarkista onnistuiko
-include "connect.php";
+include "../src/connect.php";
// Etsi tiedot tietokentästä
$sql = "SELECT * FROM `kayttajat` WHERE nimi='" . mysqli_real_escape_string($conn, $nimi) . "' LIMIT 1;";
$kayttaja = $conn->query($sql)->fetch_assoc(); // Aja komento
echo $tietokanta;
if (!password_verify($salasana, $salasana_tietokanta)){
// Tämä redirectaa pois
- include "kirjaudu_ulos.php";
+ include "../src/kirjaudu_ulos.php";
}
// Aseta keksit
setcookie("nimi", $nimi, time() + (86400 * 30), "/"); // 86400 = 1 day
setcookie("salasana", $salasana, time() + (86400 * 30), "/"); // 86400 = 1 day
// Redirect
-$newURL = "index.php";
+$newURL = "../public/index.php";
header('Location: '.$newURL);
die();
?>
diff --git a/kirjaudu_ulos.php b/src/kirjaudu_ulos.php
similarity index 87%
rename from kirjaudu_ulos.php
rename to src/kirjaudu_ulos.php
index 2effd90..6444c5b 100644
--- a/kirjaudu_ulos.php
+++ b/src/kirjaudu_ulos.php
setcookie("nimi", "", 0, "/");
setcookie("salasana", "", 0, "/");
// Redirect
-$newURL = "index.php";
+$newURL = "../public/index.php";
header('Location: '.$newURL);
die();
?>
diff --git a/kirjautunut.php b/src/kirjautunut.php
similarity index 96%
rename from kirjautunut.php
rename to src/kirjautunut.php
index 6bdf36c..35043b9 100644
--- a/kirjautunut.php
+++ b/src/kirjautunut.php
$logged_in = false;
// Onko opettaja käyttäjä (overpowered)
$op = false;
-include "connect.php";
+include "../src/connect.php";
if(isset($_COOKIE["nimi"]) and isset($_COOKIE["salasana"])){
// TIEDOT
$tunnus = mysqli_real_escape_string($conn, $_COOKIE['nimi']);
diff --git a/lisaa.php b/src/lisaa.php
similarity index 82%
rename from lisaa.php
rename to src/lisaa.php
index 08222cf..eec0533 100644
--- a/lisaa.php
+++ b/src/lisaa.php
<?php
-include "connect.php";
-include "kirjautunut.php";
+include "../src/connect.php";
+include "../src/kirjautunut.php";
-// Jos kirjautunut sisään (kirjautunut.php)
+// Jos kirjautunut sisään (../src/kirjautunut.php)
if ($logged_in and $op) {
// Lisää SQL
$sql = "INSERT INTO `oppilaat` (`id`, `nimi`, `paikka`, `ohjaaja`, `yhteystiedot`, `aloitus`, `lopetus`, `status`, `ruokaraha`, `muuta`) VALUES (NULL, '{$_POST["nimi"]}', '{$_POST["paikka"]}', '{$_POST["ohjaaja"]}', '{$_POST["yhteystiedot"]}', '{$_POST["aloitus"]}', '{$_POST["lopetus"]}', '{$_POST["status"]}', '{$_POST["ruokaraha"]}', '{$_POST["muuta"]}')";
$conn->close();
}
// Redirect
-$newURL = "index.php";
+$newURL = "../public/index.php";
header('Location: '.$newURL);
die();
?>
diff --git a/lisaa_harjoittelupaikka.php b/src/lisaa_harjoittelupaikka.php
similarity index 84%
rename from lisaa_harjoittelupaikka.php
rename to src/lisaa_harjoittelupaikka.php
index dfd577b..5fef5d3 100644
--- a/lisaa_harjoittelupaikka.php
+++ b/src/lisaa_harjoittelupaikka.php
<?php
-include "connect.php";
-include "kirjautunut.php";
+include "../src/connect.php";
+include "../src/kirjautunut.php";
if ($logged_in and $op) {
$sql = "INSERT INTO `harjoittelupaikat` (`id`, `nimi`, `ohjaaja`, `yhteystiedot`) VALUES (NULL, '{$_POST["nimi"]}', '{$_POST["ohjaaja"]}', '{$_POST["yhteystiedot"]}')";
$conn->close();
}
// Redirect
-$newURL = "harjoittelupaikat.php";
+$newURL = "../public/harjoittelupaikat.php";
header('Location: '.$newURL);
die();
?>
diff --git a/logic.register.php b/src/logic.register.php
similarity index 90%
rename from logic.register.php
rename to src/logic.register.php
index adcd76d..97983d0 100644
--- a/logic.register.php
+++ b/src/logic.register.php
<?php
-include "connect.php";
+include "../src/connect.php";
$nimi = mysqli_real_escape_string($conn, $_POST["nimi"]);
$salasana = mysqli_real_escape_string($conn, $_POST["salasana"]);
}
$conn->close();
// Redirect
-$newURL = "index.php";
+$newURL = "../public/index.php";
header('Location: '.$newURL);
die();
?>
diff --git a/muokkaa.php b/src/muokkaa.php
similarity index 87%
rename from muokkaa.php
rename to src/muokkaa.php
index 71d59cc..f07f045 100644
--- a/muokkaa.php
+++ b/src/muokkaa.php
<?php
// Yhdistä tietokantaan
-include "connect.php";
-include "kirjautunut.php"; // Ehkä ei vaadittu?
+include "../src/connect.php";
+include "../src/kirjautunut.php"; // Ehkä ei vaadittu?
if ($op or ($logged_in and $tunnus === $_POST['nimi'])) { // Jos opettaja tai muokkaa omia tietoja // ONKO TÄMÄ TURVALLINEN??
$id = $_POST["id"];
}
}
// Redirect
-$newURL = "index.php";
+$newURL = "../public/index.php";
header('Location: '.$newURL);
die();
?>
diff --git a/poista.php b/src/poista.php
similarity index 86%
rename from poista.php
rename to src/poista.php
index 9680773..81b2603 100644
--- a/poista.php
+++ b/src/poista.php
<?php
// Yhdistä tietokantaan
-include "connect.php";
-include "kirjautunut.php"; // Ehkä ei vaadittu?
+include "../src/connect.php";
+include "../src/kirjautunut.php"; // Ehkä ei vaadittu?
if ($op or ($logged_in and $tunnus === $_POST['nimi'])) { // Jos opettaja tai muokkaa omia tietoja // ONKO TÄMÄ TURVALLINEN??
// Poista tietokannasta yksi tyyppi ideen avulla
$conn->close();
}
// Redirect
-$newURL = "index.php";
+$newURL = "../public/index.php";
header('Location: '.$newURL);
die();
?>
diff --git a/style2.css b/style2.css
deleted file mode 100644
index 7093bba..0000000
--- a/style2.css
+++ /dev/null
-/* Global background + text color */
-body {
- background-color: black;
- color: white; /* or use the animated color below */
- margin: 0;
- font-family: sans-serif;
-}
-
-/* Optional: animated RGB color loop for text & borders */
-@keyframes rgbLoop {
- 0% { color: rgb(255, 0, 0); border-color: rgb(255, 0, 0); }
- 33% { color: rgb(0, 255, 0); border-color: rgb(0, 255, 0); }
- 66% { color: rgb(0, 0, 255); border-color: rgb(0, 0, 255); }
- 100% { color: rgb(255, 0, 0); border-color: rgb(255, 0, 0); }
-}
-
-/* Apply to text and borders */
-body, table, th, td, nav, main, section, aside, footer {
- animation: rgbLoop 6s linear infinite;
-}
-
-/* Table styles */
-table, th, td {
- border: 1px solid;
- border-collapse: collapse;
-}
-
-/* Scrollable table container */
-.table-container {
- width: 100%;
- overflow-x: auto;
-}
-
-/* Layout sections */
-nav {
- text-align: right;
-}
-main {
- width: 100vw; /* fixed typo: wv → vw */
- display: flex;
- flex-direction: row;
- flex: 1;
-}
-section {
- width: 100%;
-}
-aside {
- text-align: right;
- flex: 1;
-}
-footer {
- text-align: center;
-}