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/users.php
2018-10-16 18:28:42 +02:00

137 lines
8.0 KiB
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use Coduo\PHPHumanizer\DateTimeHumanizer;
?>
<div class="right_col" role="main">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Alle Nutzer</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<p class="text-muted font-13 m-b-30">
Alle registrierten Nutzer dieser Plattform sind hier aufgelistet!
</p>
<div style="overflow-x: auto">
<table id="datatable-fixed-header" class="table table-striped table-bordered" data-page-length="25">
<thead>
<tr>
<th>ID</th>
<th>Nickname</th>
<th data-toggle="tooltip" data-placement="top" title="Geschlecht">Sex</th>
<th>Rang</th>
<th data-toggle="tooltip" data-placement="top" title="Erstellungsdatum">Erstellt</th>
<th>Logo</th>
<th data-toggle="tooltip" data-placement="top" title="Aktiviert?">Akt.?</th>
<th data-toggle="tooltip" data-placement="top" title="Zeige Werbung?">Ads?</th>
<th data-toggle="tooltip" data-placement="top" title="Erhalte E-Mails?">Mails?</th>
<th data-toggle="tooltip" data-placement="top" title="Erhalte Newsletter?">Newsletter?</th>
<th data-toggle="tooltip" data-placement="top" title="Derzeit online?">Online?</th>
<th>Login-Methode</th>
<th>Letzter Login</th>
<th>Sprache, Land</th>
<th>Tools</th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $user):
$gender = "";
if ($user['gender'] == "male")
$gender = "<i class='fa fa-mars'></i> M";
else if ($user['gender'] == "female")
$gender = "<i class='fa fa-venus'></i> W";
else if ($user['gender'] == 'other')
$gender = '<i class="fa fa-transgender"></i> A';
$loginMethods = [
0 => "Standard",
1 => "Google",
2 => "Twitter",
3 => "GitHub"
];
$loginMethod = $loginMethods[$user['login_method']];
$date_created = strtotime($user['date_created']);
$last_login = strtotime($user['lastLogin']);
$date_created_str = DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$date_created"), "de_DE");
$last_login_str = DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$last_login"), "de_DE");
?>
<tr>
<td>
<?= $user['ID'] ?>
</td>
<td>
<a href="<?= base_url('user/' . $user['username']) ?>" target="_blank">
<?= $user['displayname'] ?>
</a>
</td>
<td>
<?= $gender ?>
</td>
<td>
<?= $user['rankName'] ?>
</td>
<td>
<?= $date_created_str ?>
<br>
(<?= date("d.m.Y H:i", $date_created) ?>)
</td>
<td>
<img src="<?= $user['profile_picture'] ?>?w=50" class="img-fluid rounded"
alt="Profilbild"
style="max-height: 50px;">
</td>
<td>
<?= $user['is_activated'] ? "<i class='fa fa-check-circle'></i> Ja" : "<i class='fa fa-times-circle'></i> Nein" ?>
</td>
<td>
<?= $user['showAds'] ? '<i class="fa fa-check-circle"></i> Ja' : '<i class="fa fa-times-circle"></i> Nein' ?>
</td>
<td>
<?= $user['receiveEmails'] ? '<i class="fa fa-check-circle"></i> Ja' : '<i class="fa fa-times-circle"></i> Nein' ?>
</td>
<td>
<?= $user['receiveNewsletter'] ? '<i class="fa fa-check-circle"></i> Ja' : '<i class="fa fa-times-circle"></i> Nein' ?>
</td>
<td>
<?= $user['isCurrentlyOnline'] ? "<i class='fa fa-check-circle'></i> Ja" : "<i class='fa fa-times-circle'></i> Nein" ?>
</td>
<td>
<?= $loginMethod ?>
</td>
<td>
<?= $last_login_str ?>
<br>
(<?= date("d.m.Y H:i", $last_login) ?>)
</td>
<td>
<?= Locale::getDisplayLanguage($user['language'], "de") ?>
<br>
<?= Locale::getDisplayRegion("-" . $user['country'], 'de') ?>
</td>
<td>
<?php if (isset($_SESSION['user']) && $_SESSION['user']['rank'] >= 8 && ($_SESSION['user']['rank'] > $user['rank'] || $_SESSION['user']['rank'] == 10)): ?>
<a data-toggle="tooltip" data-placement="top" title="" data-original-title="Details" href="<?= base_url('admin/users/details/' . $user['ID']) ?>" target="_blank" class="btn btn-xs btn-default">
<i class="fa fa-info-circle"></i>
</a>
<a data-toggle="tooltip" data-placement="top" title="" data-original-title="Einstellungen" href="<?= base_url('admin/users/settings/' . $user['ID']) ?>" target="_blank" class="btn btn-xs btn-default">
<i class="fa fa-cog"></i>
</a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>