Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

get_user.php 3.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. require_once('../includes/config.php');
  3. if(isset($_POST))
  4. {
  5. $query = rawurldecode($_POST['query']);
  6. $user_list = $db->select('users', "username LIKE ?", array('%'.$query.'%'));
  7. $users = array();
  8. foreach ($user_list as $var)
  9. {
  10. if (!is_array($var))
  11. {
  12. $users = array($user_list);
  13. break;
  14. }
  15. array_push($users, $var);
  16. }
  17. if ($users)
  18. {
  19. foreach ($users as $parsed_user)
  20. {
  21. $item = $userTools->getUser($parsed_user['username']);
  22. ?>
  23. <div class="row">
  24. <div class="col-sm-12">
  25. <div class="row"><h3 class="text-center"><strong><?php echo $item->username; ?></strong></h3></div>
  26. <div class="row">
  27. <div class="col-sm-6">
  28. <ul class="list-group">
  29. <li class="list-group-item text-right"><span class="pull-left"><strong>Joined</strong></span> <?php echo $item->join_date; ?></li>
  30. <li class="list-group-item text-right"><span class="pull-left"><strong>Last Seen</strong></span> <?php echo $item->last_seen; ?></li>
  31. <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>
  32. <?php if ($item->blog_title) { ?>
  33. <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>
  34. <?php } ?>
  35. <?php if ($item->website) { ?>
  36. <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>
  37. <?php } ?>
  38. <?php if ($item->quote) { ?>
  39. <li class="list-group-item text-right"><span class="pull-left"><strong>Quote</strong></span> <?php echo $item->quote; ?></li>
  40. <?php } ?>
  41. <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>
  42. </ul>
  43. </div>
  44. <div class="col-sm-6">
  45. <div class="row">
  46. <h4>Roles</h4>
  47. <?php
  48. foreach ($item->roles as $role_name => $perm)
  49. {
  50. $role = Role::getRole($db, $role_name);
  51. ?>
  52. <div class="form-group">
  53. <label class="col-sm-8 control-label" for="<?php echo $item->id; ?>_<?php echo $role['role_id']; ?>"><?php echo $role['role_name']; ?></label>
  54. <div class="col-sm-4">
  55. <button type="button" class="btn btn-danger btn-sm remove_user_role" id="<?php echo $item->id; ?>_<?php echo $role['role_id']; ?>">Remove</button>
  56. </div>
  57. </div>
  58. <?php
  59. }
  60. ?>
  61. </div>
  62. <br />
  63. <div class="row">
  64. <div class="col-sm-10">
  65. <select class="selectpicker" name="role_select_<?php echo $item->id; ?>" id="role_select_<?php echo $item->id; ?>">
  66. <?php
  67. $roles = Role::getRoles($db);
  68. foreach ($roles as $role)
  69. {
  70. echo "<option value=\"".$role['role_id']."\">".$role['role_name']."</option>";
  71. }
  72. ?>
  73. </select>
  74. </div>
  75. <div class="col-sm-2">
  76. <button type="button" class="btn btn-default add_user_role" id="<?php echo $item->id; ?>">Add Role</button>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <hr />
  84. <?php
  85. }
  86. }
  87. }
  88. ?>