2021-08-23 10:41:53 +02:00
|
|
|
<?php
|
2021-11-17 08:02:45 +01:00
|
|
|
$dir = array_diff(scandir("./"), array('..','.','index.php','database.php','forberedelser.php'));
|
2021-08-23 10:41:53 +02:00
|
|
|
|
2021-10-10 17:12:46 +02:00
|
|
|
$modul = substr($_SERVER['REQUEST_URI'],-2,1);
|
2021-08-23 10:41:53 +02:00
|
|
|
|
|
|
|
function getModuleName($input): string {
|
|
|
|
$oppg = substr($input, -5, 1);
|
|
|
|
if(is_numeric($oppg)){
|
|
|
|
return "Oppgave $oppg";
|
|
|
|
}
|
|
|
|
return explode('.', $input)[0];
|
|
|
|
}
|
|
|
|
?><!DOCTYPE html>
|
|
|
|
<html lang="no">
|
|
|
|
<head>
|
|
|
|
<title>IS-115 - Webprogrammering i PHP</title>
|
2021-10-18 19:37:23 +02:00
|
|
|
<link rel="stylesheet" href="../index.css">
|
2021-08-23 10:41:53 +02:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h1>IS-115 - Webprogrammering i PHP</h1>
|
2021-10-18 19:37:23 +02:00
|
|
|
<h3>
|
|
|
|
Modul <?=$modul;?>
|
|
|
|
</h3>
|
|
|
|
<h5>
|
|
|
|
<strong><a href="../">Tilbake til alle moduler</a></strong>
|
|
|
|
</h5>
|
2021-08-23 10:41:53 +02:00
|
|
|
|
|
|
|
<?php
|
|
|
|
foreach($dir as $item){
|
2021-11-22 16:33:46 +01:00
|
|
|
if((stristr($item, '.php') || stristr($item, '.pdf')) && !stristr($item, '.inc.php')){
|
2021-08-23 10:41:53 +02:00
|
|
|
echo "<p><a href='$item'>".getModuleName($item)."</a></p>\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|