Guest User

Untitled

a guest
Nov 27th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | None | 0 0
  1. <h3 id = "UpdateEmpyeeCaption">Update Employee Table</h3>
  2. <table id = "UpdateEmployeeTable" >
  3.  
  4. <thead id ="UpdateTableHeadders" >
  5. <tr>
  6. <th class = "UpHeaderCell">EmployeeID </th>
  7. <th class = "UpHeaderCell">Firstname </th>
  8. <th class = "UpHeaderCell">Lastname </th>
  9. <th class = "UpHeaderCell">Username </th>
  10. <th class = "UpHeaderCell">Password </th>
  11. <th class = "UpHeaderCell">Lifeguard </th>
  12. <th class = "UpHeaderCell">Instructor </th>
  13. <th class = "UpHeaderCell">Headguard </th>
  14. <th class = "UpHeaderCell">Supervisor </th>
  15. </tr>
  16. </thead>
  17.  
  18.  
  19. <tbody id = "UpdateEmployeeTableinner">
  20.  
  21. </tbody>
  22.  
  23. </table>
  24.  
  25. function loadTable( employeelist )
  26. {
  27. var MSG = "";
  28. EmployeeList = employeelist;
  29.  
  30. for( var emp in employeelist )
  31. {
  32. var id = employeelist[emp]["employeeID"];
  33. var firstname = employeelist[emp]["Firstname"];
  34. var lastname = employeelist[emp]["Lastname"];
  35. var username = employeelist[emp]["Username"];
  36. var Password = employeelist[emp]["Password"];
  37. var lifeguard = "";
  38. if ( employeelist[emp]["Lifeguard"] == true ){ lifeguard = "Yes"; }else{ lifeguard = "no"; }
  39. var instructor = "";
  40. if ( employeelist[emp]["Instructor"] == true ){ instructor = "Yes"; }else{ instructor = "no"; }
  41. var headguard = "";
  42. if ( employeelist[emp]["Headguard"] == true ){ headguard = "Yes"; }else{ headguard = "no"; }
  43. var supervisor = "";
  44. if ( employeelist[emp]["Supervisor"] == true ){ supervisor = "Yes"; }else{ supervisor = "no"; }
  45.  
  46.  
  47. MSG += "<tr class = "UpdateEmployeeCell notHoverTable">";
  48. MSG += "<td class ="upEmCell"> "+id+" </td>";
  49. MSG += "<td class ="upEmCell"> "+firstname+" </td>";
  50. MSG += "<td class ="upEmCell"> "+lastname+" </td>";
  51. MSG += "<td class ="upEmCell"> "+username+" </td>";
  52. MSG += "<td class ="upEmCell"> "+Password+" </td>";
  53. MSG += "<td class ="upEmCell"> "+lifeguard+" </td>";
  54. MSG += "<td class ="upEmCell"> "+instructor+" </td>";
  55. MSG += "<td class ="upEmCell"> "+headguard+" </td>";
  56. MSG += "<td class ="upEmCell"> "+supervisor+" </td>";
  57. MSG += "</tr>";
  58. }//End of for each employee in employeelist
  59.  
  60. //Put the rows into tbody of the table.
  61. $('#UpdateEmployeeTableinner').empty();
  62. $('#UpdateEmployeeTableinner').append( MSG );
  63.  
  64. }/* End of Function loadTable */
  65.  
  66. /* Start of Update Employee Table*/
  67. /*table*/
  68. #UpdateEmployeeTable {
  69. border: 3px solid black;
  70. margin: 0;
  71. padding: 0 0 0 0;
  72. overflow:hidden;
  73. display: block;
  74. }
  75. /*thead*/
  76. #UpdateTableHeadders {
  77. background: rgb(221,221, 221);
  78. display: block;
  79. padding: 0em 1em 0em 1em;/* top right bottom left*/
  80. margin: 0; /*margin: <margin-top> || <margin-right> || <margin-bottom> || <margin-left>*/
  81. border-bottom: 3px solid black;
  82.  
  83. }
  84. /*th*/
  85. .UpHeaderCell {
  86. display: inline;
  87. border: 1px solid black;
  88. width: 11%;
  89. }
  90. /*tbody*/
  91. #UpdateEmployeeTableinner {
  92. border: 1px solid black;
  93. background: white;
  94. overflow: auto;
  95. height: 25vh;
  96. display: block;
  97. }
  98. /*tr inside tbody*/
  99. .UpdateEmployeeCell {
  100. border: 1px solid black;
  101. margin: 0.5em 0.2em 0.5em 0.2em ; /*top right bottom left*/
  102. display: block;
  103. overflow: hidden;
  104. padding: 0.1em;
  105. }
  106. /*td*/
  107. .upEmCell {
  108. display: inline-block;
  109. border: 1px solid black;
  110. }
  111. /*When a table row does not have mouse hover*/
  112. .notHoverTable {
  113. background-color: rgb(4,211,255);
  114. color: black;
  115. border: 2px solid black;
  116. }
  117. /*When a table row does have mouse hover*/
  118. .liOVERTable {
  119. background-color: rgb(5, 255, 12);
  120. border: 2px solid black;
  121. color: black;
  122. cursor: pointer;
  123. cursor: hand;
  124. }
  125. /* End of Update Employee Table*/
Add Comment
Please, Sign In to add comment