Projects/nettsiden-old
Projects
/
nettsiden-old
Archived
8
0
Fork 0
This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
nettsiden-old/www/prosjekt/index.php

68 lines
2.0 KiB
PHP
Raw Normal View History

<?php
2018-02-13 19:10:15 +01:00
require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
$translation = ['i dag', 'i morgen', 'denne uka', 'neste uke', 'denne måneden', 'neste måned'];
$projectManager = new \pvv\side\ProjectManager($pdo);
$projects = $projectManager->getAll();
?>
<!DOCTYPE html>
<html lang="no">
<title>Prosjektverkstedet</title>
2016-08-15 19:30:45 +02:00
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<link rel="stylesheet" href="../css/normalize.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/splash.css">
<header>Prosjekt&shy;verk&shy;stedet</header>
2016-08-15 19:30:45 +02:00
<main>
<article class="threed">
2017-10-28 14:01:49 +02:00
<h2>Prosjekter</h2>
<?php
if(count($projects) == 0){
?>
<p>PVV har for øyeblikket ingen aktive prosjekter. Tenker du at noe bør gjøres? Har du en kul ide for noe PVV kan samarbeide om? Sett opp et prosjekt!</p>
<br>
2017-10-28 20:09:54 +02:00
<a class="btn" href="edit.php?new=1">Lag prosjekt</a>
<a class="btn" href="mine.php">Mine prosjekter</a>
<?php
}else{
?>
2017-10-28 14:01:49 +02:00
<p>Lyst til å gjøre noe kult? Her er et utvalg av de prosjektene som PVVere har laget. Mangler det noe, eller brenner du for noe annet? Sett opp et eget prosjekt!</p>
2017-10-28 20:09:54 +02:00
<a class="btn" href="edit.php?new=1">Lag prosjekt</a>
<a class="btn" href="mine.php">Mine prosjekter</a>
2016-08-15 19:30:45 +02:00
<ul class="calendar-events">
<?php
$randProjects = array_rand($projects, min(3, count($projects)));
2017-10-28 20:54:33 +02:00
if (!is_array($randProjects)) {
$randProjects = [$randProjects];
};
foreach($randProjects as $i) {
$project = $projects[$i];
?>
<li>
<p class="noborder no-chin"><?= "<a href=\"project/?id=" . $project->getID() . "\">" . $project->getName() . "</a>"; ?></p>
<p class="subnote"><?= "Organisert av: " . $project->getOwner(); ?></p>
<span>
<p><?= $project->getDescription(); ?></p>
</span>
</li>
<?php } ?>
</ul>
<?php
}
?>
2016-08-15 19:30:45 +02:00
</article>
</main>
<nav>
<?= navbar(1, 'prosjekt'); ?>
2018-02-13 19:08:41 +01:00
<?= loginbar($sp, $pdo); ?>
2017-10-28 20:54:33 +02:00
</nav>