Kaynağa Gözat

Add more info

tags/v1.3^2
Teknikode 5 yıl önce
ebeveyn
işleme
21fab02e60
1 değiştirilmiş dosya ile 23 ekleme ve 15 silme
  1. 23
    15
      admin/get_user.php

+ 23
- 15
admin/get_user.php Dosyayı Görüntüle

@@ -7,47 +7,55 @@ if(isset($_POST))
$user_list = $db->select('users', "username LIKE ?", array('%'.$query.'%'));

$users = array();
foreach ($user_list as $user)
foreach ($user_list as $var)
{
if (!is_array($user))
if (!is_array($var))
{
$users = array($user_list);
break;
}
array_push($users, $user);
array_push($users, $var);
}
if ($users)
{
foreach ($users as $parsed_user)
{
$user = $userTools->getUser($parsed_user['username']);
$item = $userTools->getUser($parsed_user['username']);
?>
<div class="row">
<div class="col-sm-12">
<div class="row"><h3 class="text-center"><strong><?php echo $user->username; ?></strong></h3></div>
<div class="row"><h3 class="text-center"><strong><?php echo $item->username; ?></strong></h3></div>
<div class="row">
<div class="col-sm-6">
<ul class="list-group">
<li class="list-group-item text-right"><span class="pull-left"><strong>Joined</strong></span> <?php echo $user->join_date; ?></li>
<li class="list-group-item text-right"><span class="pull-left"><strong>Last Seen</strong></span> <?php echo $user->last_seen; ?></li>
<li class="list-group-item text-right"><span class="pull-left"><strong>Email</strong></span> <a href="mailto:<?php echo $user->username; ?>@teknik.io"><?php echo $user->username; ?>@teknik.io</a></li>
<li class="list-group-item text-right"><span class="pull-left"><strong>Blog</strong></span> <a href="<?php echo get_page_url('blog', $CONF).'/'.$user->username; ?>" id="blog_title"><?php echo $user->blog_title; ?></a></li>
<li class="list-group-item text-center"><button type="button" class="btn btn-danger delete_account" id="<?php echo $user->id; ?>">Delete Account</button></li>
<li class="list-group-item text-right"><span class="pull-left"><strong>Joined</strong></span> <?php echo $item->join_date; ?></li>
<li class="list-group-item text-right"><span class="pull-left"><strong>Last Seen</strong></span> <?php echo $item->last_seen; ?></li>
<li class="list-group-item text-right"><span class="pull-left"><strong>Email</strong></span> <a href="mailto:<?php echo $item->username; ?>@teknik.io"><?php echo $item->username; ?>@teknik.io</a></li>
<?php if ($item->blog_title) { ?>
<li class="list-group-item text-right"><span class="pull-left"><strong>Blog</strong></span> <a href="<?php echo get_page_url('blog', $CONF).'/'.$item->username; ?>" id="blog_title"><?php echo $item->blog_title; ?></a></li>
<?php } ?>
<?php if ($item->website) { ?>
<li class="list-group-item text-right"><span class="pull-left"><strong>Website</strong></span> <a href="<?php echo $item->website; ?>" id="website"><?php echo $item->website; ?></a></li>
<?php } ?>
<?php if ($item->quote) { ?>
<li class="list-group-item text-right"><span class="pull-left"><strong>Quote</strong></span> <?php echo $item->quote; ?></li>
<?php } ?>
<li class="list-group-item text-center"><button type="button" class="btn btn-danger delete_account" id="<?php echo $item->id; ?>">Delete Account</button></li>
</ul>
</div>
<div class="col-sm-6">
<div class="row">
<h4>Roles</h4>
<?php
foreach ($user->roles as $role_name => $perm)
foreach ($item->roles as $role_name => $perm)
{
$role = Role::getRole($db, $role_name);
?>
<div class="form-group">
<label class="col-sm-8 control-label" for="<?php echo $user->id; ?>_<?php echo $role['role_id']; ?>"><?php echo $role['role_name']; ?></label>
<label class="col-sm-8 control-label" for="<?php echo $item->id; ?>_<?php echo $role['role_id']; ?>"><?php echo $role['role_name']; ?></label>
<div class="col-sm-4">
<button type="button" class="btn btn-danger btn-sm remove_user_role" id="<?php echo $user->id; ?>_<?php echo $role['role_id']; ?>">Remove</button>
<button type="button" class="btn btn-danger btn-sm remove_user_role" id="<?php echo $item->id; ?>_<?php echo $role['role_id']; ?>">Remove</button>
</div>
</div>
<?php
@@ -57,7 +65,7 @@ if(isset($_POST))
<br />
<div class="row">
<div class="col-sm-10">
<select class="selectpicker" name="role_select_<?php echo $user->id; ?>" id="role_select_<?php echo $user->id; ?>">
<select class="selectpicker" name="role_select_<?php echo $item->id; ?>" id="role_select_<?php echo $item->id; ?>">
<?php
$roles = Role::getRoles($db);
foreach ($roles as $role)
@@ -68,7 +76,7 @@ if(isset($_POST))
</select>
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-default add_user_role" id="<?php echo $user->id; ?>">Add Role</button>
<button type="button" class="btn btn-default add_user_role" id="<?php echo $item->id; ?>">Add Role</button>
</div>
</div>
</div>

Loading…
İptal
Kaydet