147 lines
		
	
	
		
			8.7 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			147 lines
		
	
	
		
			8.7 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']];
 | |
| 
 | |
|                                 $dateCreated = strtotime($user['date_created']);
 | |
|                                 $lastLogin = strtotime($user['lastLogin']);
 | |
|                                 $dateCreatedStr = DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$dateCreated"), "de_DE");
 | |
|                                 if($lastLogin)
 | |
|                                     $lastLoginStr = DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$lastLogin"), "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>
 | |
|                                         <?= $dateCreatedStr ?>
 | |
|                                         <br>
 | |
|                                         (<?= date("d.m.Y H:i", $dateCreated) ?>)
 | |
|                                     </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>
 | |
|                                         <?= $lastLoginStr ?>
 | |
|                                         <br>
 | |
|                                         (<?= date("d.m.Y H:i", $lastLogin) ?>)
 | |
|                                     </td>
 | |
|                                     <td>
 | |
|                                         <?= Locale::getDisplayLanguage($user['language'], "de") ?>
 | |
|                                         <br>
 | |
|                                         <?= Locale::getDisplayRegion("-" . $user['country'], 'de') ?>
 | |
|                                     </td>
 | |
|                                     <td>
 | |
|                                         <?php if(get_instance()->hasPermission('user.viewDetails')): ?>
 | |
|                                             <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>
 | |
|                                         <?php endif; ?>
 | |
| 
 | |
|                                         <?php if(get_instance()->hasPermission('user.viewDetails')): ?>
 | |
|                                             <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; ?>
 | |
| 
 | |
|                                         <?php if(get_instance()->hasPermission('user.ban')): ?>
 | |
|                                             <a data-toggle="tooltip" data-placement="top" title="" data-original-title="Account löschen" onclick="showDeleteModal(<?= $user['ID'] ?>. <?= $user['username'] ?>)" target="_blank" class="btn btn-xs btn-red">
 | |
|                                                 <i class="fas fa-user-slash"></i>
 | |
|                                             </a>
 | |
|                                         <?php endif; ?>
 | |
|                                     </td>
 | |
|                                 </tr>
 | |
|                             <?php endforeach; ?>
 | |
|                             </tbody>
 | |
|                         </table>
 | |
|                     </div>
 | |
|                 </div>
 | |
|             </div>
 | |
|         </div>
 | |
|     </div>
 | |
| </div>
 | |
| 
 |