2016-08-30 18:13:31 +02:00
|
|
|
<?php
|
2018-02-13 19:10:15 +01:00
|
|
|
require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
|
2017-10-28 17:19:40 +02:00
|
|
|
|
2016-08-30 18:13:31 +02:00
|
|
|
$translation = ['i dag', 'i morgen', 'denne uka', 'neste uke', 'denne måneden', 'neste måned'];
|
2017-10-22 17:57:55 +02:00
|
|
|
$projectManager = new \pvv\side\ProjectManager($pdo);
|
|
|
|
$projects = $projectManager->getAll();
|
|
|
|
?>
|
2018-02-10 16:23:17 +01:00
|
|
|
|
2016-08-30 18:13:31 +02:00
|
|
|
<!DOCTYPE html>
|
2016-08-18 00:25:47 +02:00
|
|
|
<html lang="no">
|
2018-02-10 16:23:17 +01:00
|
|
|
<head>
|
|
|
|
<title>Prosjektverkstedet</title>
|
|
|
|
<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/nav.css">
|
|
|
|
<link rel="stylesheet" href="../css/splash.css">
|
2018-02-24 16:53:17 +01:00
|
|
|
<link rel="stylesheet" href="../css/projects.css">
|
2018-02-10 16:23:17 +01:00
|
|
|
</head>
|
2016-08-15 19:30:45 +02:00
|
|
|
|
2018-02-10 16:23:17 +01:00
|
|
|
<body>
|
|
|
|
<nav>
|
|
|
|
<?php echo navbar(1, 'prosjekt'); ?>
|
2018-02-24 17:02:00 +01:00
|
|
|
<?php echo loginbar(null, $pdo); ?>
|
2018-02-10 16:23:17 +01:00
|
|
|
</nav>
|
2016-08-15 19:30:45 +02:00
|
|
|
|
2018-02-10 16:23:17 +01:00
|
|
|
<main>
|
|
|
|
<h2>Prosjekter</h2>
|
2017-10-22 17:57:55 +02:00
|
|
|
<?php
|
2018-02-10 16:23:17 +01:00
|
|
|
if(count($projects) == 0){
|
2017-10-22 17:57:55 +02:00
|
|
|
?>
|
2018-02-10 16:23:17 +01:00
|
|
|
<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>
|
|
|
|
<a class="btn" href="edit.php?new=1">Lag prosjekt</a>
|
|
|
|
<a class="btn" href="mine.php">Mine prosjekter</a>
|
|
|
|
<?php
|
|
|
|
}else{
|
|
|
|
?>
|
|
|
|
<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>
|
|
|
|
<a class="btn" href="edit.php?new=1">Lag prosjekt</a>
|
|
|
|
<a class="btn" href="mine.php">Mine prosjekter</a>
|
2018-02-14 17:56:19 +01:00
|
|
|
<hr class="projects-divider">
|
2017-10-22 17:57:55 +02:00
|
|
|
|
2018-02-14 17:56:19 +01:00
|
|
|
<?php
|
|
|
|
$randProjects = array_rand($projects, min(6, count($projects)));
|
|
|
|
if (!is_array($randProjects)) {
|
|
|
|
$randProjects = [$randProjects];
|
|
|
|
};
|
|
|
|
foreach($randProjects as $i) {
|
|
|
|
$project = $projects[$i];
|
2018-02-26 16:24:50 +01:00
|
|
|
$owner = $projectManager->getProjectOwner($project->getID());
|
2018-02-14 17:56:19 +01:00
|
|
|
?>
|
2017-10-22 17:57:55 +02:00
|
|
|
|
2018-02-14 17:56:19 +01:00
|
|
|
<div class="project-card">
|
|
|
|
<div class="card-content">
|
|
|
|
<h4 class="project-title"><?= $project->getName(); ?></h4>
|
|
|
|
<p><?= $project->getDescription()[0]; ?></p>
|
|
|
|
</div>
|
2018-02-26 16:24:50 +01:00
|
|
|
<p class="project-organizer">Organisert av<br><?= $owner['name']; ?></p>
|
2018-02-14 17:56:19 +01:00
|
|
|
</div>
|
|
|
|
<?php } ?>
|
2018-02-10 16:23:17 +01:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</main>
|
|
|
|
</body>
|