Guest User

Untitled

a guest
Jun 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if( !isset($_SESSION['webmaster_logged']) ){
  4. header('Location: login.php');
  5. }
  6. include('../includes/configuration.php');
  7. include('../includes/system-logs.php');
  8.  
  9. $connection = mysql_connect($db_host,$db_username,$db_password);
  10. mysql_select_db($db_scheme);
  11.  
  12. $query = "select user_id, user_name, user_lastname, user_email, user_level from wm_user order by user_lastname asc";
  13. $result = mysql_query($query,$connection);
  14. $num_rows = mysql_num_rows($result);
  15.  
  16. if($num_rows > 0){
  17. ?>
  18.  
  19. <table width="870" border="0" cellpadding="5" cellspacing="0" id="user_list_table" class="tablesorter">
  20. <thead>
  21. <tr>
  22. <th width="24" scope="col">&nbsp;</th>
  23. <th width="24" scope="col">&nbsp;</th>
  24. <th scope="col">Nombre</th>
  25. <th scope="col">Apellido</th>
  26. <th width="200" scope="col">Correo electr&oacute;nico</th>
  27. <th width="120" scope="col">Rol</th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. <?php
  32. while( $row = mysql_fetch_array($result) ){
  33. ?>
  34. <tr class="item_list">
  35. <td width="24"><input type="checkbox" name="user<?php echo $row['user_id']; ?>" id="user<?php echo $row['user_id']; ?>" value="<?php echo $row['user_id']; ?>" /></td>
  36. <td width="24"><a href="#" onclick="javascript:user_edit(<?php echo $row['user_id']; ?>)"><img src="img/icon-edit.gif" width="16" height="16" /></a></td>
  37. <td><?php echo $row['user_name']; ?></td>
  38. <td><?php echo $row['user_lastname']; ?></td>
  39. <td width="200"><?php echo $row['user_email']; ?></td>
  40. <td width="120"><?php
  41. switch($row['user_level']){
  42. case '0':
  43. echo 'Administrador';
  44. break;
  45. case '1':
  46. echo 'Ventas';
  47. break;
  48. case '2':
  49. echo 'Comunicaciones';
  50. break;
  51. }
  52. ?></td>
  53. </tr>
  54. <?php
  55. }
  56. ?>
  57. </tbody>
  58. </table>
  59. <?php
  60. }
  61. mysql_close($connection);
  62. ?>
Add Comment
Please, Sign In to add comment