Results.cshtml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. @{
  2. ViewData["Title"] = "Results";
  3. Layout = "~/Views/Shared/_Layout.cshtml";
  4. }
  5. @using LotteryWebApp.Languages;
  6. @using LotteryWebApp.Controllers;
  7. @using LotteryWebApp.Common;
  8. @using System.Globalization;
  9. @model HomeResults_ViewModel
  10. @{
  11. DateTime oDateFrom = DateTime.ParseExact(Model.fromDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
  12. String dateFrom = oDateFrom.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
  13. DateTime oDateTo = DateTime.ParseExact(Model.toDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
  14. String dateTo = oDateTo.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
  15. }
  16. <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  17. <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
  18. <div class="app-content content" style="position:relative">
  19. <div class="card-title text-center ">
  20. <div class="news-button-header-container" style="text-align: start; margin: 0 10px;">
  21. @await Component.InvokeAsync("SmallHeader", new { title = @Lang.results.ToUpper()})
  22. </div>
  23. </div>
  24. <div class="content-wrapper" style="padding:2px;">
  25. <div class="content-body">
  26. <section class="flexbox-container">
  27. <div class="content-wrapper buy-ticket-container" style="margin-top:35px;">
  28. <div class="">
  29. <div class="result-date-box">
  30. <fieldset class="form-group position-relative has-icon-left">
  31. <label>@Lang.from</label>
  32. <input type="date" class="form-control small-input-box" id="fromDate" name="fromDate" required value="@dateFrom">
  33. </fieldset>
  34. </div>
  35. <div class=" result-date-box">
  36. <fieldset class="form-group position-relative has-icon-left">
  37. <label>@Lang.to</label>
  38. <input type="date" class="form-control small-input-box" id="toDate" name="toDate" required value="@dateTo">
  39. </fieldset>
  40. </div>
  41. <div class=" result-date-box-button">
  42. <button type="button" class="btn btn-outline-primary adv-button btn-block login-button-action small-input-box"
  43. onclick="getResultTermHistoryData(@Model.termType)">
  44. @Lang.search.ToUpper()
  45. </button>
  46. </div>
  47. </div>
  48. <div class="row tabs-style" style=" ">
  49. <div col-12>
  50. <select id="gameTypeSelect" style="width:200px" asp-for="termType" onchange="changeGame()">
  51. <option value="@Constants.NEW_YORK_BOLET_CODE" data-img="../img/logo-deebef36ed9bb3f8e07e8492eecbb7ae (1) 1.png" >
  52. NEW YORK
  53. </option>
  54. <option value="@Constants.FLORIDA_BOLET_CODE" data-img="../img/siteLogo 2.png">FLORIDA</option>
  55. <option value="@Constants.BOULCHANS_CODE" data-img="">BOULCHANS</option>
  56. <option value="@Constants.GEORGIA_BOLET_CODE" data-img="../img/logo/Georgia_Lottery.jpg">GEORGIA</option>
  57. <option value="@Constants.TEXAS_BOLET_CODE" data-img="../img/logo/logo_tx.png">TEXAS</option>
  58. <option value="@Constants.TENNESSEE_BOLET_CODE" data-img="../img/logo/TN_Lottery.png">TENNESSEE</option>
  59. </select>
  60. </div>
  61. @*<div class="col-4 tab-style">
  62. <input type="radio" id="tab-1" name="tab-group-1" @(Model.termType == Constants.NEW_YORK_BOLET_CODE ? "checked" : "")>
  63. <label for="tab-1">
  64. <a style="font-size: 11px;" href="@ViewBag.MyConfig.MyValue/Home/Results?termType=@Constants.NEW_YORK_BOLET_CODE"
  65. class="@(Model.termType == Constants.NEW_YORK_BOLET_CODE ? "active-tab" : "")">
  66. <img style="height: 30px;" src="~/img/logo-deebef36ed9bb3f8e07e8492eecbb7ae (1) 1.png" />
  67. NEW YORK
  68. </a>
  69. </label>
  70. </div>
  71. <div class="col-4 tab-style">
  72. <input type="radio" id="tab-2" name="tab-group-1" @(Model.termType == Constants.FLORIDA_BOLET_CODE ? "checked" : "")>
  73. <label for="tab-2">
  74. <a style="font-size: 11px;" href="@ViewBag.MyConfig.MyValue/Home/Results?termType=@Constants.FLORIDA_BOLET_CODE"
  75. class="@(Model.termType == Constants.FLORIDA_BOLET_CODE ? "active-tab" : "")">
  76. <img style="height: 30px;" src="~/img/siteLogo 2.png" />
  77. FLORIDA
  78. </a>
  79. </label>
  80. </div>
  81. <div class="col-4 tab-style">
  82. <input type="radio" id="tab-2" name="tab-group-1" @(Model.termType == Constants.BOULCHANS_CODE ? "checked" : "")>
  83. <label for="tab-2">
  84. <a style="font-size: 11px;" href="@ViewBag.MyConfig.MyValue/Home/Results?termType=@Constants.BOULCHANS_CODE"
  85. class="@(Model.termType == Constants.BOULCHANS_CODE ? "active-tab" : "")">
  86. BOULCHANS
  87. </a>
  88. </label>
  89. </div>*@
  90. </div>
  91. <div class="result-form-all">
  92. <div class="result-form-container">
  93. <div class="row result-form-box">
  94. <div class="col-3" style="border-right:1px solid white;">
  95. <h5>@Lang.time</h5>
  96. </div>
  97. <div class="col-9">
  98. <h5>@Lang.results</h5>
  99. </div>
  100. </div>
  101. </div>
  102. <div id="term-result-history-data">
  103. </div>
  104. <script>
  105. getResultTermHistoryData(@Model.termType);
  106. </script>
  107. </div>
  108. </div>
  109. </section>
  110. </div>
  111. </div>
  112. </div>
  113. <script>
  114. stopLoading();
  115. </script>
  116. <script>
  117. $('#gameTypeSelect').select2({
  118. templateResult: formatOption,
  119. templateSelection: formatOption,
  120. minimumResultsForSearch: Infinity
  121. });
  122. function formatOption (state) {
  123. if (!state.id) return state.text;
  124. var img = $(state.element).data('img');
  125. return $('<span><img src="'+img+'" style="width:30px;height:30px;margin-right:5px"/> '+state.text+'</span>');
  126. }
  127. function changeGame() {
  128. var termType = $("#gameTypeSelect").val();
  129. location.href = "@ViewBag.MyConfig.MyValue/Home/Results?termType=" + termType;
  130. }
  131. </script>