requireAuth();
$attrs = $as->getAttributes();
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$projectManager = new \pvv\side\ProjectManager($pdo);
$projects = $projectManager->getByOwner($attrs['uid'][0]);
$page = 1;
if(isset($_GET['page'])){
$page = $_GET['page'];
}
$filter = '';
if(isset($_GET['filter'])){
$filter = $_GET['filter'];
}
// filter
$projects = array_values(array_filter(
$projects,
function($project) use ($filter){
return (preg_match('/.*'.$filter.'.*/i', $project->getName()) or preg_match('/.*'.$filter.'.*/i', implode(" ", $project->getDescription())));
}
));
?>
Prosjektverkstedet
Mine Prosjekter
getID();
$owner = $projectManager->getProjectOwner($projectID);
if($owner['uname'] != $attrs['uid'][0]){
continue;
}
?>
-
Forrige side';
}
if(($counter == $pageLimit) and (($pageLimit * $page) < count($projects))){
echo '
Neste side';
}
?>