Diff between ef3a404c78d5edf5b11867e6354695b50006f4a5 and 5ef3ed3efa5328feceff69f62c96944e8412fc1a

Changed Files

File Additions Deletions Status
css/style.css +0 -0 renamed
external/README.md +0 -0 renamed
external/searchTable.js +0 -0 renamed
external/sortTable.js +0 -0 renamed
public/admin.php +5 -5 renamed
public/harjoittelupaikat.php +4 -4 renamed
public/index.php +10 -10 renamed
public/kirjautuminen.php +3 -16 renamed
public/register.php +3 -3 renamed
public/uusharjoittelupaikka.php +4 -4 renamed
public/uusopiskelija.php +4 -4 renamed
src/connect.php +0 -0 renamed
src/hae_harjoittelupaikat.php +1 -1 renamed
src/header.php +4 -4 renamed
src/kirjaudu.php +3 -3 renamed
src/kirjaudu_ulos.php +1 -1 renamed
src/kirjautunut.php +1 -1 renamed
src/lisaa.php +4 -4 renamed
src/lisaa_harjoittelupaikka.php +3 -3 renamed
src/logic.register.php +2 -2 renamed
src/muokkaa.php +3 -3 renamed
src/poista.php +3 -3 renamed
style2.css +0 -53 deleted

Full Patch

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
@@ -1,9 +1,9 @@
 <?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();
 	}
@@ -48,11 +48,11 @@
     <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
@@ -3,14 +3,14 @@
     <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">
@@ -20,7 +20,7 @@
                         <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
@@ -1,8 +1,8 @@
 <?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
@@ -20,10 +20,10 @@ if ($result->num_rows>0){
     <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>
@@ -62,7 +62,7 @@ if ($result->num_rows>0){
 				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>";
@@ -92,12 +92,12 @@ if ($result->num_rows>0){
 						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>"
@@ -123,7 +123,7 @@ if ($result->num_rows>0){
     <footer>
         <hr>
         <p>&copy; 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
@@ -140,7 +140,7 @@ if ($result->num_rows>0){
 			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
@@ -5,23 +5,10 @@
     <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>
@@ -36,7 +23,7 @@
     <footer>
         <hr>
         <p>&copy; 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
@@ -5,10 +5,10 @@
     <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>
@@ -25,7 +25,7 @@
     <footer>
         <hr>
         <p>&copy; 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
@@ -4,16 +4,16 @@
     <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
@@ -32,7 +32,7 @@
   <footer>
 	<hr>
 	<p>&copy; 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
@@ -4,16 +4,16 @@
     <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
@@ -63,7 +63,7 @@
   <footer>
 	<hr>
 	<p>&copy; 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
@@ -1,5 +1,5 @@
 <?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
@@ -1,19 +1,19 @@
 <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
@@ -3,7 +3,7 @@
 $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
@@ -14,13 +14,13 @@ echo $salasana;
 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
@@ -2,7 +2,7 @@
 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
@@ -3,7 +3,7 @@
 $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
@@ -1,8 +1,8 @@
 <?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"]}')";
@@ -14,7 +14,7 @@ if ($logged_in and $op) {
 	$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
@@ -1,6 +1,6 @@
 <?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"]}')";
@@ -12,7 +12,7 @@ if ($logged_in and $op) {
 	$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
@@ -1,5 +1,5 @@
 <?php
-include "connect.php";
+include "../src/connect.php";
 
 $nimi =  mysqli_real_escape_string($conn, $_POST["nimi"]);
 $salasana =  mysqli_real_escape_string($conn, $_POST["salasana"]);
@@ -17,7 +17,7 @@ else {
 }
 $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
@@ -1,7 +1,7 @@
 <?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"];
@@ -14,7 +14,7 @@ if ($op or ($logged_in and $tunnus === $_POST['nimi'])) { // Jos opettaja tai mu
 	}
 }
 // 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
@@ -1,7 +1,7 @@
 <?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
@@ -17,7 +17,7 @@ if ($op or ($logged_in and $tunnus === $_POST['nimi'])) { // Jos opettaja tai mu
 	$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
@@ -1,53 +0,0 @@
-/* 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;
-}