php-censor/src/PHPCensor/View/User/index.phtml
2016-07-21 23:02:11 +06:00

62 lines
2.8 KiB
PHTML

<?php use PHPCensor\Helper\Lang; ?>
<div class="clearfix" style="margin-bottom: 20px;">
<div class="pull-right btn-group">
<a class="btn btn-primary" href="<?php print APP_URL; ?>user/add"><?php Lang::out('add_user'); ?></a>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box box-primary">
<table class="table">
<thead>
<tr>
<th><?php Lang::out('email_address'); ?></th>
<th><?php Lang::out('name'); ?></th>
<th><?php Lang::out('is_admin'); ?></th>
<th style="width: 100px"></th>
</tr>
</thead>
<tbody id="users">
<?php foreach($users['items'] as $user): ?>
<?php
switch($user->getIsAdmin())
{
case 0:
$cls = '';
$status = Lang::get('no');
break;
case 1:
$cls = 'warning';
$status = Lang::get('yes');
break;
}
?>
<tr class="<?php print $cls; ?>">
<td><a href="<?php echo APP_URL ?>user/edit/<?php print $user->getId(); ?>"><?php print $user->getEmail(); ?></a></td>
<td><?php print htmlspecialchars($user->getName()); ?></td>
<td><?php print $status; ?></td>
<td>
<?php if($this->User()->getIsAdmin()): ?>
<div class="btn-group pull-right">
<a class="btn btn-default btn-small" href="<?php echo APP_URL ?>user/edit/<?php print $user->getId(); ?>"><?php Lang::out('edit'); ?></a>
<button class="btn btn-default btn-small dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="<?php echo APP_URL ?>user/delete/<?php print $user->getId(); ?>" class="app-delete-user"><?php Lang::out('delete_user'); ?></a></li>
</ul>
</div>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>