Guest User

Untitled

a guest
Dec 20th, 2017
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html lang="es">
  2. <head>
  3. <meta charset="utf-8" />
  4. <title><?php echo $CRTitle; ?>Usuarios</title>
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta content="width=device-width, initial-scale=1" name="viewport" />
  7. <meta name="description" content="<?php echo $CRDescription; ?>" />
  8. <meta name="author" content="<?php echo $CRAuthor; ?>" />
  9. <?php get_HeadFiles("../"); ?>
  10. <link href="<?php echo $CRDomain; ?>assets/plugins/datatables/datatables.min.css" rel="stylesheet" type="text/css" />
  11. <link href="<?php echo $CRDomain; ?>assets/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css" rel="stylesheet" type="text/css" />
  12. <script src="<?php echo $CRDomain; ?>assets/plugins/datatables/datatables.min.js" type="text/javascript"></script>
  13. <script src="<?php echo $CRDomain; ?>assets/plugins/datatables/buttons/js/dataTables.buttons.min.js" type="text/javascript"></script>
  14. <script src="<?php echo $CRDomain; ?>assets/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js" type="text/javascript"></script>
  15. <script src="<?php echo $CRDomain; ?>assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js" type="text/javascript"></script>
  16. <script src="<?php echo $CRDomain; ?>assets/js/ui-confirmations.min.js" type="text/javascript"></script>
  17. <script src="<?php echo $CRDomain; ?>assets/plugins/bootstrap-confirmation/bootstrap-confirmation.min.js" type="text/javascript"></script>
  18.  
  19. </head>
  20. <body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white">
  21. <div class="page-wrapper">
  22. <?php get_Header("../"); ?>
  23. <div class="clearfix"> </div>
  24. <div class="page-container">
  25. <?php get_Nav("../"); ?>
  26. <div class="page-content-wrapper">
  27. <div class="page-content">
  28. <div class="page-bar">
  29. <ul class="page-breadcrumb">
  30. <li> <a href="<?php echo $CRDomain; ?>dashboard">Inicio</a> <i class="fa fa-circle"></i> </li>
  31. <li> <span>Usuarios</span> </li>
  32. </ul>
  33. </div>
  34. <h1 class="page-title"> Administración de Usuarios <small>CBS, The British School of Seville</small></h1>
  35. <?php if (isset($error)): ?>
  36. <?php if ($error == "001"): ?>
  37. <script type="text/javascript"> swal('Error','Por favor, rellene todos los campos.','warning'); </script>
  38. <?php elseif ($error == "002"): ?>
  39. <script type="text/javascript"> swal('Error','Los emails introducidos no coinciden.','warning'); </script>
  40. <?php elseif ($error == "003"): ?>
  41. <script type="text/javascript"> swal('Error','Las contraseñas introducidas no coinciden.','warning'); </script>
  42. <?php elseif ($error == "004"): ?>
  43. <script type="text/javascript"> swal('Error','Ha ocurrido un error al registrarse.','error'); </script>
  44. <?php endif; ?>
  45. <?php endif; ?>
  46. <?php if (isset($success)): ?>
  47. <?php if ($success == "001"): ?>
  48. <script type="text/javascript"> swal('Confirmación','Se ha creado el usuario correctamente.','success'); </script>
  49. <?php elseif ($success == "002"): ?>
  50. <script type="text/javascript"> swal('Confirmación','El usuario ha sido desactivado.','success'); </script>
  51. <?php elseif ($success == "003"): ?>
  52. <script type="text/javascript"> swal('Confirmación','El usuario ha sido activado.','success'); </script>
  53. <?php elseif ($success == "004"): ?>
  54. <script type="text/javascript"> swal('Confirmación','El usuario ha sido eliminado.','success'); </script>
  55. <?php endif; ?>
  56. <?php endif; ?>
  57. <div class="row">
  58. <div class="col-md-12">
  59. <!-- BEGIN Portlet PORTLET-->
  60. <div class="portlet light bordered">
  61. <div class="portlet-title" style="background-color: #3FD5C0; padding: 10px 20px;">
  62. <div class="caption font-white">
  63. <i class="fa fa-users font-white"></i>
  64. <span class="caption-subject bold uppercase">Administración de Usuarios</span>
  65. </div>
  66. <div class="tools" style="padding:0px;">
  67. <button type="button" class="btn white" data-toggle="modal" data-target="#add-usuario"><i class="fa fa-plus-circle" aria-hidden="true"></i> AÑADIR NUEVO USUARIO</button>
  68. </div>
  69. </div>
  70. <div class="portlet-body">
  71. <table class="table table-striped table-bordered table-hover" id="usuarios" data-order='[[ 0, "asc" ]]'>
  72. <script>
  73. $(document).ready(function() {
  74. $('#usuarios').DataTable();
  75. });
  76. function checkSubmit() {
  77. document.getElementById("btsubmit").value = "Enviando...";
  78. document.getElementById("btsubmit").disabled = true;
  79. return true;
  80. }
  81. </script>
  82. <thead>
  83. <tr>
  84. <th>ID</th>
  85. <th>Nombre</th>
  86. <th>Email</th>
  87. <th>Created</th>
  88. <th>Verificación</th>
  89. <th>Estado</th>
  90. <th>Acciones</th>
  91. </tr>
  92. </thead>
  93. <tbody id="tBody">
  94. <?php
  95. $query = $user->getUsers();
  96. foreach($query as $u) {
  97. ?>
  98. <tr>
  99. <td><?php echo $u['IDUser']; ?></td>
  100. <td><?php echo $u['Nombre'] ." ". $u['Apellidos']; ?></td>
  101. <td><?php echo $u['Email']; ?></td>
  102. <td><?php echo $u['Created']; ?></td>
  103. <td><?php
  104. if ($u['Activacion'] == 1) {
  105. ?> <span class="labelon"><i class="fa fa-toggle-on" aria-hidden="true"></i> Activado</span> <?php
  106. } else {
  107. ?> <span class="labeloff"><i class="fa fa-toggle-off" aria-hidden="true"></i> Inactivo</span> <?php
  108. }
  109.  
  110. ?></td>
  111. <td><?php
  112. if ($u['Online'] == "1") {
  113. ?> <span class="labelon">Online</span> <?php
  114. } else {
  115. ?> <span class="labeloff">Offline</span> <?php
  116. }
  117.  
  118. ?></td>
  119. <td>
  120. <div class="btn-group">
  121. <button type="button" class="btn green-jungle dropdown-toggle btn-xs">Acciones</button>
  122. <button type="button" class="btn green-jungle dropdown-toggle btn-xs" data-toggle="dropdown">
  123. <i class="fa fa-angle-down"></i>
  124. </button>
  125. <ul class="dropdown-menu" role="menu">
  126. <li>
  127. <a href="<?php echo $CRDomain; ?>profile?user=<?php echo $u['IDUser']; ?>"><i class="fa fa-eye" aria-hidden="true"></i> Ver Perfil </a>
  128. </li>
  129. <li>
  130. <?php if($u['Activacion'] == 1): ?>
  131. <a href="../assets/controllers/users.php?action=desactivaruser&userid=<?php echo $u['IDUser']; ?>"><i class="fa fa-toggle-off" aria-hidden="true"></i> Desactivar </a>
  132. <?php elseif($u['Activacion'] == 0): ?>
  133. <a href="../assets/controllers/users.php?action=activaruser&userid=<?php echo $u['IDUser']; ?>"><i class="fa fa-toggle-on" aria-hidden="true"></i> Activar </a>
  134. <?php endif; ?>
  135. </li>
  136. <li>
  137. <a href="javascript:;"><i class="fa fa-pencil" aria-hidden="true"></i> Editar </a>
  138. </li>
  139. <li>
  140. <a id="confirmBTN" href="../assets/controllers/users.php?action=eliminaruser&userid=<?php echo $u['IDUser']; ?>"><i class="fa fa-trash" aria-hidden="true"></i> Eliminar </a>
  141. </li>
  142. <li class="dropdown-header">Permisos</li>
  143. <li>
  144. <a href="javascript:;"><i class="fa fa-eye" aria-hidden="true"></i> Ver o Editar </a>
  145. </li>
  146. </ul>
  147. </div>
  148. </td>
  149. </tr>
  150. <?php
  151. }
  152. ?>
  153. </tbody>
  154. </table>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" id="add-usuario">
  160. <div class="modal-dialog modal-lg" role="document">
  161. <div class="modal-content">
  162. <div class="modal-header">
  163. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  164. <h4 class="modal-title"><i class="fa fa-plus-circle" aria-hidden="true"></i> Añadir Usuario</h4>
  165. </div>
  166. <div class="modal-body">
  167. <div class="form solicitud_info">
  168. <form name="adduser" method="post" id="add-usuario" autocomplete="off" onSubmit="return checkSubmit();" action="../assets/controllers/users.php">
  169. <input type="hidden" name="action" value="adduser"/>
  170. <input type="hidden" name="return" value="<?php echo $CRDomain; ?>administracion/usuarios"/>
  171. <div class="title" style="margin-top:15px;margin-bottom: 15px;">
  172. <p>Datos del Usuario</p>
  173. </div>
  174. <div class="row">
  175. <div class="col-md-6">
  176. <div class="form-group">
  177. <label>Nombre:</label>
  178. <div class="input-group">
  179. <div class="input-group-addon"><i class="fa fa-user" aria-hidden="true"></i></div>
  180. <input type="text" class="form-control" name="nombre" placeholder="Nombre" required>
  181. </div>
  182. </div>
  183. </div>
  184. <div class="col-md-6">
  185. <div class="form-group">
  186. <label>Apellidos:</label>
  187. <div class="input-group">
  188. <div class="input-group-addon"><i class="fa fa-user" aria-hidden="true"></i></div>
  189. <input type="text" class="form-control" name="apellidos" placeholder="Apellidos" required>
  190. </div>
  191. </div>
  192. </div>
  193. <div class="col-md-6">
  194. <div class="form-group">
  195. <label>Email:</label>
  196. <div class="input-group">
  197. <div class="input-group-addon"><i class="fa fa-envelope" aria-hidden="true"></i></div>
  198. <input type="email" class="form-control" name="email" placeholder="Email">
  199. </div>
  200. </div>
  201. </div>
  202. <div class="col-md-6">
  203. <div class="form-group">
  204. <label>Repita su Email:</label>
  205. <div class="input-group">
  206. <div class="input-group-addon"><i class="fa fa-envelope" aria-hidden="true"></i></div>
  207. <input type="email" class="form-control" name="emailcheck" placeholder="Repita su email">
  208. </div>
  209. </div>
  210. </div>
  211. <div class="col-md-6">
  212. <div class="form-group">
  213. <label>Contraseña:</label>
  214. <div class="input-group">
  215. <div class="input-group-addon"><i class="fa fa-lock" aria-hidden="true"></i></div>
  216. <input type="password" class="form-control" name="password" placeholder="Contraseña">
  217. </div>
  218. </div>
  219. </div>
  220. <div class="col-md-6">
  221. <div class="form-group">
  222. <label>Repita su contraseña:</label>
  223. <div class="input-group">
  224. <div class="input-group-addon"><i class="fa fa-lock" aria-hidden="true"></i></div>
  225. <input type="password" class="form-control" name="passwordcheck" placeholder="Repita su contraseña">
  226. </div>
  227. </div>
  228. </div>
  229. <div class="col-md-6">
  230. <div class="form-group">
  231. <label>Genero</label>
  232. <div class="mt-radio-inline">
  233. <label class="mt-radio">
  234. <input type="radio" name="genero" value="Masculino" required> Masculino
  235. <span></span>
  236. </label>
  237. <label class="mt-radio">
  238. <input type="radio" name="genero" value="Femenino" required> Femenino
  239. <span></span>
  240. </label>
  241. </div>
  242. </div>
  243. </div>
  244. <div class="col-md-6">
  245. <div class="form-group">
  246. <label>Activación del Usuario</label>
  247. <div class="mt-radio-inline">
  248. <label class="mt-radio">
  249. <input type="radio" name="activacion" value="1" required> Activado
  250. <span></span>
  251. </label>
  252. <label class="mt-radio">
  253. <input type="radio" name="activacion" value="0" required> Desactivado
  254. <span></span>
  255. </label>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. </div>
  262. <div class="modal-footer">
  263. <button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
  264. <button type="submit" class="btn btn-info" id="btsubmit">Añadir Usuario</button>
  265. </form>
  266. </div>
  267. </div>
  268. </div>
  269. </div>
  270. </div>
  271. </div>
  272. <?php get_Footer("../"); ?>
  273. </div>
  274. </div>
  275. <script type="text/javascript">
  276. $("#confirmBTN").click(function(e) {
  277. e.preventDefault();
  278. var linkURL = $(this).attr("href");
  279. warnBeforeRedirect(linkURL);
  280. });
  281.  
  282. function warnBeforeRedirect(linkURL) {
  283. swal({
  284. title: "¿Estas segur<?php get_Genero($_SESSION['CBSGenero']); ?>?",
  285. text: "Una vez borrado el usuario, no podrá ser recuperado.",
  286. type: "warning",
  287. showCancelButton: true,
  288. }).then(function(result) {
  289. console.log(result);
  290. if (result.value) {
  291. window.location.href = linkURL;
  292. }
  293. });
  294. }
  295. </script>
  296. </body>
  297. </html>
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×