Browse Source

Fixed db issue

tags/v1.3^2
Teknikode 6 years ago
parent
commit
c31238ddb5
3 changed files with 19 additions and 18 deletions
  1. 14
    10
      admin/get_user.php
  2. 1
    1
      includes/classes/Role.class.php
  3. 4
    7
      templates/default/js/admin.js

+ 14
- 10
admin/get_user.php View File

@@ -41,16 +41,20 @@ if(isset($_POST))
?>
</div>
<div class="row">
<select class="form-control" name="role_select">
<?php
$roles = Role::getRoles();
foreach ($roles as $role)
{
echo "<option>".$role['role_name']."</option>";
}
?>
</select>
<button class="btn btn-default pull-right" id="<?php echo $user->id; ?>">Add Role</button>
<div class="col-sm-10">
<select class="form-control" name="role_select_<?php echo $user->id; ?>" id="role_select_<?php echo $user->id; ?>">
<?php
$roles = Role::getRoles($db);
foreach ($roles as $role)
{
echo "<option>".$role['role_name']."</option>";
}
?>
</select>
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-default" id="<?php echo $user->id; ?>">Add Role</button>
</div>
</div>
</div>

+ 1
- 1
includes/classes/Role.class.php View File

@@ -24,7 +24,7 @@ class Role
return isset($this->permissions[$permission]);
}
public function getRoles()
public function getRoles($db)
{
$role_list = $db->select('roles', "1=?", array(1));
$roles = array();

+ 4
- 7
templates/default/js/admin.js View File

@@ -6,13 +6,10 @@ function update_user_list(search)
data: "query="+search,
success: function(html)
{
if(html)
{
$(".user_list").html(html);
//linkAddRole('.add_role');
//linkRemoveRole('.remove_role');
//linkUserDelete('.user_delete');
}
$(".user_list").html(html);
//linkAddRole('.add_role');
//linkRemoveRole('.remove_role');
//linkUserDelete('.user_delete');
}
});
}

Loading…
Cancel
Save