Archived
1
0
This repository has been archived on 2020-12-10. You can view files and clone it, but cannot push or open issues or pull requests.
old/application/views/admin/projects.php

165 lines
9.1 KiB
PHP
Raw Permalink Normal View History

2018-10-16 16:28:42 +00:00
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use Coduo\PHPHumanizer\DateTimeHumanizer;
?>
<!-- page content -->
<div class="right_col" role="main">
<div class="">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Projekte</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<p class="text-muted font-13 m-b-30">
Alle derzeit vorhandenen Einträge im Portfolio sind hier aufgelistet
</p>
<div style="overflow-x: auto">
<table id="datatable-fixed-header" class="table table-striped table-bordered" data-order='[[ 0, "desc" ]]'>
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Titel</th>
<th>Kategorie</th>
<th>Headline</th>
<th>Datum</th>
<th>Bild</th>
<th>Tools</th>
</tr>
</thead>
<tbody>
<?php
foreach ($entries as $entry) {
$pCategories = $this->projectsModel->getEntryCategories($entry['ID']);
$pCategoriesList = "";
foreach ($pCategories as $pCategory) {
$pCategoriesList .= $pCategory['displayname'] . "<br>";
}
?>
<tr id="entry-<?= $entry['ID'] ?>">
<td><?= $entry['ID'] ?></td>
<td><?= $entry['name'] ?></td>
<td>
<a href="<?= base_url('projects/entry/' . $entry['name']) ?>" target="_blank"><?= $entry['title'] ?></a>
</td>
<td><?= $pCategoriesList ?></td>
<td><?= $entry['description'] ?></td>
<?php $datetime = strtotime($entry['datetime']) ?>
<td><?= date("d.m.Y", $datetime) . " - " . DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$datetime"), $_SESSION['site_lang']) ?></td>
<td>
<img src="<?= $entry['source'] ?>?h=110" class="img-fluid" style="max-height:110px;max-width:200px;">
</td>
<td>
<a data-toggle="tooltip" data-placement="top" title="" data-original-title="Bearbeiten" href="<?= base_url('admin/projects/edit/' . $entry['ID']) ?>">
<button type="button" class="btn btn-xs btn-default">
<i class="fa fa-edit"></i>
</button>
</a>
<button type="button" class="btn btn-xs btn-red" data-toggle="modal" data-target="#deleteModal" data-type="Projekt" data-title="<?= $entry['title'] ?>" data-id="<?= $entry['ID'] ?>">
<i class="fa fa-trash"></i>
</button>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Projekt-Kategorien</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<p class="text-muted font-13 m-b-30">
Alle derzeit vorhandenen Kategorien sind hier aufgelistet
</p>
<table id="datatable-fixed-header" class="table table-striped table-bordered">
<thead>
<tr>
<th rowspan="2">ID</th>
<th colspan="3">Name</th>
<th colspan="3">Titel</th>
<th rowspan="2">Anzahl Einträge</th>
<th rowspan="2">Tools</th>
</tr>
<tr>
<th>Deutsch</th>
<th>Englisch</th>
<th>Französisch</th>
<th>Deutsch</th>
<th>Englisch</th>
<th>Französisch</th>
2018-10-16 16:28:42 +00:00
</tr>
</thead>
<tbody>
<?php foreach ($categories as $c) {
$names = explode(',', $c['name']);
$displaynames = explode(',', $c['displayname']);
?>
2018-10-16 16:28:42 +00:00
<tr id="category-<?= $c['ID'] ?>">
<td><?= $c['ID'] ?></td>
<td><?= isset($names[0]) ? $names[0] : '' ?></td>
<td><?= isset($names[1]) ? $names[1] : '' ?></td>
<td><?= isset($names[2]) ? $names[2] : '' ?></td>
<td><?= isset($displaynames[0]) ? $displaynames[0] : '' ?></td>
<td><?= isset($displaynames[1]) ? $displaynames[1] : '' ?></td>
<td><?= isset($displaynames[2]) ? $displaynames[2] : '' ?></td>
2018-10-16 16:28:42 +00:00
<td><?= $c['count'] ?></td>
<td>
<button type="button" class="btn btn-xs btn-red" data-toggle="modal" data-target="#deleteModal" data-type="Projekt-Kategorie" data-title="<?= $c['displayname'] ?>" data-id="<?= $c['ID'] ?>">
<i class="fa fa-trash"></i>
</button>
</td>
</tr>
<?php } ?>
</tbody>
</table>
2018-10-27 10:08:54 +00:00
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalTitle">
2018-10-16 16:28:42 +00:00
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="deleteModalTitle">Bist du dir WIRKLICH sicher?</h4>
</div>
<div class="modal-body">
<h3>
<i class="fa fa-spinner fa-spin"></i>
</h3>
</div>
<div class="modal-footer">
<button type="reset" class="btn btn-default" data-dismiss="modal">
Nicht löschen!
</button>
<button type="button" class="btn btn-red">Ja, löschen!</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
2018-10-27 10:08:54 +00:00
</div>