PageRenderTime 40ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 1ms

/mgmt/admin/emsuser.php

https://gitlab.com/msdusad/all_ones
PHP | 92 lines | 83 code | 9 blank | 0 comment | 2 complexity | 45d79c0e85c52755f88c32f098387f16 MD5 | raw file
  1. <?php session_start();
  2. if(!isset($_SESSION['username']))
  3. {
  4. header("location:index.php");
  5. }
  6. include("conn.php");
  7. ?>
  8. <?php
  9. if(isset($_GET['did']))
  10. {
  11. $del=mysql_query("delete from users where username='".$_GET['did']."'")or die(mysql_error());
  12. $delet=mysql_query("delete from emsuser where username='".$_GET['did']."'")or die(mysql_error());
  13. echo'<script>alert("Employee Has been Deleted!");</script>';
  14. echo'<script>window.location="emsuser.php";</script>';
  15. }
  16. ?>
  17. <?php include("header.php");?>
  18. <div style="clear:both;"></div>
  19. <div class="rightpanel" style="clear:both;">
  20. <div class="headerpanel">
  21. <a href="#" class="showmenu"></a>
  22. <div class="headerright">
  23. <div class="dropdown notification">
  24. </div><!--dropdown-->
  25. <div class="dropdown userinfo">
  26. <a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="#">
  27. Welcome <b><?php echo $_SESSION['username']?></b>
  28. <b class="caret"></b></a>
  29. <ul class="dropdown-menu">
  30. <!--<li><a href="editprofile.html"><span class="icon-edit"></span> Edit Profile</a></li>
  31. <li><a href="#"><span class="icon-wrench"></span> Account Settings</a></li>
  32. <li><a href="#"><span class="icon-eye-open"></span> Privacy Settings</a></li>
  33. <li class="divider"></li>-->
  34. <li><a href="sign_out.php"><span class="icon-off"></span> Sign Out</a></li>
  35. </ul>
  36. </div><!--dropdown-->
  37. </div><!--headerright-->
  38. </div><!--headerpanel-->
  39. <div class="breadcrumbwidget">
  40. </div><!--breadcrumbs-->
  41. <div class="pagetitle">
  42. <h1>Employee's List</h1>
  43. <a href="addemsuser.php" ><button style="float:right;background:#0b4073;color:#fff;">Add Users</button></a>
  44. </div><!--pagetitle-->
  45. <div style="margin:50px;color:#990000; margin-top:10px">
  46. <form action="" method="post">
  47. <table class="table table-bordered" style="text-align:center;">
  48. <thead>
  49. <th>S. No.</th>
  50. <th>Employee Name</th>
  51. <th>Password</th>
  52. <th>Delete</th>
  53. </thead>
  54. <?php
  55. $qry=mysql_query("select * from emsuser")or die(mysql_error());
  56. $i=1;
  57. while($fetch=mysql_fetch_array($qry)){
  58. ?>
  59. <tr>
  60. <td><a href="show_users.php?sid=<?= $fetch['id'];?>"><?php echo $i;?></a></td>
  61. <td><?php echo $fetch['username'];?></td>
  62. <td><?php echo $fetch['password'];?></td>
  63. <td><a href="emsuser.php?did=<?= $fetch['username'];?>"><img src="img/DeleteRed.png" alt="" width="20" height="20"></a></td>
  64. <?php $i++; } ?>
  65. </tr>
  66. </table>
  67. </form>
  68. </div>
  69. </div>
  70. <div class="clearfix"></div>
  71. <!--footer-->
  72. </div><!--mainwrapper-->
  73. </body>
  74. </html>