Approves.cshtml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. @{
  2. ViewBag.Title = "EventShowing";
  3. Layout = "~/Views/Shared/_Layout.cshtml";
  4. }
  5. @using System.Threading;
  6. @using SuperAdmin.Controllers;
  7. @using SuperAdmin.Models.View;
  8. @using SuperAdmin.Models.Object;
  9. @model EventViewModel
  10. @section Styles{
  11. <style>
  12. .button-event {
  13. margin: 10px 0 0 0 !important;
  14. padding: revert;
  15. height: 30px;
  16. min-width: 100px;
  17. width: 100%;
  18. }
  19. .card-show {
  20. margin: 5px;
  21. border-radius: 10px;
  22. }
  23. .nav-justified {
  24. margin-top: 50px;
  25. }
  26. .pagination-ul {
  27. /*float: right;*/
  28. /* position: absolute; */
  29. /* right: 0; */
  30. margin-top: 20px;
  31. padding-right: 15px;
  32. }
  33. .pagination-active {
  34. background: #4c84ff !important;
  35. color: #ffffff !important;
  36. }
  37. .pagination-disable {
  38. pointer-events: none;
  39. }
  40. </style>
  41. }
  42. @{
  43. if (Model == null)
  44. {
  45. @*<script>
  46. window.location.href = @Url.Action("Index", "Tree");
  47. </script>*@
  48. }
  49. else
  50. {
  51. int page = 1;
  52. int totalPage = 1;
  53. string status = UtilsController.Constant.WAIT_APPROVAL;
  54. if (Model.page != null)
  55. {
  56. page = int.Parse(Model.page);
  57. }
  58. if (Model.status != null)
  59. {
  60. status = Model.status;
  61. }
  62. if (Model.totalPage != null)
  63. {
  64. totalPage = int.Parse(Model.totalPage);
  65. }
  66. <div class="content-header row">
  67. <div class="content-header-left col-md-6 col-xs-12 mb-1">
  68. <h2 class="content-header-title">Notice Approval</h2>
  69. </div>
  70. <div class="content-header-right breadcrumbs-right breadcrumbs-top col-md-6 col-xs-12">
  71. <div class="breadcrumb-wrapper col-xs-12">
  72. <ol class="breadcrumb">
  73. <li class="breadcrumb-item">
  74. <a href="/Tree/Index">Notice</a>
  75. </li>
  76. <li class="breadcrumb-item">
  77. <a href="#">Approves</a>
  78. </li>
  79. </ol>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="tree-container">
  84. <ul class="nav nav-tabs nav-justified mb-4" role="tablist">
  85. <li class="nav-item nav-status" value="@UtilsController.Constant.WAIT_APPROVAL">
  86. <a class="tab-@UtilsController.Constant.WAIT_APPROVAL nav-link tab-status" data-toggle="tab" href="#draft" style="text-transform: uppercase;">Wait Approval</a>
  87. </li>
  88. <li class="nav-item nav-status" value="@UtilsController.Constant.APPROVED">
  89. <a class="tab-@UtilsController.Constant.APPROVED nav-link tab-status" data-toggle="tab" href="#approval" style="text-transform: uppercase;">Approved</a>
  90. </li>
  91. <li class="nav-item nav-status" value="@UtilsController.Constant.REJECTED">
  92. <a class="tab-@UtilsController.Constant.REJECTED nav-link tab-status" data-toggle="tab" href="#published" style="text-transform: uppercase;">Rejected</a>
  93. </li>
  94. </ul>
  95. <div class="tab-content">
  96. <div id="draft" class="container tab-pane fade in active show" style="min-width:100%">
  97. <table class="table table-striped table-bordered table-hover">
  98. <thead>
  99. <tr>
  100. <th scope="col" class="text-center">#</th>
  101. <th scope="col" class="text-center">Action</th>
  102. <th scope="col" class="text-center">Name</th>
  103. <th scope="col" class="text-center">From Date</th>
  104. <th scope="col" class="text-center">To Date</th>
  105. <th scope="col" class="text-center">Status</th>
  106. @*<th scope="col" class="text-center">Action</th>*@
  107. </tr>
  108. </thead>
  109. <tbody>
  110. @{
  111. for (int i = 0; i < Model.events.data.Count; i++)
  112. {
  113. RowStructure eventDetail = Model.events.data[i];
  114. <tr>
  115. <td scope="row" class="text-center">@(i + 1)</td>
  116. <td class="text-center"><img class="icon-style edit-btn" value="100207" src="/img/icons8-edit-96.png" onclick="approvesData(@eventDetail.id)"></td>
  117. <td class="text-left"><a onclick="approvesData(@eventDetail.id)">@eventDetail.name_global</a></td>
  118. <td class="text-center">@eventDetail.from_date</td>
  119. <td class="text-center">@eventDetail.to_date</td>
  120. <td class="text-center">@UtilsController.GetStatus(eventDetail.is_show)</td>
  121. @*<td class="text-center">
  122. <img class="icon-action approve-event" src="~/img/icons8-rubber-stamp-80.png" value="@eventDetail.id" />
  123. <img class="icon-action reject-event" src="~/img/icons8-unavailable-90.png" value="@eventDetail.id" />
  124. <img class="icon-action edit-event" src="~/img/icons8-edit-64.png" value="@eventDetail.id" />
  125. </td>*@
  126. </tr>
  127. }
  128. }
  129. </tbody>
  130. </table>
  131. </div>
  132. <div id="approval" class="container tab-pane fade" style="min-width:100%">
  133. </div>
  134. <div id="published" class="container tab-pane fade" style="min-width:100%">
  135. </div>
  136. <div id="expired" class="container tab-pane fade" style="min-width:100%">
  137. </div>
  138. <div id="rejected" class="container tab-pane fade" style="min-width:100%">
  139. </div>
  140. </div>
  141. <div class="category-post-pagination col-xs-12 pagination-style" style="text-align: center;">
  142. <ul class="pagination clearfix pagination-ul">
  143. @if (page > 1)
  144. {
  145. <li class="pagination-prev">
  146. <a href="@Url.Action("Approves", "Tree", new { page = 1, status = status })">‹‹</a>
  147. </li>
  148. }
  149. @if (page > 1)
  150. {
  151. <li class="pagination-prev @(page == 1 ? "disabled pagination-disable" : "")">
  152. <a href="@Url.Action("Approves", "Tree", new { page = page - 1, status = status })">‹</a>
  153. </li>
  154. }
  155. <li class="current"><a href="@Url.Action("Approves", "Tree", new { page = page, status = status })" class="pagination-active">@(page)</a></li>
  156. @if (totalPage >= page + 1)
  157. {
  158. <li><a href="@Url.Action("Approves", "Tree", new { page = page + 1, status = status })">@(page + 1)</a></li>
  159. }
  160. @if (totalPage >= page + 2)
  161. {
  162. <li><a href="@Url.Action("Approves", "Tree", new { page = page + 2, status = status })">@(page + 2)</a></li>
  163. }
  164. @if (totalPage >= page + 3)
  165. {
  166. <li><a href="@Url.Action("Approves", "Tree", new { page = page + 3, status = status })">@(page + 3)</a></li>
  167. }
  168. @if (totalPage >= page + 4)
  169. {
  170. <li><a href="@Url.Action("Approves", "Tree", new { page = page + 4, status = status })">@(page + 4)</a></li>
  171. }
  172. @if (totalPage >= page + 1)
  173. {
  174. <li class="pagination-next ">
  175. <a href="@Url.Action("Approves", "Tree", new { page = page + 1, status = status })">›</a>
  176. </li>
  177. }
  178. @if (totalPage > page + 4)
  179. {
  180. <li class="pagination-next ">
  181. <a href="@Url.Action("Approves", "Tree", new { page = page + 1, status = status })">››</a>
  182. </li>
  183. }
  184. </ul>
  185. </div>
  186. <form action="@Url.Action("Approves", "Tree")" method="post" id="form-show-event-list">
  187. <input type="hidden" name="page" id="page" value="1" />
  188. <input type="hidden" name="status" id="status" value="" />
  189. </form>
  190. <form action="@Url.Action("EventEditing", "Tree")" method="post" id="form-edit-event">
  191. <input type="hidden" name="eventID" class="eventID" value="" />
  192. </form>
  193. <form action="@Url.Action("DeleteAction", "Tree")" method="post" id="form-delete-event">
  194. @Html.AntiForgeryToken()
  195. <input type="hidden" name="eventID" class="eventID" value="" />
  196. </form>
  197. <form action="@Url.Action("ResendAction", "Tree")" method="post" id="form-resend-event">
  198. @Html.AntiForgeryToken()
  199. <input type="hidden" name="eventID" class="eventID" value="" />
  200. </form>
  201. <script>
  202. $(".tab-status").each(function () {
  203. $(this).removeClass("active");
  204. });
  205. $(".tab-@status").addClass("active");
  206. $(".nav-status").on("click", function (e) {
  207. e.preventDefault();
  208. $("#page").val("1");
  209. var status = $(this).attr("value");
  210. $("#status").val(status);
  211. $("#form-show-event-list").submit();
  212. })
  213. $(".edit-event").on("click", function () {
  214. var eventId = $(this).attr("value");
  215. console.log("id: ", eventId);
  216. $(".eventID").val(eventId);
  217. console.log("id con: ", $(".eventID").val());
  218. $("#form-edit-event").submit();
  219. })
  220. function edit_event(eventID) {
  221. // change to another page
  222. $(".eventID").val(eventID);
  223. $.ajax({
  224. url: urlConfig("/Partial/ResendEvent"),
  225. type: "POST",
  226. data: {
  227. __RequestVerificationToken: $('input[name=__RequestVerificationToken]').val(),
  228. },
  229. success: function (data) {
  230. $('#modalContent').html(data);
  231. $('#myModal').modal('show');
  232. }
  233. });
  234. //$("#form-edit-event").submit();
  235. }
  236. function delete_event(eventID) {
  237. // hold on
  238. $(".eventID").val(eventID);
  239. $.ajax({
  240. url: urlConfig("/Partial/DeleteEvent"),
  241. type: "POST",
  242. data: {
  243. __RequestVerificationToken: $('input[name=__RequestVerificationToken]').val(),
  244. },
  245. success: function (data) {
  246. $('#modalContent').html(data);
  247. $('#myModal').modal('show');
  248. }
  249. });
  250. //$("#form-delete-event").submit();
  251. }
  252. function resend_event(eventID) {
  253. // hold on
  254. $(".eventID").val(eventID);
  255. $("#form-resend-event").submit();
  256. }
  257. </script>
  258. </div>
  259. }
  260. }