Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(document).ready(function () {
- $(".search").keyup(function () {
- var searchTerm = $(".search").val();
- var listItem = $('.results tbody').children('tr');
- var searchSplit = searchTerm.replace(/ /g, "'):containsi('")
- $.extend($.expr[':'], {
- 'containsi': function (elem, i, match, array) {
- return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
- }
- });
- $(".results tbody tr").not(":containsi('" + searchSplit + "')").each(function (e) {
- $(this).attr('visible', 'false');
- });
- $(".results tbody tr:containsi('" + searchSplit + "')").each(function (e) {
- $(this).attr('visible', 'true');
- });
- var jobCount = $('.results tbody tr[visible="true"]').length;
- $('.counter').text(jobCount + ' item');
- if (jobCount == '0') { $('.no-result').show(); }
- else { $('.no-result').hide(); }
- });
- });
- </script>
- <table class="table table-hover table-bordered results" id="table">
- <thead>
- <tr>
- @*<th>#</th>
- <th class="col-md-5 col-xs-5">Name / Surname</th>
- <th class="col-md-4 col-xs-4">Job</th>
- <th class="col-md-3 col-xs-3">City</th>*@
- <th> </th>
- <th>Obj ID</th>
- <th>Obj</th>
- <th>Init ID</th>
- <th>Init</th>
- <th>MS ID</th>
- <th>Milestone</th>
- <th>EMT Sponsor</th>
- <th>Responsible</th>
- <th>Stop Light</th>
- <th>Status</th>
- <th>Target Quarter</th>
- <th>Update</th>
- </tr>
- <tr class="warning no-result">
- <td colspan="4"><i class="fa fa-warning"></i> No result</td>
- </tr>
- </thead>
- <tbody>
- @{int i = 0;}
- @foreach (var item in @Model.OrderBy(item => item.Objective.UID))
- {
- <tr data-toggle="collapse" data-target="#demo_@i" class="accordion-toggle">
- <td><button class="btn btn-default btn-xs"><span class="glyphicon glyphicon-eye-open"></span></button></td>
- <td scope="row">@item.Objective.UID</td>
- <td>@item.Objective.NAME</td>
- <td scope="row">@item.UID</td>
- <td>@item.NAME</td>
- <td scope="row">@item.Milsetone.UID</td>
- <td style="font-weight: bold">@item.Milsetone.NAME</td>
- <td scope="row">@item.Milsetone.EMTSPONS_UN</td>
- <td>@item.Milsetone.RESP_UN</td>
- @if (item.Milsetone.MS_Updates.Count() == 0)
- {
- <td>Not yet entered</td>
- }
- else
- {
- if (item.Milsetone.MS_Updates.LastOrDefault().STATUS_ID == 1)
- {
- <th style="background-color: darkseagreen"
- scope="row">
- GREEN
- </th>
- }
- if (item.Milsetone.MS_Updates.LastOrDefault().STATUS_ID == 3)
- {
- <th style="background-color: indianred"
- scope="row">
- RED
- </th>
- }
- if (item.Milsetone.MS_Updates.LastOrDefault().STATUS_ID == 2)
- {
- <th style="background-color: khaki"
- scope="row">
- YELLOW
- </th>
- }
- }
- @if (item.Milsetone.MS_Updates.Count() == 0)
- {
- <td>Not yet entered</td>
- }
- else
- {
- if (item.Milsetone.MS_Updates.LastOrDefault().STATUSNEW_ID == 1)
- {
- <td>Complete</td>
- }
- if (item.Milsetone.MS_Updates.LastOrDefault().STATUSNEW_ID == 2)
- {
- <td>Not Started</td>
- }
- if (item.Milsetone.MS_Updates.LastOrDefault().STATUSNEW_ID == 4)
- {
- <td>On Hold</td>
- }
- if (item.Milsetone.MS_Updates.LastOrDefault().STATUSNEW_ID == 6)
- {
- <td>Started</td>
- }
- if (item.Milsetone.MS_Updates.LastOrDefault().STATUSNEW_ID == 7)
- {
- <td>No Longer Required</td>
- }
- }
- @if (item.Milsetone.MS_Due.Count() == 0)
- {
- <td>Not yet entered</td>
- }
- else
- {
- <td>@item.Milsetone.MS_Due.LastOrDefault().QTR</td>
- }
- @*<th style="color:darkgoldenrod" scope="row">@item.NAME</th>*@
- @*<td>@item.DESCRIPTION</td>*@
- @*<td>@item.CREATEDBY</td>
- <td>@item.CREATEDON</td>*@
- @*<td>
- @Html.ActionLink("Edit", "Edit", "Milestones", new { id = item.ID }, null) |
- @Html.ActionLink("Select", "Details", "Milestones", new { id = item.ID }, null) |
- @Html.ActionLink("Delete", "Delete", "Milestones", new { id = item.ID }, null)
- </td>*@
- <td>
- @Html.ActionLink("Update Milestone", "Create", "MS_Updates", new { id = item.Milsetone.ID }, null) |
- @Html.ActionLink("Update Quarter", "Create", "MS_Due", new { id = item.Milsetone.ID }, null) |
- @if (CurrentURL.Contains("2"))
- {
- @Html.ActionLink("Edit Milestone", "Edit", "Milestones", new { id = item.Milsetone.ID }, null)
- }
- </td>
- </tr>
- <tr>
- <td colspan="12" class="hiddenRow">
- <div class="accordian-body collapse" id="demo_@i">
- <table class="table table-striped">
- <thead>
- <tr style="background-color: darkgrey" id="header_@i">
- <th>Update ID</th>
- <th>Stop Light</th>
- <th>Status</th>
- <th>Updates</th>
- <th>Major Issues, Risks, Barriers</th>
- @*<th>Upcoming Activities</th>
- <th>Notes/Comments</th>*@
- <th>Added By</th>
- <th>Added On</th>
- </tr>
- </thead>
- <tbody>
- @{int y = 0;}
- @foreach (var it in item.Milsetone.MS_Updates.Where(x => x.MS_ID == item.Milsetone.ID).OrderByDescending(it => it.UID))
- {
- <tr style="background-color: lightgrey" id="update_@y">
- <th scope="row"> @it.UID</th>
- @if (it.STATUS_ID == 1)
- {
- <th style="background-color: darkseagreen"
- scope="row">GREEN</th>
- }
- @if (it.STATUS_ID == 3)
- {
- <th style="background-color: indianred"
- scope="row">RED</th>
- }
- @if (it.STATUS_ID == 2)
- {
- <th style="background-color: khaki"
- scope="row">YELLOW</th>
- }
- @if (it.STATUSNEW_ID == 1)
- {
- <td>Complete</td>
- }
- @if (it.STATUSNEW_ID == 2)
- {
- <td>Not Started</td>
- }
- @if (it.STATUSNEW_ID == 4)
- {
- <td>On Hold</td>
- }
- @if (it.STATUSNEW_ID == 6)
- {
- <td>Started</td>
- }
- @if (it.STATUSNEW_ID == 7)
- {
- <td>No Longer Required</td>
- }
- <td>@it.ACCOMPS</td>
- <td>@it.MIRB</td>
- @*<td>@it.UPCOMING</td>
- <td>@it.NOTES</td>*@
- <td>@it.CREATEDBY</td>
- <td>@it.CREATEDON</td>
- </tr>
- y++;
- }
- <tr>
- <td colspan="12" class="hiddenRow">
- <table class="table table-striped">
- <thead>
- <tr style="background-color: darkgrey" id="header2_@i" >
- <th>Target Quarter</th>
- <th>Added By</th>
- <th>Added On</th>
- </tr>
- </thead>
- <tbody>
- @{int t = 0;}
- @foreach (var d in item.Milsetone.MS_Due.Where(x => x.MS_ID == item.Milsetone.ID).OrderByDescending(d => d.CREATEDON))
- {
- <tr style="background-color: lightgrey" id="target_@t">
- <th scope="row"> @d.QTR</th>
- <td>@d.CREATEDBY</td>
- <td>@d.CREATEDON</td>
- </tr>
- t++;
- }
- </tbody>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </td>
- </tr>
- i++;
- }
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement