83 lines
3.9 KiB
PHP
83 lines
3.9 KiB
PHP
|
<?php
|
||
|
require_once __DIR__ . '/../_v4/includes.php';
|
||
|
|
||
|
define('FWH_STYLE', FWH_2019);
|
||
|
|
||
|
echo html_open()
|
||
|
. '<head>'
|
||
|
. html_head('Projects', HEAD_FLASHWAVE)
|
||
|
. '</head><body>'
|
||
|
. html_navigation(NAV_FLASHWAVE)
|
||
|
. '<div class="wrapper">';
|
||
|
?>
|
||
|
<div class="projects projects--active">
|
||
|
<div class="projects-header">Active Projects</div>
|
||
|
|
||
|
<div class="projects-listing">
|
||
|
<?php
|
||
|
$archived = false;
|
||
|
$getProjects = $pdo->prepare('
|
||
|
SELECT `project_id`, `project_name`, `project_summary`, `project_homepage`, `project_repository`, `project_forum`, `project_archived`
|
||
|
FROM `fm_projects`
|
||
|
WHERE `project_deleted` IS NULL
|
||
|
ORDER BY !ISNULL(`project_archived`), `project_order` DESC
|
||
|
');
|
||
|
$getProjects->execute();
|
||
|
$projects = $getProjects->fetchAll(PDO::FETCH_OBJ);
|
||
|
|
||
|
$getLanguages = $pdo->prepare('
|
||
|
SELECT pl.`language_name`, pl.`language_colour`
|
||
|
FROM `fm_proglangs` AS pl
|
||
|
LEFT JOIN `fm_projects_proglangs` AS ppl
|
||
|
ON ppl.`language_id` = pl.`language_id`
|
||
|
WHERE ppl.`project_id` = :project_id
|
||
|
ORDER BY ppl.`priority`
|
||
|
');
|
||
|
|
||
|
foreach ($projects as $project) {
|
||
|
$getLanguages->bindValue('project_id', $project->project_id);
|
||
|
$getLanguages->execute();
|
||
|
$languages = $getLanguages->fetchAll(PDO::FETCH_OBJ);
|
||
|
|
||
|
if(!$archived && !empty($project->project_archived)) {
|
||
|
$archived = true;
|
||
|
?>
|
||
|
</div></div><div class="projects projects--archived">
|
||
|
<div class="projects-header">Archived Projects</div>
|
||
|
<div class="projects-listing">
|
||
|
<?php
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
<div class="project-v2"<?php if(isset($languages[0]->language_colour)) { echo sprintf(' style="background-color: %1$s; box-shadow: 0 0 3px %1$s;"', html_colour($languages[0]->language_colour)); } ?>>
|
||
|
<div class="project-inner">
|
||
|
<h1 class="project-name"><?=$project->project_name;?></h1>
|
||
|
<div class="project-description"><?=trim($project->project_summary);?></div>
|
||
|
|
||
|
<div class="project-languages">
|
||
|
<?php foreach($languages as $language) { ?>
|
||
|
<div class="project-language" style="<?=sprintf('border-color: %1$s; box-shadow: 0 0 2px %1$s;', html_colour($language->language_colour));?>">
|
||
|
<?=$language->language_name;?>
|
||
|
</div>
|
||
|
<?php } ?>
|
||
|
</div>
|
||
|
<div class="project-links">
|
||
|
<?php if (!empty($project->project_homepage)): ?>
|
||
|
<a class="project-link" href="<?=$project->project_homepage;?>"><i class="fas fa-home fa-fw"></i> Homepage</a>
|
||
|
<?php endif; if (!empty($project->project_repository)): ?>
|
||
|
<a class="project-link" href="<?=$project->project_repository;?>"><i class="fas fa-code fa-fw"></i> Repository</a>
|
||
|
<?php endif; if(!empty($project->project_forum)): ?>
|
||
|
<a class="project-link" href="<?=$project->project_forum;?>"><i class="fas fa-comments fa-fw"></i> Forum</a>
|
||
|
<?php endif; ?>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<?php } ?>
|
||
|
</div>
|
||
|
</div>
|
||
|
<?php
|
||
|
echo '</div>'
|
||
|
. html_footer()
|
||
|
. '</body>'
|
||
|
. html_close();
|