account.global.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. global $myUser, $myFirm;
  3. if (!$myUser->connected()) throw new Exception("Vous devez être connecté pour accéder à la page");
  4. ?>
  5. <div id="user-form" class="user-form">
  6. <br>
  7. <h3><?php echo $myUser->fullName(); ?> <small class="text-muted">(<?php echo $myUser->login; ?>)</small></h3>
  8. <hr>
  9. <div class="row">
  10. <div class="col-md-6">
  11. <label for="avatar">Photo :</label><br/>
  12. <input id="avatar" data-type="image" name="avatar" class="form-control-file" value="<?php echo $myUser->getAvatar(); ?>" type="file" data-delete="account_avatar_delete(this)" data-default-src="img/default-avatar.png">
  13. </div>
  14. <div class="col-md-6">
  15. <div class="user-ranks">
  16. <label for="rank">Rangs :</label><br>
  17. <small class="text-muted">
  18. <?php
  19. $ranks = array();
  20. if($myUser->superadmin == 1) {
  21. $ranks = array('Super Admin');
  22. } else {
  23. foreach($myUser->ranks[$myFirm->id] as $rank)
  24. $ranks[] = $rank->label;
  25. }
  26. foreach ($ranks as $i=>$rank): ?>
  27. <span class="badge badge-<?php echo $i%2==0 ? 'dark':'secondary'; ?>"><?php echo $rank; ?></span>
  28. <?php endforeach; ?>
  29. </small>
  30. </div>
  31. </div>
  32. </div><br/>
  33. <div class="row">
  34. <div class="col-md-6">
  35. <label for="login">Identifiant :</label>
  36. <input required id="login" name="login" class="form-control" readonly="readonly" placeholder="Identifiant" value="<?php echo $myUser->login; ?>" type="text">
  37. </div>
  38. <div class="col-md-6">
  39. <label for="mail">Mail :</label>
  40. <input required id="mail" name="mail" class="form-control" placeholder="Mail" type="text" value="<?php echo $myUser->mail; ?>">
  41. </div>
  42. </div><br/>
  43. <div class="row">
  44. <div class="col-md-6">
  45. <label for="password">Mot de passe :</label>
  46. <input required id="password" data-show-strength data-generator data-type="password" name="password" class="form-control" placeholder="Mot de passe" type="password">
  47. </div>
  48. <div class="col-md-6">
  49. <label for="password2">Mot de passe (confirmation) :</label>
  50. <input required id="password2" data-type="password" name="password2" class="form-control" placeholder="Mot de passe (confirmation)" type="password">
  51. </div>
  52. </div><br>
  53. <div class="row">
  54. <div class="col-md-3">
  55. <label for="firstname">Prénom :</label>
  56. <input id="firstname" name="firstname" class="form-control" placeholder="Prénom" type="text" value="<?php echo $myUser->firstname; ?>">
  57. </div>
  58. <div class="col-md-3">
  59. <label for="name">Nom :</label>
  60. <input id="name" name="name" class="form-control" placeholder="Nom" type="text" value="<?php echo $myUser->name; ?>">
  61. </div>
  62. <div class="col-md-6">
  63. <label for="function">Fonction :</label>
  64. <input id="function" name="function" class="form-control" placeholder="ex: Responsable RH" type="text" value="<?php echo $myUser->function; ?>">
  65. </div>
  66. </div><br>
  67. <div class="row">
  68. <div class="col-md-6">
  69. <label for="phone">Téléphone fixe :</label>
  70. <input id="phone" name="phone" class="form-control" placeholder="N° Téléphone fixe" type="text" value="<?php echo $myUser->phone; ?>">
  71. </div><div class="col-md-6">
  72. <label for="mobile">Téléphone mobile :</label>
  73. <input id="mobile" name="mobile" class="form-control" placeholder="N° Téléphone mobile" type="text" value="<?php echo $myUser->mobile; ?>">
  74. </div>
  75. </div><br>
  76. <div class="row mb-2">
  77. <div class="col-md-6">
  78. <label for="">Compte créé le :</label>
  79. <input class="form-control-plaintext" readonly="readonly" type="text" value="<?php echo date('d/m/Y H:i', $myUser->created); ?>">
  80. </div>
  81. <div class="col-md-6">
  82. <label for="manager">Manager :</label>
  83. <input id="manager" name="manager" readonly="readonly" class="form-control-plaintext" placeholder="Nom de manager" type="text" value="<?php echo is_object($myUser->manager) ? $myUser->manager->fullName():' - '; ?>">
  84. </div>
  85. </div>
  86. <?php Plugin::callHook('account_global'); ?>
  87. <hr/>
  88. <div class="row mt-2 mb-2">
  89. <div class="col-md-12">
  90. <div onclick="account_save()" class="btn btn-success right"><i class="fas fa-check"></i> Enregistrer</div>
  91. </div>
  92. </div>
  93. </div>