Advertisement
Guest User

Untitled

a guest
Aug 9th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.91 KB | None | 0 0
  1. <script type="text/javascript">
  2. $(document).ready(function () {
  3. $(".search").keyup(function () {
  4. var searchTerm = $(".search").val();
  5. var listItem = $('.results tbody').children('tr');
  6. var searchSplit = searchTerm.replace(/ /g, "'):containsi('")
  7.  
  8. $.extend($.expr[':'], {
  9. 'containsi': function (elem, i, match, array) {
  10. return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
  11. }
  12. });
  13.  
  14. $(".results tbody tr").not(":containsi('" + searchSplit + "')").each(function (e) {
  15. $(this).attr('visible', 'false');
  16. });
  17.  
  18. $(".results tbody tr:containsi('" + searchSplit + "')").each(function (e) {
  19. $(this).attr('visible', 'true');
  20. });
  21.  
  22. var jobCount = $('.results tbody tr[visible="true"]').length;
  23. $('.counter').text(jobCount + ' item');
  24.  
  25. if (jobCount == '0') { $('.no-result').show(); }
  26. else { $('.no-result').hide(); }
  27.  
  28.  
  29. });
  30. });
  31. </script>
  32.  
  33. <table class="table table-hover table-bordered results" id="table">
  34. <thead>
  35. <tr>
  36. @*<th>#</th>
  37. <th class="col-md-5 col-xs-5">Name / Surname</th>
  38. <th class="col-md-4 col-xs-4">Job</th>
  39. <th class="col-md-3 col-xs-3">City</th>*@
  40. <th>&nbsp;</th>
  41. <th>Obj ID</th>
  42. <th>Obj</th>
  43. <th>Init ID</th>
  44. <th>Init</th>
  45. <th>MS ID</th>
  46. <th>Milestone</th>
  47. <th>EMT Sponsor</th>
  48. <th>Responsible</th>
  49. <th>Stop Light</th>
  50. <th>Status</th>
  51. <th>Target Quarter</th>
  52. <th>Update</th>
  53. </tr>
  54. <tr class="warning no-result">
  55. <td colspan="4"><i class="fa fa-warning"></i> No result</td>
  56. </tr>
  57. </thead>
  58. <tbody>
  59. @{int i = 0;}
  60.  
  61. @foreach (var item in @Model.OrderBy(item => item.Objective.UID))
  62. {
  63.  
  64. <tr data-toggle="collapse" data-target="#demo_@i" class="accordion-toggle">
  65. <td><button class="btn btn-default btn-xs"><span class="glyphicon glyphicon-eye-open"></span></button></td>
  66. <td scope="row">@item.Objective.UID</td>
  67. <td>@item.Objective.NAME</td>
  68. <td scope="row">@item.UID</td>
  69. <td>@item.NAME</td>
  70. <td scope="row">@item.Milsetone.UID</td>
  71. <td style="font-weight: bold">@item.Milsetone.NAME</td>
  72. <td scope="row">@item.Milsetone.EMTSPONS_UN</td>
  73. <td>@item.Milsetone.RESP_UN</td>
  74. @if (item.Milsetone.MS_Updates.Count() == 0)
  75. {
  76. <td>Not yet entered</td>
  77. }
  78. else
  79. {
  80. if (item.Milsetone.MS_Updates.LastOrDefault().STATUS_ID == 1)
  81. {
  82. <th style="background-color: darkseagreen"
  83. scope="row">
  84. GREEN
  85. </th>
  86. }
  87. if (item.Milsetone.MS_Updates.LastOrDefault().STATUS_ID == 3)
  88. {
  89. <th style="background-color: indianred"
  90. scope="row">
  91. RED
  92. </th>
  93. }
  94. if (item.Milsetone.MS_Updates.LastOrDefault().STATUS_ID == 2)
  95. {
  96. <th style="background-color: khaki"
  97. scope="row">
  98. YELLOW
  99. </th>
  100. }
  101. }
  102. @if (item.Milsetone.MS_Updates.Count() == 0)
  103. {
  104. <td>Not yet entered</td>
  105. }
  106. else
  107. {
  108. if (item.Milsetone.MS_Updates.LastOrDefault().STATUSNEW_ID == 1)
  109. {
  110. <td>Complete</td>
  111. }
  112. if (item.Milsetone.MS_Updates.LastOrDefault().STATUSNEW_ID == 2)
  113. {
  114. <td>Not Started</td>
  115. }
  116. if (item.Milsetone.MS_Updates.LastOrDefault().STATUSNEW_ID == 4)
  117. {
  118. <td>On Hold</td>
  119. }
  120. if (item.Milsetone.MS_Updates.LastOrDefault().STATUSNEW_ID == 6)
  121. {
  122. <td>Started</td>
  123. }
  124. if (item.Milsetone.MS_Updates.LastOrDefault().STATUSNEW_ID == 7)
  125. {
  126. <td>No Longer Required</td>
  127. }
  128. }
  129. @if (item.Milsetone.MS_Due.Count() == 0)
  130. {
  131. <td>Not yet entered</td>
  132. }
  133. else
  134. {
  135. <td>@item.Milsetone.MS_Due.LastOrDefault().QTR</td>
  136. }
  137. @*<th style="color:darkgoldenrod" scope="row">@item.NAME</th>*@
  138. @*<td>@item.DESCRIPTION</td>*@
  139. @*<td>@item.CREATEDBY</td>
  140. <td>@item.CREATEDON</td>*@
  141. @*<td>
  142. @Html.ActionLink("Edit", "Edit", "Milestones", new { id = item.ID }, null) |
  143. @Html.ActionLink("Select", "Details", "Milestones", new { id = item.ID }, null) |
  144. @Html.ActionLink("Delete", "Delete", "Milestones", new { id = item.ID }, null)
  145. </td>*@
  146. <td>
  147. @Html.ActionLink("Update Milestone", "Create", "MS_Updates", new { id = item.Milsetone.ID }, null) |
  148. @Html.ActionLink("Update Quarter", "Create", "MS_Due", new { id = item.Milsetone.ID }, null) |
  149. @if (CurrentURL.Contains("2"))
  150. {
  151. @Html.ActionLink("Edit Milestone", "Edit", "Milestones", new { id = item.Milsetone.ID }, null)
  152. }
  153. </td>
  154. </tr>
  155. <tr>
  156. <td colspan="12" class="hiddenRow">
  157. <div class="accordian-body collapse" id="demo_@i">
  158. <table class="table table-striped">
  159. <thead>
  160. <tr style="background-color: darkgrey" id="header_@i">
  161. <th>Update ID</th>
  162. <th>Stop Light</th>
  163. <th>Status</th>
  164. <th>Updates</th>
  165. <th>Major Issues, Risks, Barriers</th>
  166. @*<th>Upcoming Activities</th>
  167. <th>Notes/Comments</th>*@
  168. <th>Added By</th>
  169. <th>Added On</th>
  170. </tr>
  171. </thead>
  172. <tbody>
  173. @{int y = 0;}
  174. @foreach (var it in item.Milsetone.MS_Updates.Where(x => x.MS_ID == item.Milsetone.ID).OrderByDescending(it => it.UID))
  175. {
  176. <tr style="background-color: lightgrey" id="update_@y">
  177. <th scope="row"> @it.UID</th>
  178. @if (it.STATUS_ID == 1)
  179. {
  180. <th style="background-color: darkseagreen"
  181. scope="row">GREEN</th>
  182. }
  183. @if (it.STATUS_ID == 3)
  184. {
  185. <th style="background-color: indianred"
  186. scope="row">RED</th>
  187. }
  188. @if (it.STATUS_ID == 2)
  189. {
  190. <th style="background-color: khaki"
  191. scope="row">YELLOW</th>
  192. }
  193. @if (it.STATUSNEW_ID == 1)
  194. {
  195. <td>Complete</td>
  196. }
  197. @if (it.STATUSNEW_ID == 2)
  198. {
  199. <td>Not Started</td>
  200. }
  201. @if (it.STATUSNEW_ID == 4)
  202. {
  203. <td>On Hold</td>
  204. }
  205. @if (it.STATUSNEW_ID == 6)
  206. {
  207. <td>Started</td>
  208. }
  209. @if (it.STATUSNEW_ID == 7)
  210. {
  211. <td>No Longer Required</td>
  212. }
  213.  
  214. <td>@it.ACCOMPS</td>
  215. <td>@it.MIRB</td>
  216. @*<td>@it.UPCOMING</td>
  217. <td>@it.NOTES</td>*@
  218. <td>@it.CREATEDBY</td>
  219. <td>@it.CREATEDON</td>
  220. </tr>
  221. y++;
  222. }
  223. <tr>
  224. <td colspan="12" class="hiddenRow">
  225. <table class="table table-striped">
  226. <thead>
  227. <tr style="background-color: darkgrey" id="header2_@i" >
  228. <th>Target Quarter</th>
  229. <th>Added By</th>
  230. <th>Added On</th>
  231. </tr>
  232. </thead>
  233. <tbody>
  234. @{int t = 0;}
  235. @foreach (var d in item.Milsetone.MS_Due.Where(x => x.MS_ID == item.Milsetone.ID).OrderByDescending(d => d.CREATEDON))
  236. {
  237. <tr style="background-color: lightgrey" id="target_@t">
  238. <th scope="row"> @d.QTR</th>
  239. <td>@d.CREATEDBY</td>
  240. <td>@d.CREATEDON</td>
  241. </tr>
  242. t++;
  243. }
  244. </tbody>
  245. </table>
  246. </td>
  247. </tr>
  248. </tbody>
  249. </table>
  250.  
  251. </div>
  252. </td>
  253. </tr>
  254. i++;
  255. }
  256. </tbody>
  257. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement