2016-08-30 18:13:31 +02:00
|
|
|
<?php
|
2017-10-22 17:57:55 +02:00
|
|
|
ini_set('display_errors', '1');
|
|
|
|
error_reporting(E_ALL);
|
2016-08-30 18:13:31 +02:00
|
|
|
date_default_timezone_set('Europe/Oslo');
|
|
|
|
setlocale(LC_ALL, 'no_NO');
|
|
|
|
require __DIR__ . '/../../src/_autoload.php';
|
|
|
|
require __DIR__ . '/../../sql_config.php';
|
2017-10-28 17:19:40 +02:00
|
|
|
require_once(__DIR__ . '/../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
|
|
|
|
$as = new SimpleSAML_Auth_Simple('default-sp');
|
|
|
|
$attrs = $as->getAttributes();
|
|
|
|
|
2016-08-30 18:13:31 +02:00
|
|
|
$translation = ['i dag', 'i morgen', 'denne uka', 'neste uke', 'denne måneden', 'neste måned'];
|
|
|
|
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
|
|
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
2017-10-22 17:57:55 +02:00
|
|
|
$projectManager = new \pvv\side\ProjectManager($pdo);
|
|
|
|
$projects = $projectManager->getAll();
|
|
|
|
?>
|
2016-08-30 18:13:31 +02:00
|
|
|
<!DOCTYPE html>
|
2016-08-18 00:25:47 +02:00
|
|
|
<html lang="no">
|
2017-10-07 15:05:11 +02:00
|
|
|
<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">
|
|
|
|
|
2017-10-07 15:05:11 +02:00
|
|
|
<header>Prosjekt­verk­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>
|
2017-10-22 17:57:55 +02:00
|
|
|
<?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>
|
2016-08-30 18:13:31 +02:00
|
|
|
<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>
|
2017-10-22 17:57:55 +02:00
|
|
|
<?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
|
|
|
|
2017-10-22 17:57:55 +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];
|
2017-10-22 17:57:55 +02:00
|
|
|
?>
|
|
|
|
|
|
|
|
<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>
|
2016-08-29 19:37:49 +02:00
|
|
|
|
2017-10-28 17:19:40 +02:00
|
|
|
<nav>
|
|
|
|
<ul>
|
2016-08-29 19:37:49 +02:00
|
|
|
<li><a href="../">hjem</a></li>
|
2017-10-07 21:54:21 +02:00
|
|
|
<li><a href="../kalender/">kalender</a></li>
|
2017-10-07 14:49:20 +02:00
|
|
|
<li><a href="../aktiviteter/">aktiviteter</a></li>
|
2017-10-22 17:57:55 +02:00
|
|
|
<li class="active"><a href="../prosjekt/">prosjekter</a></li>
|
2017-10-22 13:33:14 +02:00
|
|
|
<li><a href="../kontakt/">kontakt</a></li>
|
2016-08-29 19:37:49 +02:00
|
|
|
<li><a href="../pvv/">wiki</a></li>
|
2017-10-28 17:19:40 +02:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$attr = $as->getAttributes();
|
|
|
|
if($attr){
|
|
|
|
$uname = $attr["uid"][0];
|
|
|
|
echo '<p class="login">logget inn som: ' . $uname . '</p>';
|
|
|
|
}else{
|
|
|
|
echo '<a class="login" href="' . $as->getLoginURL() . '">logg inn</a>';
|
|
|
|
}
|
|
|
|
?>
|
2017-10-28 20:54:33 +02:00
|
|
|
</nav>
|