PageRenderTime 46ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/day34_final_project/Final_Project/Group-3_Tonmoy/Bitm-Course-Manager-master-tonmoy/Views/user/user_view.php

https://gitlab.com/redwan4re/web-apps-php-26
PHP | 267 lines | 227 code | 40 blank | 0 comment | 11 complexity | 8597b5336cd865a67386e5408aad681f MD5 | raw file
  1. <?php
  2. include '../../vendor/autoload.php';
  3. use BitmCourseApp\user\user_login\UserLogin;
  4. $objlogin = new UserLogin();
  5. $objlogin->checkLogin();
  6. $objlogin->prepare($_GET);
  7. $all_user_data = $objlogin->userData();
  8. ?>
  9. <!DOCTYPE html>
  10. <html lang="en">
  11. <head>
  12. <meta charset="utf-8">
  13. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  14. <meta name="viewport" content="width=device-width, initial-scale=1">
  15. <title>BITM Course Manager</title>
  16. <!-- Global stylesheets -->
  17. <link href="https://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900" rel="stylesheet" type="text/css">
  18. <link rel="shortcut icon" type="image/png" href="../elements/bitm-icon.png"/>
  19. <link href="../assets/css/icons/icomoon/styles.css" rel="stylesheet" type="text/css">
  20. <link href="../assets/css/minified/bootstrap.min.css" rel="stylesheet" type="text/css">
  21. <link href="../assets/css/minified/core.min.css" rel="stylesheet" type="text/css">
  22. <link href="../assets/css/minified/components.min.css" rel="stylesheet" type="text/css">
  23. <link href="../assets/css/minified/colors.min.css" rel="stylesheet" type="text/css">
  24. <!-- /global stylesheets -->
  25. <!-- Core JS files -->
  26. <script type="text/javascript" src="../assets/js/plugins/loaders/pace.min.js"></script>
  27. <script type="text/javascript" src="../assets/js/core/libraries/jquery.min.js"></script>
  28. <script type="text/javascript" src="../assets/js/core/libraries/bootstrap.min.js"></script>
  29. <script type="text/javascript" src="../assets/js/plugins/loaders/blockui.min.js"></script>
  30. <!-- /core JS files -->
  31. <!-- Theme JS files -->
  32. <script type="text/javascript" src="../assets/js/plugins/visualization/d3/d3.min.js"></script>
  33. <script type="text/javascript" src="../assets/js/plugins/visualization/d3/d3_tooltip.js"></script>
  34. <script type="text/javascript" src="../assets/js/plugins/forms/styling/switchery.min.js"></script>
  35. <script type="text/javascript" src="../assets/js/plugins/forms/styling/uniform.min.js"></script>
  36. <script type="text/javascript" src="../assets/js/plugins/forms/selects/bootstrap_multiselect.js"></script>
  37. <script type="text/javascript" src="../assets/js/plugins/ui/moment/moment.min.js"></script>
  38. <script type="text/javascript" src="../assets/js/plugins/pickers/daterangepicker.js"></script>
  39. <script type="text/javascript" src="../assets/js/plugins/forms/selects/select2.min.js"></script>
  40. <script type="text/javascript" src="../assets/js/pages/form_layouts.js"></script>
  41. <script type="text/javascript" src="../assets/js/core/app.js"></script>
  42. <script type="text/javascript" src="../assets/js/pages/dashboard.js"></script>
  43. <!-- /theme JS files -->
  44. </head>
  45. <body>
  46. <!-- Main navbar -->
  47. <div class="navbar navbar-inverse">
  48. <div class="navbar-header">
  49. <a class="navbar-brand" href="index.html"><img src="../assets/images/logo_light.png" alt=""></a>
  50. <ul class="nav navbar-nav visible-xs-block">
  51. <li><a data-toggle="collapse" data-target="#navbar-mobile"><i class="icon-tree5"></i></a></li>
  52. <li><a class="sidebar-mobile-main-toggle"><i class="icon-paragraph-justify3"></i></a></li>
  53. </ul>
  54. </div>
  55. <div class="navbar-collapse collapse" id="navbar-mobile">
  56. <ul class="nav navbar-nav">
  57. <li><a class="sidebar-control sidebar-main-toggle hidden-xs"><i class="icon-paragraph-justify3"></i></a></li>
  58. </ul>
  59. <ul class="nav navbar-nav navbar-right">
  60. <li class="dropdown dropdown-user">
  61. <a class="dropdown-toggle" data-toggle="dropdown">
  62. <img src="../elements/user_images/<?php echo $_SESSION['login_confirm']['image']; ?>" width="28" height="28" alt="">
  63. <span><?php echo $_SESSION['login_confirm']['username']; ?></span>
  64. <i class="caret"></i>
  65. </a>
  66. <ul class="dropdown-menu dropdown-menu-right">
  67. <li><a href="user_view_single.php?id=<?php echo $_SESSION['login_confirm']['id']; ?>"><i class="icon-user-plus"></i> My profile</a></li>
  68. <li class="divider"></li>
  69. <li><a href="#"><i class="icon-cog5"></i> Account settings</a></li>
  70. <li><a href="../logout.php"><i class="icon-switch2"></i> Logout</a></li>
  71. </ul>
  72. </li>
  73. </ul>
  74. </div>
  75. </div>
  76. <!-- /main navbar -->
  77. <!-- Page container -->
  78. <div class="page-container">
  79. <!-- Page content -->
  80. <div class="page-content">
  81. <!-- Main sidebar -->
  82. <div class="sidebar sidebar-main">
  83. <div class="sidebar-content">
  84. <!-- User menu -->
  85. <div class="sidebar-user">
  86. <div class="category-content">
  87. <div class="media">
  88. <a href="#" class="media-left"><img src="../elements/user_images/<?php echo $_SESSION['login_confirm']['image']; ?>" class="img-circle img-sm" alt=""></a>
  89. <div class="media-body">
  90. <span class="media-heading text-semibold"><?php echo $_SESSION['login_confirm']['full_name']; ?></span>
  91. <div class="text-size-mini text-muted">
  92. </div>
  93. </div>
  94. <div class="media-right media-middle">
  95. <ul class="icons-list">
  96. <li>
  97. <a href="#"><i class="icon-cog3"></i></a>
  98. </li>
  99. </ul>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. <!-- /user menu -->
  105. <!-- Main navigation -->
  106. <div class="sidebar-category sidebar-category-visible">
  107. <div class="category-content no-padding">
  108. <ul class="navigation navigation-main navigation-accordion">
  109. <!-- Main -->
  110. <li class="navigation-header"><span>Main</span> <i class="icon-menu" title="Main pages"></i></li>
  111. <li><a href="../dashboard.php"><i class="icon-home4"></i> <span>Dashboard</span></a></li>
  112. <li class="active"><a href="user_manager.php"><i class="icon-user"></i> <span>User Menu</span></a></li>
  113. <li><a href="#"><i class="icon-people"></i> <span>Trainer</span></a></li>
  114. <li><a href="#"><i class="icon-book"></i> <span>Course</span></a></li>
  115. <li><a href="../lab_info/lab_info.php"><i class="icon-lan"></i> <span>Lab Info</span></a></li>
  116. <li><a href="#"><i class="icon-laptop"></i> <span>Software Management</span></a></li>
  117. <li><a href="../assign_course/assign_course.php"><i class="icon-list-unordered"></i> <span>Assign Course</span></a></li>
  118. <li><a href="../about_project.php"><i class="icon-primitive-square"></i> <span>About Project</span></a></li>
  119. </ul>
  120. </div>
  121. </div>
  122. <!-- /main navigation -->
  123. </div>
  124. </div>
  125. <!-- /main sidebar -->
  126. <!-- Main content -->
  127. <div class="content-wrapper">
  128. <!-- Page header -->
  129. <div class="page-header">
  130. <div class="page-header-content">
  131. <div class="page-title">
  132. <h4><i class="icon-arrow-left52 position-left"></i> <span class="text-semibold">Home</span> - User Menu</h4>
  133. </div>
  134. </div>
  135. <div class="breadcrumb-line">
  136. <ul class="breadcrumb">
  137. <li><a href="index.html"><i class="icon-home2 position-left"></i> Home</a></li>
  138. <li class="active">View User</li>
  139. </ul>
  140. </div>
  141. </div>
  142. <!-- /page header -->
  143. <!-- Content area -->
  144. <div class="content">
  145. <!-- Dashboard content -->
  146. <div class="panel panel-flat">
  147. <div class="panel-heading">
  148. <h5 class="panel-title">View User</h5>
  149. </div>
  150. <div class="panel-body">
  151. <a href="add_user.php"><button type="button" class="btn btn-primary">Add New User</button></a>&nbsp;&nbsp;&nbsp;
  152. <a href="user_view.php?viewBy=active"><button type="button" class="btn btn-primary">View User</button></a>&nbsp;&nbsp;&nbsp;
  153. <a href="user_view.php?viewBy=deleted"><button type="button" class="btn btn-primary">Deleted</button></a>
  154. </div>
  155. <div class="panel-heading">
  156. <h5 class="panel-title">
  157. <?php
  158. if (isset($_GET['viewBy']) && $_GET['viewBy']=='active') {
  159. echo 'All User';
  160. } else {
  161. echo 'Deleted User';
  162. }
  163. ?>
  164. </h5>
  165. </div>
  166. <?php if (isset($all_user_data) && !empty($all_user_data)) { ?>
  167. <div class="table-responsive">
  168. <table class="table table-hover">
  169. <thead>
  170. <tr>
  171. <th>User Photo</th>
  172. <th>Name</th>
  173. <th>Username</th>
  174. <th>Password</th>
  175. <th>Email</th>
  176. <th>User Type</th>
  177. <th>Action</th>
  178. </tr>
  179. </thead>
  180. <tbody>
  181. <?php foreach ($all_user_data as $user_data) { ?>
  182. <tr>
  183. <td><img src="../elements/user_images/<?php echo $user_data['image'];?>" width="150"></td>
  184. <td><?php echo $user_data['full_name'];?></td>
  185. <td><?php echo $user_data['username'];?></td>
  186. <td><button onclick="this.innerHTML='<?php echo $user_data['password'];?>'">Show Password</button></td>
  187. <td><?php echo $user_data['email'];?></td>
  188. <td><?php if ($user_data['is_admin'] ==1) { echo 'Admin';} else {echo 'User';}?></td>
  189. <td>
  190. <ul class="icons-list">
  191. <?php
  192. if (isset($_GET['viewBy']) && $_GET['viewBy']=='active') { ?>
  193. <li><a href="user_view_single.php?id=<?php echo $user_data['id'];?>"><i class="icon-folder-open"></i></a></li>
  194. <li><a href="user_edit.php?id=<?php echo $user_data['id'];?>"><i class="icon-pencil7"></i></a></li>
  195. <li><a href="delete_user.php?viewBy=<?php echo $_GET['viewBy'];?>&id=<?php echo $user_data['id'];?>" onclick="return confirm('Delete Confirmation');" ><i class="icon-trash" title="Remove"></i></a></li>
  196. <?php }
  197. else { ?>
  198. <li><a href="user_view_single.php?id=<?php echo $user_data['id'];?>"><i class="icon-folder-open"></i></a></li>
  199. <li><a href="delete_user.php?action=restore&viewBy=active&id=<?php echo $user_data['id'];?>"><i class="icon-reset" title="Remove"></i></a></li>
  200. <?php } ?>
  201. </ul>
  202. </td>
  203. </tr>
  204. <?php } ?>
  205. </tbody>
  206. </table>
  207. </div>
  208. <?php } else { ?>
  209. <h5 class="panel-title">No Data Available</h5>
  210. <?php } ?>
  211. </div>
  212. <!-- /dashboard content -->
  213. <!-- Footer -->
  214. <div class="footer text-muted">
  215. &copy; 2016. <a href="#">BASIS Institute of Technology & Management</a> Website<a href="http://www.bitm.org.bd/" target="_blank">BITM.COM</a>
  216. </div>
  217. <!-- /footer -->
  218. </div>
  219. <!-- /content area -->
  220. </div>
  221. <!-- /main content -->
  222. </div>
  223. <!-- /page content -->
  224. </div>
  225. <!-- /page container -->
  226. </body>
  227. </html>