setting.userfirmrank.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. global $myUser;
  3. User::check_access('user','configure');
  4. //Refresh forcé des users pour avoir leurs établissements et rangs
  5. $users = User::getAll(true, true);
  6. ?>
  7. <div class="row">
  8. <div class="col-md-12">
  9. <br>
  10. <h3>Établissement / Utilisateur / Rang</h3>
  11. <hr/>
  12. <div id="userfirmrankForm" data-action="save_userfirmrank">
  13. <div class="form-row">
  14. <div class="form-group col-md-3">
  15. <label for="firm">Établissement :</label>
  16. <select class="form-control" id="firm" placeholder="Etablissement" onchange="search_userfirmrank();" required>
  17. <option value="0">Tous</option>
  18. <?php foreach (Firm::loadAll() as $firm) : ?>
  19. <option value="<?php echo $firm->id; ?>"><?php echo $firm->label; ?></option>
  20. <?php endforeach; ?>
  21. </select>
  22. </div>
  23. <div class="form-group col-md-3">
  24. <label for="user">Utilisateur :</label>
  25. <input type="text" data-type="user" placeholder="Nom, prénom..." class="form-control" id="user" name="user" required/>
  26. </div>
  27. <div class="form-group col-md-3">
  28. <label for="rank">Rang :</label>
  29. <select class="form-control" id="rank" placeholder="Rang" required>
  30. <?php foreach(Rank::loadAll() as $rank): ?>
  31. <option value="<?php echo $rank->id; ?>"><?php echo $rank->label; ?></option>
  32. <?php endforeach; ?>
  33. </select>
  34. </div>
  35. <div class="form-group col-md-3 text-right">
  36. <div class="btn btn-success noLabel " onclick="save_userfirmrank(this)"><i class="fas fa-check"></i> Enregistrer</div>
  37. </div>
  38. </div>
  39. </div>
  40. <br/>
  41. <div class="panel panel-default">
  42. <legend class="panel-heading">Utilisateurs de l'établissement :</legend>
  43. <table id="userfirmranks" class="table table-striped">
  44. <thead>
  45. <tr>
  46. <th></th>
  47. <th>Nom</th>
  48. <th>Prénom</th>
  49. <th>Établissement</th>
  50. <th>Fonction</th>
  51. <th>Rang</th>
  52. <th class="text-right"></th>
  53. </tr>
  54. </thead>
  55. <tbody>
  56. <tr data-id="{{id}}" class="hidden">
  57. <td class="text-center">{{#avatar}}<img class="avatar-mini avatar-rounded" data-src="{{avatar}}"/>{{/avatar}}</td>
  58. <td>{{user.name}}</td>
  59. <td>{{user.firstname}}</td>
  60. <td>{{firm}}</td>
  61. <td>{{user.function}}</td>
  62. <td>{{rank}} {{#superadmin}}<span class="label label-info">Super Admin</span>{{/superadmin}}</td>
  63. <td class="text-right">
  64. <div onclick="edit_userfirmrank(this)" class="btn btn-info btn-squarred btn-mini"><i class="fas fa-pencil-alt"></i></div>
  65. <div onclick="delete_userfirmrank(this)" class="btn btn-danger btn-squarred btn-mini"><i class="fas fa-times"></i></div>
  66. </td>
  67. </tr>
  68. </tbody>
  69. </table>
  70. </div>
  71. </div>
  72. </div>