Advertisement
Guest User

Untitled

a guest
May 25th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.46 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5.  
  6. <meta charset="utf-8">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  8. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  9. <meta name="description" content="">
  10. <meta name="author" content="">
  11.  
  12. <title>SB Admin 2 - Dashboard</title>
  13.  
  14. <!-- Custom fonts for this template-->
  15. <link href="../vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
  16. <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
  17. rel="stylesheet">
  18.  
  19. <!-- Custom styles for this template-->
  20. <link href="../css/sb-admin-2.min.css" rel="stylesheet">
  21.  
  22. </head>
  23.  
  24. <body id="page-top">
  25.  
  26. <!-- Page Wrapper -->
  27. <div id="wrapper">
  28.  
  29. <!-- Sidebar -->
  30. <?php
  31. include_once "../components/navbars_side.php";
  32. ?>
  33. <!-- End of Sidebar -->
  34.  
  35. <!-- Content Wrapper -->
  36. <div id="content-wrapper" class="d-flex flex-column">
  37.  
  38. <!-- Main Content -->
  39. <div id="content">
  40.  
  41. <!-- Topbar -->
  42. <?php
  43. include_once "../components/navbars_top.php";
  44. ?>
  45. <!-- End of Topbar -->
  46.  
  47. <!-- Begin Page Content -->
  48. <div class="container-fluid">
  49.  
  50. <!-- Page Heading -->
  51. <div class="d-sm-flex align-items-center justify-content-between mb-4">
  52. <h1 class="h3 mb-0 text-gray-800">Gestão de utilizadores</h1>
  53. <a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i
  54. class="fas fa-download fa-sm text-white-50"></i> Generate Report</a>
  55. </div>
  56.  
  57. <!-- Content Row -->
  58. <div class="row">
  59.  
  60. <div class="col-lg-12">
  61. <div class="panel panel-default">
  62. <div class="panel-heading">
  63. Edição de utilizador
  64. </div>
  65. <!-- /.panel-heading -->
  66. <div class="panel-body">
  67.  
  68. <?php
  69.  
  70. if (isset($_GET["id"])) {
  71. $id_user = $_GET["id"];
  72.  
  73. // We need the function!
  74. require_once("../connections/connection.php");
  75.  
  76. // Create a new DB connection
  77. $link = new_db_connection();
  78. /* create a prepared statement */
  79. $stmt = mysqli_stmt_init($link);
  80.  
  81. $query = "SELECT id_users, email, username, date_creation, active, ref_id_roles, roles_descricao FROM users INNER JOIN roles ON users.ref_id_roles= roles.id_roles WHERE id_users = ?";
  82.  
  83. if (mysqli_stmt_prepare($stmt, $query)) {
  84.  
  85. mysqli_stmt_bind_param($stmt, 'i', $id_user);
  86.  
  87. /* execute the prepared statement */
  88. if (!mysqli_stmt_execute($stmt)){
  89. echo "erro;" . mysqli_stmt_error($stmt);
  90. }
  91.  
  92. /* bind result variables */
  93.  
  94. mysqli_stmt_bind_result($stmt, $id_users, $email, $username, $date_creation, $active, $id_role, $role);
  95.  
  96. /* fetch values */
  97. if (!mysqli_stmt_fetch($stmt)) {
  98. ("Location: users.php");
  99. echo "fuygiygiygiu";
  100. }
  101.  
  102. /* close statement */
  103. mysqli_stmt_close($stmt);
  104. } else {
  105. echo "Error: " . mysqli_error($link);
  106. }
  107.  
  108. /* close connection */
  109. mysqli_close($link);
  110.  
  111.  
  112. } else {
  113. header("Location: users.php");
  114. }
  115. ?>
  116.  
  117.  
  118.  
  119. <form role="form" method="post" action="../scripts/users_update.php">
  120. <input type="hidden" name="id_users" value="<?=$id_users?>">
  121. <div class="form-group">
  122. <label>ID do utilizador</label>
  123. <p class="form-control-static"><?=$id_users?></p>
  124. </div>
  125. <div class="form-group">
  126. <label>Data de criação</label>
  127. <p class="form-control-static"><?=$date_creation?></p>
  128. </div>
  129. <div class="form-group">
  130. <label>Username</label>
  131. <input class="form-control" name="username"
  132. value="<?=$username?>">
  133. </div>
  134. <div class="form-group">
  135. <label>Email</label>
  136. <input class="form-control" name="email" value="<?=$email?>">
  137. </div>
  138. <div class="form-group">
  139. <label>Estado</label>
  140. <div class="checkbox">
  141. <label>
  142. <input type="checkbox" name="active" value="<?=$active?>">Activo
  143. </label>
  144. </div>
  145. </div>
  146.  
  147. <div class="form-group">
  148. <label>Perfil</label>
  149. <select class="form-control" name="id_roles">
  150. <option value='<?=$id_role?>'><?=$role?></option>
  151. </select>
  152. </div>
  153. <button type="submit" class="btn btn-info">Submeter alterações
  154. </button>
  155. </form>
  156.  
  157. <!-- /.table-responsive -->
  158. </div>
  159. <!-- /.panel-body -->
  160. </div>
  161. <!-- /.panel -->
  162. </div>
  163.  
  164. </div>
  165.  
  166.  
  167. </div>
  168. <!-- /.container-fluid -->
  169.  
  170. </div>
  171. <!-- End of Main Content -->
  172.  
  173. <!-- Footer -->
  174. <footer class="sticky-footer bg-white">
  175. <div class="container my-auto">
  176. <div class="copyright text-center my-auto">
  177. <span>Copyright &copy; Your Website 2019</span>
  178. </div>
  179. </div>
  180. </footer>
  181. <!-- End of Footer -->
  182.  
  183. </div>
  184. <!-- End of Content Wrapper -->
  185.  
  186. </div>
  187. <!-- End of Page Wrapper -->
  188.  
  189. <!-- Scroll to Top Button-->
  190. <a class="scroll-to-top rounded" href="#page-top">
  191. <i class="fas fa-angle-up"></i>
  192. </a>
  193.  
  194.  
  195. <!-- Bootstrap core JavaScript-->
  196. <script src="../vendor/jquery/jquery.min.js"></script>
  197. <script src="../vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  198.  
  199. <!-- Core plugin JavaScript-->
  200. <script src="../vendor/jquery-easing/jquery.easing.min.js"></script>
  201.  
  202. <!-- Custom scripts for all pages-->
  203. <script src="../js/sb-admin-2.min.js"></script>
  204.  
  205. <!-- Page level plugins -->
  206. <script src="../vendor/chart.js/Chart.min.js"></script>
  207.  
  208. <!-- Page level custom scripts -->
  209. <script src="../js/demo/chart-area-demo.js"></script>
  210. <script src="../js/demo/chart-pie-demo.js"></script>
  211.  
  212. </body>
  213.  
  214. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement