diff --git a/public/admin.php b/public/admin.php
index 69231e8..c15c669 100644
--- a/public/admin.php
+++ b/public/admin.php
<?php endforeach; ?>
</table>
</main>
+ <?php include "../src/footer.php"; ?>
</body>
</html>
diff --git a/public/harjoittelupaikat.php b/public/harjoittelupaikat.php
index 99de0bb..d04c826 100644
--- a/public/harjoittelupaikat.php
+++ b/public/harjoittelupaikat.php
+<?php
+ include "../src/connect.php";
+
+ $sql = "SELECT * FROM harjoittelupaikat";
+ $result = $conn->query($sql);
+
+ $harjoittelupaikat = [];
+ if ($result->num_rows>0) {
+ while($row = $result->fetch_assoc()) {
+ $harjoittelupaikat[] = $row;
+ }
+ } else {
+ echo "Harjoittelupaikkoja ei löytynyt";
+ }
+
+ $conn->close();
+?>
+
<html lang="en">
<head>
<meta charset="UTF-8">
<h1>
Harjoittelupaikat
</h1>
- <a href="../src/uusharjoittelupaikka.php">Lisää harjoittelupaikka</a>
+ <a href="../public/uusharjoittelupaikka.php">Lisää harjoittelupaikka</a>
<main>
- <section>
- <div class="table-container">
- <table>
- <tr>
- <th>Nimi</th>
- <th>Ohjaaja</th>
- <th>Yhteystiedot</th>
- </tr>
- <?php include "../public/hae_harjoittelupaikat.php"; ?>
- </table>
- </div>
- </section>
+ <table>
+ <tr>
+ <th>Nimi</th>
+ <th>Ohjaaja</th>
+ <th>Yhteystiedot</th>
+ </tr>
+ <?php foreach ($harjoittelupaikat as $harjoittelupaikka): ?>
+ <tr>
+ <?php
+ echo "<td>" . $harjoittelupaikka["nimi"] . "</td>";
+ echo "<td>" . $harjoittelupaikka["ohjaaja"] . "</td>";
+ echo "<td>" . $harjoittelupaikka["yhteystiedot"] . "</td>";
+ ?>
+ </tr>
+ <?php endforeach; ?>
+ </table>
</main>
+ <?php include "../src/footer.php"; ?>
</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/public/index.php b/public/index.php
index 0cf35fb..6e35456 100755
--- a/public/index.php
+++ b/public/index.php
</aside>
-->
</main>
- <footer>
- <hr>
- <p>© 🐟|🌱|👓👨💼|🍻🧊</p>
- <p><p>© Harjoittelupaikat</p>
-
- <a href="/public/index.php">Takaisin alkuun</a>
- </footer>
+ <?php include "../src/footer.php"; ?>
<script>
var inputs = document.querySelectorAll('input'); // get the input element
inputs.forEach((input) => {
diff --git a/public/kirjautuminen.php b/public/kirjautuminen.php
index 516b726..f25a1d8 100644
--- a/public/kirjautuminen.php
+++ b/public/kirjautuminen.php
</form>
</section>
</main>
- <footer>
- <hr>
- <p>© Harjoittelupaikat 2025</p>
- <a href="../public/index.php">Takaisin alkuun</a>
- </footer>
+ <?php include "../src/footer.php"; ?>
</body>
</html>
diff --git a/public/register.php b/public/register.php
index 74fe488..9921237 100644
--- a/public/register.php
+++ b/public/register.php
</fieldset>
</form>
</section>
- </main>
- <footer>
- <hr>
- <p>© Harjoittelupaikat 2025</p>
- <a href="../public/index.php">Takaisin alkuun</a>
- </footer>
+ </main>
+ <?php include "../src/footer.php"; ?>
</body>
</html>
diff --git a/public/uusharjoittelupaikka.php b/public/uusharjoittelupaikka.php
index d52092f..6ee9830 100644
--- a/public/uusharjoittelupaikka.php
+++ b/public/uusharjoittelupaikka.php
<input type="submit" name="submit" value="Lisää">
</form>
</section>
-</main>
- <footer>
- <hr>
- <p>© Harjoittelupaikat 2025</p>
- <a href="../public/index.php">Takaisin alkuun</a>
-</footer>
+ </main>
+ <?php include "../src/footer.php"; ?>
</body>
</html>
diff --git a/public/uusopiskelija.php b/public/uusopiskelija.php
index 03bd1a6..72a5efc 100644
--- a/public/uusopiskelija.php
+++ b/public/uusopiskelija.php
</form>
</section>
</main>
- <footer>
- <hr>
- <p>© Harjoittelupaikat 2025</p>
- <a href="../public/index.php">Takaisin alkuun</a>
-</footer>
+<?php include "../src/footer.php"; ?>
</body>
</html>
diff --git a/src/footer.php b/src/footer.php
new file mode 100644
index 0000000..3785548
--- /dev/null
+++ b/src/footer.php
+ <footer>
+ <hr>
+ <p>© 🐟|🌱|👓👨💼|🍻🧊</p>
+ <p><p>© Harjoittelupaikat</p>
+
+ <a href="/public/index.php">Takaisin alkuun</a>
+ </footer>
\ No newline at end of file
diff --git a/src/hae_harjoittelupaikat.php b/src/hae_harjoittelupaikat.php
deleted file mode 100644
index 06b335a..0000000
--- a/src/hae_harjoittelupaikat.php
+++ /dev/null
-<?php
-include "../src/connect.php";
-
-$sql = "SELECT * FROM harjoittelupaikat";
-$result = $conn->query($sql);
-
-if ($result->num_rows>0) {
- while($row = $result->fetch_assoc()) {
- echo "<tr>";
- echo "<td>" . $row["nimi"] . "</td>";
- echo "<td>" . $row["ohjaaja"] . "</td>";
- echo "<td>" . $row["yhteystiedot"] . "</td>";
- echo "</tr>";
- }
-} else {
- echo "Harjoittelupaikkoja ei löytynyt";
-}
-
-$conn->close();
-?>