Advertisement
Guest User

Untitled

a guest
Jul 9th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.32 KB | None | 0 0
  1. @model IEnumerable<ARCHive.Models.Complex_Types.AttendanceModel>
  2.  
  3. <body>
  4.  
  5. @using (Ajax.BeginForm("Attendance", "Personnel", new AjaxOptions { InsertionMode = InsertionMode.Replace, UpdateTargetId = "middle_column", HttpMethod = "GET" }, new { id = "AjaxForm" }))
  6. {
  7.  
  8. <div class="dropdown" style="float:left">
  9. @Html.DropDownList(
  10. "showOnly",
  11. (SelectList)ViewBag.StaffList,
  12. new { @class = "containerItems", @onchange = "showUser($(this).val());" }
  13. )
  14. </div>
  15.  
  16. <div style="float:left">
  17. Start date: <input type="date" name="startDate"/>
  18. </div>
  19.  
  20. <div style="float:left">
  21. End date: <input type="date" name="endDate"/>
  22. </div>
  23.  
  24. <div>
  25. <input type="button" name="SubmitBtn" value="Submit" onclick="$('#AjaxForm').submit();"/>
  26.  
  27. </div>
  28.  
  29. }
  30.  
  31. <h3 style="text-align:center">Key</h3>
  32.  
  33.  
  34.  
  35.  
  36. @*Add colour for no data!!!!!!!!!!!*@
  37.  
  38.  
  39.  
  40. <div class="progress">
  41. <div class="progress-bar progress-bar-in2" role="progressbar" style="width:16.66%">
  42. In
  43. </div>
  44. <div class="progress-bar progress-bar-sick2" role="progressbar" style="width:16.66%">
  45. Sick
  46. </div>
  47. <div class="progress-bar progress-bar-holiday2" role="progressbar" style="width:16.66%">
  48. Holiday
  49. </div>
  50. <div class="progress-bar progress-bar-absent2" role="progressbar" style="width:16.66%">
  51. Absent
  52. </div>
  53. <div class="progress-bar progress-bar-request2" role="progressbar" style="width:16.66%">
  54. Requested
  55. </div>
  56. <div class="progress-bar progress-bar-rejected2" role="progressbar" style="width:16.7%">
  57. Rejected
  58. </div>
  59. </div>
  60.  
  61. <br />
  62. @foreach (var Item in Model)
  63. {
  64. <div class="hideMe" data-id="@Item.ID">
  65. <div class="panel panel-custom">
  66. <div class="panel-heading">@Item.Name</div>
  67.  
  68. @{
  69. int j = Item.DayList.Count();
  70. float k = 100.00f / j;
  71. string format = "ddd d MMM";
  72. string format2 = "ddd";
  73. }
  74.  
  75. <div class="panel-body" style="margin-top:15px;">
  76. <div class="progress">
  77.  
  78. @foreach (var Rec in Item.DayList)
  79. {
  80. if (Rec.Type.ToString() == "In")
  81. {
  82. <div class="progress-bar progress-bar-in" role="progressbar" style="width:@k%" data-toggle="tooltip" title="@Rec.Date.ToShortDateString()">
  83. @Rec.Date.ToString(format2).Replace("Mon", "M").Replace("Tue", "T").Replace("Wed", "W").Replace("Thu", "T").Replace("Fri", "F")
  84. </div>
  85. }
  86. if (Rec.Type.ToString() == "Absent")
  87. {
  88. <div class="progress-bar progress-bar-absent" role="progressbar" style="width:@k%" data-toggle="tooltip" title="@Rec.Date.ToShortDateString()">
  89. @Rec.Date.ToString(format2).Replace("Mon", "M").Replace("Tue", "T").Replace("Wed", "W").Replace("Thu", "T").Replace("Fri", "F")
  90. </div>
  91. }
  92. if (Rec.Type.ToString() == "Sick")
  93. {
  94. <div class="progress-bar progress-bar-sick" role="progressbar" style="width:@k%" data-toggle="tooltip" title="@Rec.Date.ToShortDateString()">
  95. @Rec.Date.ToString(format2).Replace("Mon", "M").Replace("Tue", "T").Replace("Wed", "W").Replace("Thu", "T").Replace("Fri", "F")
  96. </div>
  97. }
  98. if (Rec.Type.ToString() == "Holiday")
  99. {
  100. <div class="progress-bar progress-bar-holiday" role="progressbar" style="width:@k%" data-toggle="tooltip" title="@Rec.Date.ToShortDateString()">
  101. @Rec.Date.ToString(format2).Replace("Mon", "M").Replace("Tue", "T").Replace("Wed", "W").Replace("Thu", "T").Replace("Fri", "F")
  102. </div>
  103. }
  104. if (Rec.Type.ToString() == "Requested_Holiday")
  105. {
  106. <div class="progress-bar progress-bar-request" role="progressbar" style="width:@k%" data-toggle="tooltip" title="@Rec.Date.ToShortDateString()">
  107. @Rec.Date.ToString(format2).Replace("Mon", "M").Replace("Tue", "T").Replace("Wed", "W").Replace("Thu", "T").Replace("Fri", "F")
  108. </div>
  109. }
  110. if (Rec.Type.ToString() == "Rejected_Holiday")
  111. {
  112. <div class="progress-bar progress-bar-rejected" role="progressbar" style="width:@k%" data-toggle="tooltip" title="@Rec.Date.ToShortDateString()">
  113. @Rec.Date.ToString(format2).Replace("Mon", "M").Replace("Tue", "T").Replace("Wed", "W").Replace("Thu", "T").Replace("Fri", "F")
  114. </div>
  115. }
  116. if (Rec.Type.ToString() == "Weekend")
  117. {
  118. <div class="progress-bar progress-bar-weekend" role="progressbar" style="width:@k%" data-toggle="tooltip" title="@Rec.Date.ToShortDateString()">
  119. @Rec.Date.ToString(format2).Replace("Sat", "S").Replace("Sun", "S")
  120. </div>
  121. }
  122. if (Rec.Type.ToString() == "None")
  123. {
  124. <div class="progress-bar progress-bar-none" role="progressbar" style="width:@k%" data-toggle="tooltip" title="@Rec.Date.ToShortDateString()">
  125. @Rec.Date.ToString(format2).Replace("Mon", "M").Replace("Tue", "T").Replace("Wed", "W").Replace("Thu", "T").Replace("Fri", "F")
  126. </div>
  127. }
  128.  
  129. }
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. }
  135. </body>
  136.  
  137.  
  138. <script type="text/javascript">
  139.  
  140. $(document).ready(function () {
  141. $('[data-toggle="tooltip"]').tooltip();
  142. });
  143.  
  144. $(document).ready(showUser(@ViewBag.showOnly));
  145.  
  146. function showAll() {
  147. $(".hideMe").each(function () {
  148. $(this).show();
  149. });
  150. }
  151.  
  152. function showUser(e) {
  153.  
  154. showAll();
  155.  
  156. if (e != -1) {
  157.  
  158. $(".hideMe").each(function (index) {
  159. if ($(this).data('id') != e) { //remove and set = e //$(e).attr('id'))
  160. $(this).hide();
  161.  
  162. }
  163. });
  164. }
  165.  
  166.  
  167. }
  168. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement