BuyTicket.cshtml 79 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430
  1. @model LotteryWebApp.Models.HomeIndex_ViewModel
  2. @{
  3. ViewData["Title"] = "Millions - Buy Ticket";
  4. Layout = "~/Areas/Millions/Views/Shared/_Layout.cshtml";
  5. var currentTerm = Model.listTerm?.FirstOrDefault();
  6. }
  7. @using LotteryWebApp.Languages;
  8. @using LotteryWebApp.Common;
  9. @section Styles {
  10. <link rel="stylesheet" href="/Millions/css/buy-ticket.css" />
  11. <style>
  12. /* BuyTicket has its own bottom bar; avoid global navbar padding gap */
  13. body.millions-bg { padding-bottom: 0 !important; }
  14. body.millions-bg .main-container { padding-bottom: 0 !important; }
  15. </style>
  16. }
  17. @if (Model.termType == Constants.PIC10_BIGSMALL_CODE || Model.termType == Constants.PIC10_ODDEVEN_CODE)
  18. {
  19. var isBigSmall = Model.termType == Constants.PIC10_BIGSMALL_CODE;
  20. var themeColor = isBigSmall ? "#0A9800" : "#AA3DC8";
  21. var gameTitle = isBigSmall ? Lang.millions_big_small : Lang.millions_odd_even;
  22. var prizeAmount = isBigSmall ? "100.000" : "200.000";
  23. <!-- ==================== CARD SELECTION GAME UI (BIG/SMALL or ODD/EVEN) ==================== -->
  24. <div class="millions-buy-ticket-page main-container animate__animated animate__fadeIn overflow-hidden">
  25. <!-- Header -->
  26. <div class="header">
  27. <button onclick="location.href='@Url.Action("GameHome", "Home")'" class="back-btn" type="button">
  28. <i class="fa-solid fa-arrow-left"></i>
  29. </button>
  30. <div class="header-title">@gameTitle</div>
  31. </div>
  32. <div class="content-card">
  33. <!-- Sticky Term Info sub-header -->
  34. <div class="ticket-subheader">
  35. <div class="flex items-center justify-between">
  36. <div class="flex items-center gap-2 border border-[#E5E7EB] rounded-lg px-3 py-1.5 bg-gray-50">
  37. <i class="fa-regular fa-calendar text-[[@themeColor]] text-sm" style="color: @themeColor"></i>
  38. <span class="text-[12px] font-bold text-gray-700">@DateTime.Now.ToString("dddd, MMM dd, yyyy", System.Globalization.CultureInfo.InvariantCulture)</span>
  39. </div>
  40. <div class="flex items-center gap-1 ml-4 flex-1 justify-end">
  41. <span class="text-[12px] font-bold text-gray-400">@Lang.millions_round</span>
  42. <span class="text-[18px] font-black text-brown-main">#@(currentTerm?.id ?? "123")</span>
  43. </div>
  44. </div>
  45. </div>
  46. <!-- Scrollable Content Area -->
  47. <div class="ticket-scroll-area bg-white pb-40" id="bsContent">
  48. <!-- Results for the last 5 days -->
  49. <div class="px-5 pt-4 pb-2">
  50. <h3 class="text-[17px] font-bold text-black text-center mb-3">Results for the last 5 days</h3>
  51. <div id="last5Results" class="flex justify-between gap-1.5 px-1">
  52. @{
  53. var pastTerms = ViewBag.PastTerms as List<LotteryWebApp.Service.Term> ?? new List<LotteryWebApp.Service.Term>();
  54. foreach (var term in pastTerms) {
  55. var rawResult = (term.result ?? "").Trim().ToUpper();
  56. var dateStr = "--";
  57. DateTime dt;
  58. if (DateTime.TryParse(term.date_random, out dt)) {
  59. dateStr = dt.ToString("MMM dd", System.Globalization.CultureInfo.InvariantCulture);
  60. }
  61. var resKey = rawResult;
  62. var resTitle = rawResult;
  63. if (isBigSmall) {
  64. if (rawResult == "S") { resKey = "Small"; resTitle = Lang.Small; }
  65. else if (rawResult == "B") { resKey = "Big"; resTitle = Lang.Big; }
  66. } else {
  67. if (rawResult == "O") { resKey = "Odd"; resTitle = Lang.Odd; }
  68. else if (rawResult == "E") { resKey = "Even"; resTitle = Lang.Even; }
  69. }
  70. var resColor = "";
  71. var bgStyle = "background: linear-gradient(136deg, #FFFAE6 0%, #FFE588 100%);";
  72. var textStyle = "-webkit-text-stroke: 0.5px #000;";
  73. if (resKey == "NA" || string.IsNullOrEmpty(rawResult)) {
  74. bgStyle = "background: #EAEAEA;";
  75. resTitle = "";
  76. textStyle = "";
  77. } else {
  78. if (isBigSmall) {
  79. resColor = resKey == "Big" ? "#A2FF00" : "#FF4157";
  80. } else {
  81. resColor = resKey == "Odd" ? "#FFC700" : "#B33BD0";
  82. }
  83. textStyle += $" color: {resColor};";
  84. }
  85. <div class="flex flex-col items-center justify-center min-h-[64px] flex-1 rounded-lg py-1.5 border border-gray-200" style="@bgStyle">
  86. <span class="text-[11px] font-bold text-black whitespace-nowrap opacity-70">@dateStr</span>
  87. <span class="text-[22px] font-black leading-tight" style="@textStyle">@resTitle</span>
  88. </div>
  89. }
  90. for(int r = pastTerms.Count; r < 5; r++) {
  91. <div class="flex flex-col items-center justify-center min-h-[64px] flex-1 rounded-lg py-1.5 border border-gray-200" style="background: #EAEAEA; opacity: 0.7;">
  92. <span class="text-[11px] font-bold text-black whitespace-nowrap opacity-70">--</span>
  93. <span class="text-[22px] font-black leading-tight" style="color: transparent;"></span>
  94. </div>
  95. }
  96. }
  97. </div>
  98. </div>
  99. <!-- Selection Cards -->
  100. <!-- Selection Cards -->
  101. <div class="px-5 pt-4 flex gap-3 h-[245px]">
  102. <!-- Card 1 (Big or Odd) -->
  103. <div id="cardBig" onclick="selectBigSmall('big')" class="bigsmall-card flex-1 rounded-2xl relative cursor-pointer transition-all duration-300 active:scale-[0.97] border-2 border-transparent overflow-hidden flex flex-col" style="background: linear-gradient(180deg, #FFF7DB 0%, #FFEEB3 100%);">
  104. <img src="/Millions/img/bigsmall/light_effect_1.png" class="absolute top-0 left-0 w-full opacity-60 pointer-events-none" alt="" />
  105. <img src="/Millions/img/bigsmall/light_effect_2.png" class="absolute bottom-12 left-0 w-full opacity-60 pointer-events-none" alt="" />
  106. <div class="flex flex-col items-center pt-4 pb-3 px-3 relative z-10 h-full justify-between">
  107. <div class="flex flex-col items-center w-full">
  108. <div class="h-[34px] flex items-center justify-center">
  109. <div class="text-[40px] font-[800] leading-none" style="-webkit-text-stroke: 1px #000; text-shadow: 1px 2px 2px rgba(0,0,0,0.15); color: @(isBigSmall ? "#A2FF00" : "#FFC700");">@(isBigSmall ? "Big" : "Odd")</div>
  110. </div>
  111. <div class="text-[11px] font-medium text-gray-500 mt-1 h-[28px] text-center leading-tight">
  112. @(isBigSmall ? "13 number from" : "Odd numbers") <br/> <b>@(isBigSmall ? "41-80" : "1, 3, 5, 7, 9")</b>
  113. </div>
  114. </div>
  115. <div class="flex items-center justify-center -space-x-2 my-2">
  116. @if (isBigSmall) {
  117. <img src="/Millions/img/bigsmall/ball_42_dark.png" class="w-12 h-12 relative z-[1]" alt="42" />
  118. <img src="/Millions/img/bigsmall/ball_88_big.png" class="w-16 h-16 relative z-[2]" alt="88" />
  119. <img src="/Millions/img/bigsmall/ball_54_dark.png" class="w-12 h-12 relative z-[1]" alt="54" />
  120. } else {
  121. <img src="/Millions/img/oddeven/ball_3.png" class="w-12 h-12 relative z-[1]" alt="3" />
  122. <img src="/Millions/img/oddeven/ball_1.png" class="w-16 h-16 relative z-[2]" alt="1" />
  123. <img src="/Millions/img/oddeven/ball_19.png" class="w-12 h-12 relative z-[1]" alt="19" />
  124. }
  125. </div>
  126. <button class="bigsmall-btn w-full py-2.5 rounded-xl font-black text-[15px] transition-all shadow-md" style="background: @themeColor; color: white;">@Lang.millions_select</button>
  127. </div>
  128. </div>
  129. <!-- Card 2 (Small or Even) -->
  130. <div id="cardSmall" onclick="selectBigSmall('small')" class="bigsmall-card flex-1 rounded-2xl relative cursor-pointer transition-all duration-300 active:scale-[0.97] border-2 border-transparent overflow-hidden flex flex-col" style="background: linear-gradient(180deg, #FFF7DB 0%, #FFEEB3 100%);">
  131. <img src="/Millions/img/bigsmall/light_effect_1.png" class="absolute top-0 left-0 w-full opacity-60 pointer-events-none" alt="" />
  132. <img src="/Millions/img/bigsmall/light_effect_2.png" class="absolute bottom-12 left-0 w-full opacity-60 pointer-events-none" alt="" />
  133. <div class="flex flex-col items-center pt-4 pb-3 px-3 relative z-10 h-full justify-between">
  134. <div class="flex flex-col items-center w-full">
  135. <div class="h-[34px] flex items-center justify-center">
  136. <div class="text-[40px] font-[800] leading-none italic" style="-webkit-text-stroke: 1px #000; text-shadow: 1px 2px 2px rgba(0,0,0,0.15); color: @(isBigSmall ? "#FF4157" : "#B33BD0");">@(isBigSmall ? "Small" : "Even")</div>
  137. </div>
  138. <div class="text-[11px] font-medium text-gray-500 mt-1 h-[28px] text-center leading-tight">
  139. @(isBigSmall ? "13 number from" : "Even numbers") <br/> <b>@(isBigSmall ? "01-40" : "0, 2, 4, 6, 8")</b>
  140. </div>
  141. </div>
  142. <div class="flex items-center justify-center -space-x-2 my-2">
  143. @if (isBigSmall) {
  144. <img src="/Millions/img/bigsmall/ball_5_blue.png" class="w-12 h-12 relative z-[1]" alt="5" />
  145. <img src="/Millions/img/bigsmall/ball_1_big.png" class="w-16 h-16 relative z-[2]" alt="1" />
  146. <img src="/Millions/img/bigsmall/ball_8_pink.png" class="w-12 h-12 relative z-[1]" alt="8" />
  147. } else {
  148. <img src="/Millions/img/oddeven/ball_66.png" class="w-12 h-12 relative z-[1]" alt="66" />
  149. <img src="/Millions/img/oddeven/ball_68.png" class="w-16 h-16 relative z-[2]" alt="68" />
  150. <img src="/Millions/img/oddeven/ball_88.png" class="w-12 h-12 relative z-[1]" alt="88" />
  151. }
  152. </div>
  153. <button class="bigsmall-btn w-full py-2.5 rounded-xl font-black text-[15px] transition-all shadow-md"
  154. style="background: @themeColor; color: white;">@Lang.millions_select</button>
  155. </div>
  156. </div>
  157. </div>
  158. <!-- You Choose + Prize Section -->
  159. <div class="px-5 pt-6 flex flex-col items-center gap-4">
  160. <div class="flex flex-col items-center">
  161. <span class="text-[15px] font-medium text-black">@Lang.millions_you_choose</span>
  162. <span id="choiceDisplay" class="text-[42px] font-[800] leading-tight" style="-webkit-text-stroke: 1px #000;">—</span>
  163. </div>
  164. <div class="flex flex-col items-center">
  165. <span class="text-[18px] font-medium text-black">@Lang.millions_prize_if_win</span>
  166. <div class="flex items-baseline gap-1">
  167. <span class="text-[28px] font-black text-black">@prizeAmount</span>
  168. <span class="text-[14px] font-black text-[#E56B23]">HTG</span>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. <!-- Bottom Action Bar -->
  174. <div class="p-4 bg-white border-t border-gray-200 z-[70] shadow-[0px_-4px_10px_rgba(0,0,0,0.03)] absolute bottom-0 w-full left-0">
  175. <div class="flex items-center justify-between">
  176. <div class="flex flex-col">
  177. <div class="flex items-center gap-1.5 mb-0.5">
  178. <span class="text-[11px] text-black font-black uppercase">@Lang.total_ticket:</span>
  179. <span id="bsTotalTicketCount" class="text-[12px] font-black text-black">0</span>
  180. </div>
  181. <span class="text-[11px] text-black font-black uppercase">@Lang.millions_estimated_ticket_price</span>
  182. <div class="flex items-baseline gap-1">
  183. <span id="bsTotalPrice" class="text-[28px] font-black text-black">0</span>
  184. <span class="text-[13px] font-black" style="color: @themeColor">HTG</span>
  185. </div>
  186. </div>
  187. <button id="bsPaymentBtn" onclick="bsShowPayment()" class="text-white text-[20px] font-black px-10 py-3.5 rounded-xl shadow-lg active:scale-95 transition-all" style="background: @themeColor;">
  188. @Lang.millions_payment
  189. </button>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. }
  195. else
  196. {
  197. <!-- ==================== Basic Pick 10 / Odd-Even GAME UI ==================== -->
  198. <div class="millions-buy-ticket-page main-container animate__animated animate__fadeIn overflow-hidden">
  199. <!-- Header -->
  200. <div class="header">
  201. <button onclick="location.href='@Url.Action("GameHome", "Home")'" class="back-btn" type="button">
  202. <i class="fa-solid fa-arrow-left"></i>
  203. </button>
  204. <div class="header-title">
  205. @if (Model.termType == Constants.PIC10_BASIC_CODE) { <text>Basic Pick 10</text> }
  206. else if (Model.termType == Constants.Millions_CODE) { <text>Millions</text> }
  207. else { @Lang.millions_odd_even }
  208. </div>
  209. </div>
  210. <div class="content-card">
  211. <!-- Sticky Term Info sub-header -->
  212. <div class="ticket-subheader">
  213. <div class="flex items-center justify-between">
  214. <div class="flex items-center gap-2 border border-[#E5E7EB] rounded-lg px-3 py-1.5 bg-gray-50">
  215. <i class="fa-regular fa-calendar text-[#0062FF] text-sm"></i>
  216. <span class="text-[12px] font-bold text-gray-700">@DateTime.Now.ToString("dddd, MMM dd, yyyy", System.Globalization.CultureInfo.InvariantCulture)</span>
  217. </div>
  218. <div class="flex items-center gap-1 ml-4 flex-1 justify-end">
  219. <span class="text-[12px] font-bold text-gray-400">@Lang.millions_round</span>
  220. <span class="text-[18px] font-black text-brown-main">#@(currentTerm?.id ?? "12459")</span>
  221. </div>
  222. </div>
  223. </div>
  224. <!-- Ticket Scrollable List Area -->
  225. <div id="ticketContainer" class="ticket-scroll-area p-4 flex flex-col gap-6 bg-[#F5F5F5] pb-6">
  226. @for (int i = 1; i <= 2; i++)
  227. {
  228. <div class="ticket-card relative group active:bg-gray-50 transition-colors cursor-pointer animate__animated animate__fadeIn">
  229. <button onclick="removeEntry(this)" class="absolute -right-2 top-2 w-7 h-7 bg-[#0062FF] text-white rounded-full flex items-center justify-center text-[11px] shadow-sm z-[10] hover:bg-red-600 transition-all border-2 border-white">
  230. <i class="fa-solid fa-xmark"></i>
  231. </button>
  232. <div class="absolute left-2 top-4 w-9 h-9 rounded-full border-[3px] border-white flex items-center justify-center text-white font-black text-sm shadow-md ticket-index">@i</div>
  233. <div class="flex flex-col gap-1 pl-8">
  234. <span class="text-[16px] font-extrabold text-[#333]">@Lang.millions_select_10_lucky_numbers</span>
  235. <div class="flex items-start gap-4">
  236. <div class="grid grid-cols-5 gap-y-1 gap-x-2 flex-1">
  237. @for (int j = 0; j < (Model.termType == Constants.PIC10_BASIC_CODE ? 10 : (Model.termType == Constants.Millions_CODE ? 6 : 15)); j++)
  238. {
  239. <div class="ball-circle ball-empty"></div>
  240. }
  241. </div>
  242. <div class="w-[108px] action-area flex flex-col gap-2">
  243. <button onclick="randomizeTicket(this)" class="rand-btn w-full bg-[#2B83F2] text-white flex items-center justify-center gap-2 py-2 rounded-xl font-extrabold text-[11px] shadow-sm active:scale-95 transition-all">
  244. <i class="fa-solid fa-arrows-rotate text-[10px]"></i> @Lang.Random
  245. </button>
  246. <div class="edit-delete-group hidden flex flex-col gap-2">
  247. <button onclick="editFullTicket(this)" class="w-full bg-[#16A34A] text-white flex items-center justify-center gap-2 py-2 rounded-xl font-black text-[13px] shadow-sm active:scale-95 transition-all">
  248. <i class="fa-solid fa-pencil text-[12px]"></i> @Lang.millions_edit
  249. </button>
  250. <button onclick="clearTicket(this)" class="w-full bg-[#A855F7] text-white flex items-center justify-center gap-2 py-2 rounded-xl font-black text-[13px] shadow-sm active:scale-95 transition-all">
  251. <i class="fa-solid fa-trash-can text-[12px]"></i> @Lang.millions_delete
  252. </button>
  253. </div>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. }
  259. <div class="w-full pt-2" id="addButtonWrapper">
  260. <button onclick="addNewTicket()" class="w-fit min-w-[220px] mx-auto bg-[#2B83F2] text-white font-black text-md py-2.5 px-6 rounded-xl shadow-md border-b-[4px] border-[#1F66D6] active:translate-y-[1px] active:border-b-[1px] transition-all flex items-center justify-center gap-2">
  261. @Lang.millions_add_more_ticket
  262. </button>
  263. </div>
  264. <div class="h-4"></div>
  265. </div>
  266. <!-- Bottom Action Bar -->
  267. <div class="ticket-bottom-bar p-4 bg-white border-t border-gray-200 z-[70] shadow-[0px_-4px_10px_rgba(0,0,0,0.03)]">
  268. <div class="flex items-center justify-between">
  269. <div class="flex flex-col">
  270. <div class="flex items-center gap-1.5 mb-0.5">
  271. <span class="text-[11px] text-black font-black uppercase">@Lang.total_ticket:</span>
  272. <span id="totalTicketCount" class="text-[12px] font-black text-black">0</span>
  273. </div>
  274. <span class="text-[11px] text-black font-black uppercase">@Lang.millions_estimated_ticket_price</span>
  275. <div class="flex items-baseline gap-1">
  276. <span id="totalPrice" class="text-[28px] font-black text-black">0</span>
  277. <span class="text-[13px] font-black text-[#0062FF]">HTG</span>
  278. </div>
  279. </div>
  280. <button onclick="preparePayment()" class="bg-[#0062FF] text-white text-[20px] font-black px-10 py-3.5 rounded-xl shadow-[0px_6px_15px_rgba(238,0,51,0.25)] active:scale-95 transition-all">
  281. @Lang.millions_payment
  282. </button>
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287. }
  288. <!-- Order Summary Screen (from Figma) -->
  289. <div id="orderSummaryModal" class="hidden fixed inset-0 z-[150] bg-black/60 flex items-center justify-center p-0 font-bricolage backdrop-blur-[2px]">
  290. <div class="w-full h-full bg-white flex flex-col animate__animated animate__fadeInRight animate__faster shadow-2xl relative lg:max-w-[414px]">
  291. <!-- Header đồng bộ tuyệt đối -->
  292. <div class="buy-ticket-modal-header sticky top-0 z-[60]">
  293. <button onclick="hideOrderSummary()" class="back-btn" type="button">
  294. <i class="fa-solid fa-arrow-left"></i>
  295. </button>
  296. <div class="header-title">
  297. @if (Model.termType == Constants.PIC10_BASIC_CODE) { <text>Basic Pick 10</text> }
  298. else if (Model.termType == Constants.Millions_CODE) { <text>Millions</text> }
  299. else if (Model.termType == Constants.PIC10_BIGSMALL_CODE) { @Lang.millions_big_small }
  300. else { @Lang.millions_odd_even }
  301. </div>
  302. </div>
  303. <!-- Content Area: Split into scrollable list and static summary -->
  304. <div class="flex-1 flex flex-col min-h-0 bg-gray-50">
  305. <!-- Scrollable Ticket List -->
  306. <div class="flex-1 overflow-y-auto p-5 pb-2">
  307. <div class="flex justify-between items-center px-1 mb-3">
  308. <span class="text-[14px] font-bold text-gray-800">Selected Tickets</span>
  309. <span class="text-[14px] font-bold text-gray-800">@Lang.price</span>
  310. </div>
  311. <!-- Ticket List -->
  312. <div id="summaryTicketList" class="flex flex-col gap-4">
  313. <!-- Populated dynamically via JS -->
  314. </div>
  315. </div>
  316. <!-- Static Summary Info (Dates & Totals) -->
  317. <div class="shrink-0 bg-white p-5 space-y-4 border-t border-gray-100 shadow-[0px_-10px_20px_rgba(0,0,0,0.03)]">
  318. <!-- Dates Section -->
  319. <div class="grid grid-cols-2 gap-4">
  320. <div class="space-y-1">
  321. <span class="text-[11px] font-black text-[#0062FF] block text-center uppercase tracking-tight">@Lang.date_purchase</span>
  322. <div class="bg-white border border-gray-100 rounded-xl py-2.5 px-2 text-center font-black text-[11px] text-gray-700 shadow-sm">
  323. @DateTime.Now.ToString("dddd MMM dd, yyyy", System.Globalization.CultureInfo.InvariantCulture)
  324. </div>
  325. </div>
  326. <div class="space-y-1">
  327. <span class="text-[11px] font-black text-[#0062FF] block text-center uppercase tracking-tight">@Lang.draw_date</span>
  328. <div class="bg-white border border-gray-100 rounded-xl py-2.5 px-2 text-center font-black text-[11px] text-gray-700 shadow-sm" id="summaryResultDate">
  329. @{
  330. DateTime drawDate;
  331. bool isValidDate = DateTime.TryParse(currentTerm?.date_end, out drawDate);
  332. if (isValidDate) {
  333. @drawDate.ToString("dddd MMM dd, yyyy", System.Globalization.CultureInfo.InvariantCulture)
  334. } else {
  335. @:N/A
  336. }
  337. }
  338. </div>
  339. </div>
  340. </div>
  341. <!-- Totals Section -->
  342. <div class="space-y-1 px-1">
  343. <div class="flex justify-between items-center">
  344. <span class="text-[14px] font-bold text-black">@Lang.total_ticket</span>
  345. <span id="summaryTotalCount" class="text-[16px] font-black text-black">0</span>
  346. </div>
  347. <div class="flex justify-between items-center">
  348. <span class="text-[14px] font-bold text-black">@Lang.total_money</span>
  349. <div class="flex items-baseline gap-1">
  350. <span id="summaryTotalAmount" class="text-[32px] font-black text-black">0</span>
  351. <span class="text-[16px] font-black text-[#0062FF]">HTG</span>
  352. </div>
  353. </div>
  354. </div>
  355. </div>
  356. </div>
  357. <div class="shrink-0 p-4 bg-white border-t border-gray-100 grid grid-cols-2 gap-4 pb-8 shadow-[0px_-4px_20px_rgba(0,0,0,0.05)]">
  358. <button onclick="hideOrderSummary()" class="bg-[#FFB000] text-white py-2.5 rounded-2xl font-black text-[18px] shadow-lg shadow-orange-200 active:scale-95 transition-all uppercase tracking-wide">
  359. @Lang.reorder
  360. </button>
  361. <button id="finalPaymentBtn" onclick="confirmCheckout(this)" class="bg-[#0062FF] text-white py-2.5 rounded-2xl font-black text-[18px] shadow-lg shadow-red-200 active:scale-95 transition-all uppercase tracking-wide">
  362. @Lang.millions_payment
  363. </button>
  364. </div>
  365. </div>
  366. </div>
  367. <!-- OTP Verification Modal (V2 Design Overhaul - Matching Figma) -->
  368. <div id="otpModal" class="fixed inset-0 bg-black/80 backdrop-blur-sm z-[200] hidden items-center justify-center p-4">
  369. <!-- Outer container to hold the modal + external overflowing elements (like stars/glitter) -->
  370. <div class="relative w-full max-w-[360px] mt-6 animate__animated animate__zoomIn animate__faster">
  371. <!-- Glitter effect (external to the white box) -->
  372. <div class="absolute -top-[100px] -left-[10px] w-[380px] h-[160px] mix-blend-screen pointer-events-none z-0 overflow-visible opacity-90" style="background: url('/Millions/img/modal/otp_glitter.png') no-repeat center center; background-size: contain;"></div>
  373. <!-- The White Box -->
  374. <div class="bg-white rounded-[32px] w-full relative z-10 shadow-[0px_0px_30px_rgba(255,255,255,0.15)] pb-5 border border-yellow-500/20">
  375. <!-- Floating Coins from Figma -->
  376. <div class="absolute -top-[40px] -right-[10px] z-[80] w-[120px] pointer-events-none drop-shadow-2xl">
  377. <img src="/Millions/img/modal/otp_coins.png" class="w-full object-contain" />
  378. </div>
  379. <!-- Red Header Section -->
  380. <div class="relative w-full pt-4 pb-4 bg-[#0062FF] rounded-t-[32px] flex flex-col items-center justify-center z-20" style="border-bottom-left-radius: 50% 20px; border-bottom-right-radius: 50% 20px;">
  381. <h2 class="text-white text-[17px] sm:text-[20px] font-[900] uppercase tracking-wide relative z-10 font-bricolage drop-shadow-md text-center px-4 leading-tight w-[80%] mr-auto">@Lang.millions_confirm_purchase</h2>
  382. </div>
  383. <!-- Modal Body Content -->
  384. <div class="relative px-6 pt-3 flex flex-col items-center gap-3 z-10">
  385. <!-- Shield Icon: mix-blend-mode multiply to remove the white square background -->
  386. <div class="relative w-full flex justify-center mb-0 mt-1">
  387. <img src="/Millions/img/modal/otp_shield.png" alt="Success" class="w-[90px] object-contain">
  388. </div>
  389. <!-- Info Rows (Aligned exactly like screenshot) -->
  390. <div class="w-full flex flex-col gap-2 items-center mt-0">
  391. <!-- Ticket Info -->
  392. <div class="grid grid-cols-[90px_auto] items-center gap-3 w-full justify-center">
  393. <span class="text-[15px] font-bold text-[#555] text-right font-bricolage">@Lang.millions_ticket</span>
  394. <div id="otpTicketTypeContainer" class="flex justify-start">
  395. <img id="otpTicketTypeImg" src="/Millions/img/even_text.png" class="h-6 object-contain drop-shadow-sm" />
  396. </div>
  397. </div>
  398. <!-- Amount Info -->
  399. <div class="grid grid-cols-[90px_auto] items-center gap-3 w-full justify-center">
  400. <span class="text-[15px] font-bold text-[#555] text-right font-bricolage">@Lang.millions_amount</span>
  401. <div class="flex items-baseline gap-1.5 justify-start">
  402. <span id="otpTotalAmount" class="text-[22px] font-[900] text-black leading-none tracking-tight">1.000</span>
  403. <span class="text-[15px] font-[900] text-[#F37021] font-bricolage">HTG</span>
  404. </div>
  405. </div>
  406. </div>
  407. <p class="text-[14px] font-bold text-[#555] text-center px-4 leading-snug mt-0 font-bricolage">@Lang.millions_otp_instruction</p>
  408. <!-- 6-Slots OTP Grid (Large Gray Blocks) -->
  409. <div class="flex items-center justify-center gap-2 w-full mt-1 px-2" id="otpInputs">
  410. @for (int i = 1; i <= 6; i++)
  411. {
  412. <input type="tel" maxlength="1" id="otp@(i)"
  413. oninput="moveToNext(this, '@(i < 6 ? "otp" + (i + 1) : "")')"
  414. class="w-[42px] h-[48px] bg-[#757575] rounded-[10px] text-white text-[26px] font-bold text-center appearance-none focus:bg-[#555] focus:scale-[1.03] focus:ring-2 focus:ring-[#0062FF]/50 transition-all outline-none shadow-inner otp-slot"
  415. placeholder="-">
  416. }
  417. </div>
  418. <!-- OTP Error Message -->
  419. <p id="otpError" class="text-[#0062FF] font-bold text-[14px] text-center mb-1 hidden animate__animated animate__shakeX"></p>
  420. <!-- Timer & Resend -->
  421. <div class="flex flex-col items-center gap-1 mt-0">
  422. <span id="otpTimer" class="text-[15px] font-black text-[#0062FF] font-bricolage">60s</span>
  423. <button id="resendOtpBtn" onclick="sendOtpRequest()" class="hidden text-[14px] font-black text-[#0A9800] underline decoration-solid underline-offset-[3px] transition-all hover:text-[#087a00] disabled:opacity-40 disabled:no-underline font-bricolage">@Lang.millions_request_new_otp</button>
  424. </div>
  425. <!-- Action Buttons: Cancel / Confirm -->
  426. <div class="grid grid-cols-2 gap-3 w-full mt-2">
  427. <button onclick="hideOtpModal()" class="bg-[#FF0000] text-white py-[12px] rounded-[16px] font-[900] text-[17px] shadow-[0_8px_15px_rgba(255,0,0,0.2)] active:scale-95 transition-all tracking-wide">@Lang.millions_cancel</button>
  428. <button id="otpConfirmBtn" disabled onclick="finalizePurchase(this)" class="bg-[#0A9800] text-white py-[12px] rounded-[16px] font-[900] text-[17px] shadow-[0_8px_15px_rgba(10,152,0,0.2)] active:scale-95 transition-all tracking-wide disabled:opacity-50 disabled:grayscale disabled:cursor-not-allowed">@Lang.millions_confirm</button>
  429. </div>
  430. </div>
  431. </div>
  432. </div>
  433. </div>
  434. @section Scripts {
  435. <script>
  436. const maxBalls = @(Model.termType == Constants.PIC10_BASIC_CODE ? 10 : (Model.termType == Constants.Millions_CODE ? 6 : (Model.termType == Constants.PIC10_BIGSMALL_CODE ? 13 : 15)));
  437. function reindexTickets() {
  438. $(".ticket-card").each(function(index) {
  439. $(this).find(".ticket-index").text(index + 1);
  440. });
  441. }
  442. function removeEntry(btn) {
  443. var card = $(btn).closest('.ticket-card');
  444. card.addClass('animate__animated animate__fadeOutRight animate__faster');
  445. setTimeout(function() {
  446. card.remove();
  447. reindexTickets();
  448. updateTotalPrice();
  449. }, 300);
  450. }
  451. function randomizeTicket(btn) {
  452. var icon = $(btn).find('i');
  453. icon.addClass('fa-spin');
  454. var card = $(btn).closest('.ticket-card');
  455. var balls = card.find('.ball-circle');
  456. // Generate unique random numbers 1-80
  457. var numbers = [];
  458. while(numbers.length < maxBalls){
  459. var r = Math.floor(Math.random() * 80) + 1;
  460. if(numbers.indexOf(r) === -1) numbers.push(r);
  461. }
  462. numbers.sort((a, b) => a - b);
  463. // Update balls with staggered animation
  464. balls.each(function(index) {
  465. var ball = $(this);
  466. setTimeout(function() {
  467. var formattedNum = numbers[index].toString().padStart(2, '0');
  468. ball.removeClass('ball-empty').addClass('ball-filled').text(formattedNum);
  469. ball.addClass('animate__animated animate__flipInY');
  470. if(index === maxBalls - 1) {
  471. setTimeout(() => {
  472. icon.removeClass('fa-spin');
  473. // Replace button with Edit/Delete group
  474. $(btn).hide();
  475. card.find('.edit-delete-group').removeClass('hidden').addClass('animate__animated animate__fadeInRight animate__faster');
  476. updateTotalPrice();
  477. }, 300);
  478. }
  479. }, index * 40);
  480. });
  481. }
  482. function clearTicket(btn) {
  483. var card = $(btn).closest('.ticket-card');
  484. var balls = card.find('.ball-circle');
  485. balls.removeClass('ball-filled animate__animated animate__flipInY shadow-inner').addClass('ball-empty').text('');
  486. // Hide Edit/Delete group and show Rand button
  487. card.find('.edit-delete-group').addClass('hidden');
  488. card.find('.rand-btn').show().addClass('animate__animated animate__fadeInLeft animate__faster');
  489. updateTotalPrice();
  490. }
  491. // Open Number Picker Modal
  492. var activeBall = null;
  493. var activeTicketCard = null;
  494. var selectedNumbers = []; // For Edit mode, this will be an array of fixed size with nulls
  495. var isMultiMode = false;
  496. function editFullTicket(btn) {
  497. isMultiMode = true;
  498. activeTicketCard = $(btn).closest('.ticket-card');
  499. activeBall = null;
  500. // Initialize fixed slots for slot-based editing
  501. selectedNumbers = new Array(maxBalls).fill(null);
  502. let existing = [];
  503. activeTicketCard.find('.ball-filled').each(function() {
  504. var num = $(this).text().trim();
  505. if(num) existing.push(num);
  506. });
  507. // Initial fill from left to right
  508. existing.forEach((num, idx) => {
  509. if(idx < maxBalls) selectedNumbers[idx] = num;
  510. });
  511. openNumberPicker(true);
  512. }
  513. function openNumberPicker(isMulti) {
  514. var modal = $("#numberPickerModal");
  515. var grid = $("#numberGrid");
  516. var title = $("#modalTitle");
  517. var countArea = $(".selection-count-area");
  518. var confirmBtn = $("#confirmBtn");
  519. grid.empty();
  520. if (isMulti) {
  521. title.text("Edit Ticket");
  522. countArea.removeClass('hidden');
  523. confirmBtn.removeClass('hidden').text("@Lang.confirm");
  524. } else {
  525. title.text("Pick Number");
  526. countArea.addClass('hidden');
  527. confirmBtn.removeClass('hidden').text("@Lang.confirm");
  528. // Single mode logic is handled by setting selectedNumbers previously or here
  529. }
  530. updateSelectionCount();
  531. liveUpdateTicket();
  532. // Focus card
  533. if (activeTicketCard && activeTicketCard.length) {
  534. var container = $("#ticketContainer");
  535. var scrollPos = activeTicketCard.offset().top - container.offset().top + container.scrollTop();
  536. container.stop().animate({ scrollTop: scrollPos - 15 }, 500);
  537. }
  538. // Populate Grid
  539. for (var i = 1; i <= 80; i++) {
  540. var formatted = i.toString().padStart(2, '0');
  541. var isSelected = selectedNumbers.includes(formatted);
  542. var btnClass = isSelected
  543. ? 'bg-[#0062FF] text-white shadow-md scale-105 active-num'
  544. : 'bg-white text-gray-700 hover:bg-gray-100 border border-gray-100';
  545. grid.append(`<button type="button" class="num-btn w-8 h-8 rounded-full font-black text-[11px] transition-all focus:outline-none flex items-center justify-center ${btnClass}">${formatted}</button>`);
  546. }
  547. // Cleanup old listeners and add new one to the grid (event delegation)
  548. grid.off('click', '.num-btn').on('click', '.num-btn', function(e) {
  549. e.preventDefault();
  550. var $btn = $(this);
  551. var picked = $btn.text().trim();
  552. if (isMultiMode) {
  553. if (selectedNumbers.includes(picked)) {
  554. // Remove
  555. let idx = selectedNumbers.indexOf(picked);
  556. if (idx !== -1) selectedNumbers[idx] = null;
  557. $btn.removeClass('bg-[#0062FF] text-white shadow-md scale-105 active-num').addClass('bg-white text-gray-700 border border-gray-100');
  558. } else {
  559. // Add
  560. let firstEmpty = selectedNumbers.indexOf(null);
  561. if (firstEmpty !== -1) {
  562. selectedNumbers[firstEmpty] = picked;
  563. $btn.addClass('bg-[#0062FF] text-white shadow-md scale-105 active-num').removeClass('bg-white text-gray-700 border border-gray-100');
  564. }
  565. }
  566. liveUpdateTicket();
  567. } else {
  568. // Single Select mode
  569. var exists = false;
  570. if (activeTicketCard) {
  571. activeTicketCard.find('.ball-filled').each(function() {
  572. if (activeBall && this !== activeBall[0] && $(this).text().trim() === picked) {
  573. exists = true;
  574. }
  575. });
  576. }
  577. if (exists) {
  578. if (typeof showNotification === "function") {
  579. showNotification("Number already selected", "warning");
  580. }
  581. return;
  582. }
  583. grid.find('.num-btn').removeClass('bg-[#0062FF] text-white shadow-md scale-105 active-num').addClass('bg-white text-gray-700 border border-gray-100');
  584. selectedNumbers = [picked];
  585. $btn.addClass('bg-[#0062FF] text-white shadow-md scale-105 active-num').removeClass('bg-white text-gray-700 border border-gray-100');
  586. }
  587. updateSelectionCount();
  588. });
  589. modal.removeClass('hidden').addClass('flex');
  590. modal.find('.modal-content').removeClass('animate__zoomOut').addClass('animate__zoomIn');
  591. }
  592. function updateSelectionCount() {
  593. var count = selectedNumbers.filter(n => n !== null && n !== "").length;
  594. $("#selectionCount").text(count);
  595. $("#maxSelectionCount").text(maxBalls);
  596. var isValid = isMultiMode ? (count === maxBalls) : (count === 1);
  597. if (isValid) {
  598. $("#confirmBtn").prop('disabled', false).removeClass('opacity-50 cursor-not-allowed').addClass('cursor-pointer');
  599. } else {
  600. $("#confirmBtn").prop('disabled', true).addClass('opacity-50 cursor-not-allowed').removeClass('cursor-pointer');
  601. }
  602. }
  603. function liveUpdateTicket() {
  604. if (!activeTicketCard) return;
  605. var balls = activeTicketCard.find('.ball-circle');
  606. if (isMultiMode) {
  607. // Update Ticket Card balls
  608. for(var i=0; i < maxBalls; i++){
  609. var val = selectedNumbers[i];
  610. if (i < balls.length) {
  611. var tBall = $(balls[i]);
  612. if (val) {
  613. tBall.removeClass('ball-empty').addClass('ball-filled').text(val);
  614. } else {
  615. tBall.removeClass('ball-filled').addClass('ball-empty').text('');
  616. }
  617. }
  618. }
  619. // Toggle Rand/Edit button visibility
  620. if (selectedNumbers.filter(n => n !== null && n !== "").length > 0) {
  621. activeTicketCard.find('.rand-btn').hide();
  622. activeTicketCard.find('.edit-delete-group').removeClass('hidden').show();
  623. } else {
  624. activeTicketCard.find('.rand-btn').show();
  625. activeTicketCard.find('.edit-delete-group').addClass('hidden');
  626. }
  627. updateTotalPrice();
  628. }
  629. }
  630. // All immediate jQuery event bindings must wait for DOM + jQuery to be ready
  631. document.addEventListener("DOMContentLoaded", function() {
  632. // Click on a ball (filled or empty) to pick numbers
  633. $(document).on('click', '.ball-filled, .ball-empty', function() {
  634. isMultiMode = false;
  635. activeBall = $(this);
  636. activeTicketCard = activeBall.closest('.ticket-card');
  637. var val = activeBall.text().trim();
  638. selectedNumbers = val ? [val] : [];
  639. openNumberPicker(false);
  640. });
  641. updateTotalPrice();
  642. // Confirm button handler
  643. $(document).off('click', '#confirmBtn').on('click', '#confirmBtn', function(e) {
  644. e.preventDefault();
  645. // Check non-null count
  646. var count = selectedNumbers.filter(n => n !== null && n !== "").length;
  647. if (count === 0) return;
  648. if (isMultiMode && activeTicketCard && activeTicketCard.length > 0) {
  649. // Collect and sort for final storage/display (lottery numbers are usually sorted)
  650. var finalSorted = selectedNumbers.filter(n => n !== null && n !== "").sort((a, b) => parseInt(a) - parseInt(b));
  651. var balls = activeTicketCard.find('.ball-circle');
  652. balls.removeClass('ball-filled').addClass('ball-empty').text('');
  653. finalSorted.forEach((num, index) => {
  654. if (index < balls.length) {
  655. $(balls[index]).removeClass('ball-empty').addClass('ball-filled').text(num);
  656. $(balls[index]).addClass('animate__animated animate__pulse');
  657. setTimeout(() => $(balls[index]).removeClass('animate__animated animate__pulse'), 500);
  658. }
  659. });
  660. activeTicketCard.find('.rand-btn').hide();
  661. activeTicketCard.find('.edit-delete-group').removeClass('hidden').show();
  662. updateTotalPrice();
  663. } else if (!isMultiMode && activeBall && activeBall.length > 0) {
  664. // Single mode: Update only the active ball
  665. activeBall.text(selectedNumbers[0]).removeClass('ball-empty').addClass('ball-filled');
  666. activeBall.addClass('animate__animated animate__pulse');
  667. setTimeout(() => activeBall.removeClass('animate__animated animate__pulse'), 500);
  668. var card = activeBall.closest('.ticket-card');
  669. var filledBalls = card.find('.ball-filled').length;
  670. if (filledBalls > 0) {
  671. card.find('.rand-btn').hide();
  672. card.find('.edit-delete-group').removeClass('hidden').show();
  673. } else {
  674. card.find('.rand-btn').show();
  675. card.find('.edit-delete-group').addClass('hidden');
  676. }
  677. updateTotalPrice();
  678. }
  679. closeNumberPicker();
  680. });
  681. });
  682. function closeNumberPicker() {
  683. var modal = $("#numberPickerModal");
  684. modal.find('.modal-content').removeClass('animate__zoomIn').addClass('animate__zoomOut');
  685. setTimeout(() => {
  686. modal.removeClass('flex').addClass('hidden');
  687. // Reset state
  688. activeBall = null;
  689. activeTicketCard = null;
  690. }, 200);
  691. }
  692. function updateTotalPrice() {
  693. var filledTickets = 0;
  694. $(".ticket-card").each(function() {
  695. if ($(this).find(".ball-filled").length === maxBalls) {
  696. filledTickets++;
  697. }
  698. });
  699. const pricePerTicket = @(Model.termType == Constants.PIC10_BASIC_CODE ? "10" : (Model.termType == Constants.Millions_CODE ? "20" : "50"));
  700. $("#totalPrice").text(formatMoneyV2(filledTickets * pricePerTicket));
  701. $("#totalTicketCount").text(filledTickets);
  702. }
  703. function addNewTicket() {
  704. var container = $("#ticketContainer");
  705. var wrapper = $("#addButtonWrapper");
  706. var currentIndex = $(".ticket-card").length + 1;
  707. var ballsHtml = '';
  708. for (var i = 0; i < maxBalls; i++) {
  709. ballsHtml += '<div class="ball-circle ball-empty"></div>';
  710. }
  711. var ticketHtml = `
  712. <div class="ticket-card relative group active:bg-gray-50 transition-colors cursor-pointer animate__animated animate__fadeInUp animate__faster">
  713. <button onclick="removeEntry(this)" class="absolute -right-2 top-1 w-7 h-7 bg-[#0062FF] text-white rounded-full flex items-center justify-center text-[11px] shadow-sm z-[10] hover:bg-red-600 transition-all border-2 border-white">
  714. <i class="fa-solid fa-xmark"></i>
  715. </button>
  716. <div class="absolute left-2 top-4 w-9 h-9 rounded-full border-[3px] border-white flex items-center justify-center text-white font-black text-sm shadow-md ticket-index">${currentIndex}</div>
  717. <div class="flex flex-col gap-1 pl-8">
  718. <span class="text-[16px] font-extrabold text-[#333]">@Lang.millions_select_10_lucky_numbers</span>
  719. <div class="flex items-start gap-4">
  720. <div class="grid grid-cols-5 gap-y-1 gap-x-2 flex-1">
  721. ${ballsHtml}
  722. </div>
  723. <div class="w-[108px] action-area flex flex-col gap-2">
  724. <button onclick="randomizeTicket(this)" class="rand-btn w-full bg-[#2B83F2] text-white flex items-center justify-center gap-2 py-2 rounded-xl font-extrabold text-[11px] shadow-sm active:scale-95 transition-all">
  725. <i class="fa-solid fa-arrows-rotate text-[10px]"></i> @Lang.Random
  726. </button>
  727. <div class="edit-delete-group hidden flex flex-col gap-2">
  728. <button onclick="editFullTicket(this)" class="w-full bg-[#16A34A] text-white flex items-center justify-center gap-2 py-2 rounded-xl font-black text-[13px] shadow-sm active:scale-95 transition-all">
  729. <i class="fa-solid fa-pencil text-[12px]"></i> @Lang.millions_edit
  730. </button>
  731. <button onclick="clearTicket(this)" class="w-full bg-[#A855F7] text-white flex items-center justify-center gap-2 py-2 rounded-xl font-black text-[13px] shadow-sm active:scale-95 transition-all">
  732. <i class="fa-solid fa-trash-can text-[12px]"></i> @Lang.millions_delete
  733. </button>
  734. </div>
  735. </div>
  736. </div>
  737. </div>
  738. </div>
  739. `;
  740. $(ticketHtml).insertBefore(wrapper);
  741. container.animate({ scrollTop: container.prop("scrollHeight") }, 300);
  742. }
  743. // --- Order Summary Modal Logic ---
  744. // --- Payment Preparation & Order Summary Logic ---
  745. function preparePayment(event) {
  746. const isBSMode = @(Model.termType == Constants.PIC10_BIGSMALL_CODE || Model.termType == Constants.PIC10_ODDEVEN_CODE ? "true" : "false");
  747. const tickets = [];
  748. if (isBSMode) {
  749. if (!bsChoice) {
  750. showNotification("Please select a choice first.", "warning");
  751. return;
  752. }
  753. let bsCode = "";
  754. if ('@Model.termType' === '@Constants.PIC10_BIGSMALL_CODE') {
  755. bsCode = (bsChoice === 'big') ? "B" : "S";
  756. } else {
  757. bsCode = (bsChoice === 'big') ? "O" : "E"; // Odd = O, Even = E
  758. }
  759. tickets.push({
  760. code: bsCode,
  761. money: "50"
  762. });
  763. } else {
  764. $(".ticket-card").each(function() {
  765. const balls = $(this).find(".ball-filled");
  766. if (balls.length === maxBalls) {
  767. const selectedNumbers = [];
  768. balls.each(function() { selectedNumbers.push($(this).text().trim()); });
  769. const itemPrice = "@(Model.termType == Constants.PIC10_BASIC_CODE ? "10" : (Model.termType == Constants.Millions_CODE ? "20" : "50"))";
  770. tickets.push({
  771. code: selectedNumbers.join(','),
  772. money: itemPrice
  773. });
  774. }
  775. });
  776. if (tickets.length === 0) {
  777. showNotification("@Lang.millions_ticket_not_valid", "warning");
  778. return;
  779. }
  780. }
  781. const requestData = {
  782. gameId: "@Model.termType",
  783. ticket: tickets
  784. };
  785. const btn = event ? event.currentTarget : null;
  786. const originalText = btn ? btn.innerHTML : "@Lang.millions_payment";
  787. if (btn) {
  788. btn.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i> Loading...';
  789. btn.disabled = true;
  790. }
  791. $.ajax({
  792. url: subDomain + '@Url.Action("ConfirmTicketData", "Home")',
  793. type: 'POST',
  794. contentType: 'application/json',
  795. data: JSON.stringify(requestData),
  796. success: function(data) {
  797. if (btn) {
  798. btn.innerHTML = originalText;
  799. btn.disabled = false;
  800. }
  801. if (data.responseCode === "0") {
  802. showOrderSummary(data, tickets);
  803. } else {
  804. showNotification(data.responseMessage || "Confirmation failed", data.responseCode);
  805. }
  806. },
  807. error: function(err) {
  808. if (btn) {
  809. btn.innerHTML = originalText;
  810. btn.disabled = false;
  811. }
  812. showNotification("Network error occurred.", "warning");
  813. }
  814. });
  815. }
  816. let currentTransId = null;
  817. function showOrderSummary(apiData, localTickets) {
  818. currentTransId = apiData.transId;
  819. const summaryModal = $("#orderSummaryModal");
  820. const summaryList = $("#summaryTicketList");
  821. summaryList.empty();
  822. const displayTickets = (apiData && apiData.ticket) ? apiData.ticket : (localTickets || []);
  823. if (!displayTickets || !Array.isArray(displayTickets)) {
  824. console.warn("No tickets found to display in summary.");
  825. return;
  826. }
  827. displayTickets.forEach((t, index) => {
  828. const numbers = t.code.split(',');
  829. let contentHtml = '';
  830. if (numbers.length > 1) {
  831. let numbersBalls = '';
  832. numbers.forEach(n => {
  833. numbersBalls += `<div class="w-7 h-7 rounded-full flex items-center justify-center text-white text-[11px] font-black shadow-[0_4px_10px_rgba(186,15,33,0.3)]" style="background: linear-gradient(135deg, #FF3D63 0%, #E3132D 60%, #BA0F21 100%); border: 1px solid rgba(255, 255, 255, 0.3); text-shadow: 0px 1px 2px rgba(0,0,0,0.1); transition: transform 0.2s;">${n.trim()}</div>`;
  834. });
  835. contentHtml = `<div class="grid grid-cols-5 gap-y-2 relative z-10 px-2 justify-items-center">${numbersBalls}</div>`;
  836. } else {
  837. const isBS = @(Model.termType == Constants.PIC10_BIGSMALL_CODE ? "true" : "false");
  838. const isFirstChoice = (numbers[0] === 'B' || numbers[0] === 'O');
  839. const label = isFirstChoice ? (isBS ? "Big" : "Odd") : (isBS ? "Small" : "Even");
  840. const color = isFirstChoice ? (isBS ? "#A2FF00" : "#FFC700") : (isBS ? "#FF4157" : "#B33BD0");
  841. contentHtml = `<div class="w-full flex justify-center"><span class="text-[28px] font-black italic uppercase" style="-webkit-text-stroke: 1px #000; color: ${color};">${label}</span></div>`;
  842. }
  843. const itemHtml = `
  844. <div class="flex items-center gap-3">
  845. <div class="flex-1 rounded-2xl p-3 relative overflow-hidden flex flex-col gap-2 min-h-[80px] justify-center shadow-sm"
  846. style="background: white; border: 1.5px solid #0062FF;">
  847. ${contentHtml}
  848. </div>
  849. <div class="w-24 shrink-0 bg-white border border-gray-200 rounded-2xl p-2.5 flex items-center justify-center shadow-sm">
  850. <div class="flex items-baseline gap-0.5">
  851. <span class="text-[20px] font-black text-black">${formatMoneyV2(t.money)}</span>
  852. <span class="text-[12px] font-black text-[#0062FF]">HTG</span>
  853. </div>
  854. </div>
  855. </div>
  856. `;
  857. summaryList.append(itemHtml);
  858. });
  859. $("#summaryTotalCount").text(displayTickets.length);
  860. const totalMoney = apiData.totalMoneyPayment || apiData.totalMoney || "0";
  861. $("#summaryTotalAmount").text(formatMoneyV2(totalMoney));
  862. summaryModal.removeClass("hidden").addClass("flex");
  863. }
  864. function hideOrderSummary() {
  865. $("#orderSummaryModal").removeClass("flex").addClass("hidden");
  866. }
  867. function confirmCheckout(btn) {
  868. const originalText = $(btn).html();
  869. $(btn).prop('disabled', true).html('<i class="fa-solid fa-spinner fa-spin mr-2"></i>Processing...');
  870. // Trigger SendOTP API
  871. $.ajax({
  872. url: subDomain + '@Url.Action("SendOTP", "Home")',
  873. type: 'POST',
  874. success: function(data) {
  875. $(btn).prop('disabled', false).html(originalText);
  876. if (data.responseCode === "0") {
  877. showOtpModal();
  878. } else {
  879. showNotification(data.responseMessage || "Failed to send OTP", data.responseCode);
  880. }
  881. },
  882. error: function() {
  883. $(btn).prop('disabled', false).html(originalText);
  884. showNotification("Network error occurred.", "warning");
  885. }
  886. });
  887. }
  888. let otpInterval;
  889. function showOtpModal() {
  890. hideOrderSummary();
  891. $("#otpModal").removeClass("hidden").addClass("flex");
  892. $("#otpInputs input").val("");
  893. $("#otpConfirmBtn").prop('disabled', true);
  894. $("#otpError").addClass("hidden").text("");
  895. $("#otp1").focus();
  896. // Map game type to readable name & image
  897. let gameTypeStr = "@Model.termType";
  898. let displayName = gameTypeStr === "@Constants.Millions_CODE" ? "@Lang.millions" : "Basic Pick 10";
  899. let imgSrc = "";
  900. if (gameTypeStr === "@Constants.PIC10_BIGSMALL_CODE") {
  901. // Get the specific choice from summary
  902. let firstTicketText = $("#summaryTicketList").find("span.font-black").first().text().trim();
  903. if (firstTicketText) {
  904. displayName = firstTicketText.charAt(0).toUpperCase() + firstTicketText.slice(1).toLowerCase(); // Normalize to "Big" or "Small"
  905. } else {
  906. displayName = "Big / Small";
  907. }
  908. } else if (gameTypeStr === "@Constants.PIC10_ODDEVEN_CODE") {
  909. let firstTicketText = $("#summaryTicketList").find("span.font-black").first().text().trim();
  910. if (firstTicketText) {
  911. displayName = firstTicketText.charAt(0).toUpperCase() + firstTicketText.slice(1).toLowerCase(); // Normalize to "Odd" or "Even"
  912. } else {
  913. displayName = "Odd / Even";
  914. }
  915. }
  916. // Determine color based on game type
  917. let typeColorClass = "text-purple-700"; // default
  918. if (gameTypeStr === "@Constants.PIC10_BASIC_CODE") typeColorClass = "text-[#0062FF]";
  919. else if (gameTypeStr === "@Constants.Millions_CODE") typeColorClass = "text-[#0062FF]";
  920. else if (gameTypeStr === "@Constants.PIC10_BIGSMALL_CODE") typeColorClass = "text-[#0A9800]";
  921. else if (gameTypeStr === "@Constants.PIC10_ODDEVEN_CODE") typeColorClass = "text-[#9333ea]";
  922. // Hide image for now and use the beautiful text style as requested
  923. $("#otpTicketTypeImg").hide();
  924. $("#otpTicketTypeContainer").find("span").remove();
  925. $("#otpTicketTypeContainer").append(`<span class='text-[17px] font-[900] ${typeColorClass} italic'>${displayName}</span>`);
  926. $("#otpTotalAmount").text($("#summaryTotalAmount").text());
  927. startOtpTimer(60);
  928. }
  929. // Add backspace support for OTP inputs
  930. $("#otpInputs input").on("keyup", function() {
  931. let otp = "";
  932. $("#otpInputs input").each(function() { otp += $(this).val(); });
  933. $("#otpConfirmBtn").prop('disabled', otp.length < 6);
  934. });
  935. $("#otpInputs input").on("keydown", function(e) {
  936. if (e.key === "Backspace" && this.value.length === 0) {
  937. $(this).prev('input').focus();
  938. }
  939. });
  940. function hideOtpModal() {
  941. $("#otpModal").removeClass("flex").addClass("hidden");
  942. clearInterval(otpInterval);
  943. }
  944. function startOtpTimer(seconds) {
  945. let timeLeft = seconds;
  946. $("#resendOtpBtn").addClass("hidden");
  947. $("#otpTimer").removeClass("hidden").text(timeLeft + "s");
  948. clearInterval(otpInterval);
  949. otpInterval = setInterval(() => {
  950. timeLeft--;
  951. $("#otpTimer").text(timeLeft + "s");
  952. if (timeLeft <= 0) {
  953. clearInterval(otpInterval);
  954. $("#otpTimer").addClass("hidden");
  955. $("#resendOtpBtn").removeClass("hidden");
  956. }
  957. }, 1000);
  958. }
  959. function moveToNext(el, nextId) {
  960. if (el.value.length >= 1) {
  961. if (nextId) document.getElementById(nextId).focus();
  962. }
  963. let otp = "";
  964. $("#otpInputs input").each(function() { otp += $(this).val(); });
  965. $("#otpConfirmBtn").prop('disabled', otp.length < 6);
  966. // Clear error when typing
  967. $("#otpError").addClass("hidden").text("");
  968. }
  969. function sendOtpRequest() {
  970. // Re-trigger SendOTP
  971. $.ajax({
  972. url: subDomain + '@Url.Action("SendOTP", "Home")',
  973. type: 'POST',
  974. success: function(data) {
  975. if (data.responseCode === "0") {
  976. startOtpTimer(60);
  977. showNotification("OTP has been resent.", "success");
  978. } else {
  979. showNotification(data.responseMessage || "Failed to resend OTP", data.responseCode);
  980. }
  981. }
  982. });
  983. }
  984. function showReceiptSuccess(transId, amount, phone, totalTickets, drawDate) {
  985. // Setup data dynamically
  986. $("#receiptAmount").text(formatMoneyV2(amount) + " HTG");
  987. if(phone) $("#receiptPhone").text(phone);
  988. if(totalTickets) $("#receiptTotalTickets").text(totalTickets);
  989. if(drawDate) $("#receiptDrawDate").text(drawDate);
  990. let gameTypeStr = "@Model.termType";
  991. let displayName = "Basic Pick 10";
  992. if (gameTypeStr === "@Constants.PIC10_BIGSMALL_CODE") displayName = "@Lang.millions_big_small";
  993. else if (gameTypeStr === "@Constants.PIC10_ODDEVEN_CODE") displayName = "@Lang.millions_odd_even";
  994. else if (gameTypeStr === "@Constants.Millions_CODE") displayName = "Millions";
  995. $("#receiptGameType").text("@Lang.buy " + displayName);
  996. $("#receiptTicketCode").text("#" + transId);
  997. let choiceText = "-";
  998. if (gameTypeStr === "@Constants.PIC10_BIGSMALL_CODE" || gameTypeStr === "@Constants.PIC10_ODDEVEN_CODE") {
  999. choiceText = $("#summaryTicketList .flex.items-center span.font-black").first().text().trim();
  1000. } else {
  1001. choiceText = gameTypeStr === "@Constants.Millions_CODE" ? "Millions 6" : "PICK 10";
  1002. }
  1003. $("#receiptChoice").text(choiceText);
  1004. // Format current date "dd/MM/yyyy - HH:mm:ss"
  1005. let now = new Date();
  1006. let ds = now.getDate().toString().padStart(2, '0') + '/' + (now.getMonth() + 1).toString().padStart(2, '0') + '/' + now.getFullYear() + ' - ' + now.getHours().toString().padStart(2, '0') + ':' + now.getMinutes().toString().padStart(2, '0') + ':' + now.getSeconds().toString().padStart(2, '0');
  1007. $("#receiptTime").text(ds);
  1008. hideOtpModal();
  1009. $("#receiptSuccessModal").removeClass("hidden").addClass("flex");
  1010. }
  1011. function finalizePurchase(btn) {
  1012. let otpCode = "";
  1013. $("#otpInputs input").each(function() {
  1014. otpCode += $(this).val();
  1015. });
  1016. if (otpCode.length < 6) {
  1017. showNotification("Please enter full 6-digit OTP", "warning");
  1018. return;
  1019. }
  1020. const originalText = $(btn).html();
  1021. $(btn).prop('disabled', true).html('<i class="fa-solid fa-spinner fa-spin mr-2"></i> ...');
  1022. const finalData = {
  1023. transIdByTicket: currentTransId,
  1024. paymentCode: otpCode
  1025. };
  1026. // Call the unified backend action that verifies OTP and then buys the ticket
  1027. $.ajax({
  1028. url: subDomain + '@Url.Action("ConfirmBuyingTicketV2", "Home")',
  1029. type: 'POST',
  1030. contentType: 'application/json',
  1031. data: JSON.stringify(finalData),
  1032. success: function(res) {
  1033. $(btn).prop('disabled', false).html(originalText);
  1034. if (res.responseCode === "0" || res.responseCode === "0000") {
  1035. // Success: Show receipt Modal
  1036. showReceiptSuccess(res.orderId || currentTransId, $("#summaryTotalAmount").text(), "@(Model.userStatus?.msisdn ?? "-")", $("#summaryTotalCount").text(), "@(currentTerm?.date_random ?? "-")");
  1037. } else {
  1038. if (res.responseCode === "-2" || (res.responseMessage && res.responseMessage.includes("System is upgrading"))) {
  1039. hideOtpModal();
  1040. showNotification(res.responseMessage || "System is upgrading", res.responseCode);
  1041. } else {
  1042. $("#otpError").text(res.responseMessage || "Invalid OTP").removeClass("hidden");
  1043. $("#otpInputs input").val("");
  1044. $("#otp1").focus();
  1045. }
  1046. }
  1047. },
  1048. error: function() {
  1049. $(btn).prop('disabled', false).html(originalText);
  1050. showNotification("Network error occurred during payment completion.", "warning");
  1051. }
  1052. });
  1053. }
  1054. var systemUpgrading = false;
  1055. function showNotification(message, code) {
  1056. const msgEl = $("#notificationMessage");
  1057. const iconEl = $("#notificationModal img");
  1058. const btnEl = $("#notificationModal button");
  1059. msgEl.text(message);
  1060. if (code === "-2" || (message && message.includes("System is upgrading"))) {
  1061. systemUpgrading = true;
  1062. btnEl.text("@Lang.login");
  1063. } else {
  1064. systemUpgrading = false;
  1065. btnEl.text("OK");
  1066. }
  1067. // Toggle icon based on type (warning or success)
  1068. const warningIcon = '/Millions/img/modal/warning_icon.png';
  1069. const successIcon = '/Millions/img/modal/success_icon_v2.png';
  1070. const fallbackWarning = 'https://cdn-icons-png.flaticon.com/512/564/564619.png';
  1071. const fallbackSuccess = 'https://cdn-icons-png.flaticon.com/512/190/190411.png';
  1072. if (code === "-2" || code === "warning" || code === "error") {
  1073. iconEl.attr('src', warningIcon);
  1074. iconEl.attr('onerror', `this.src='${fallbackWarning}'`);
  1075. } else {
  1076. iconEl.attr('src', successIcon);
  1077. iconEl.attr('onerror', `this.src='${fallbackSuccess}'`);
  1078. }
  1079. $("#notificationModal").removeClass("hidden").addClass("flex");
  1080. }
  1081. function closeNotificationModal() {
  1082. $("#notificationModal").addClass("hidden").removeClass("flex");
  1083. if (systemUpgrading) {
  1084. window.location.href = subDomain + "/Account/Login";
  1085. }
  1086. }
  1087. // ==================== CARD SELECTION GAME LOGIC (BIG/SMALL / ODD/EVEN) ====================
  1088. var bsChoice = null; // 'big' or 'small' (reused as 'odd' or 'even')
  1089. const isBigSmall = @(Model.termType == Constants.PIC10_BIGSMALL_CODE ? "true" : "false");
  1090. const themeColor = isBigSmall ? "#0A9800" : "#AA3DC8";
  1091. const labelBig = isBigSmall ? "Big" : "Odd";
  1092. const labelSmall = isBigSmall ? "Small" : "Even";
  1093. const colorBig = isBigSmall ? "#A2FF00" : "#FFC700";
  1094. const colorSmall = isBigSmall ? "#FF4157" : "#B33BD0";
  1095. // Loclized text from resources
  1096. const langSelect = "@Lang.millions_select";
  1097. const langSelected = "@Lang.millions_selected";
  1098. function selectBigSmall(choice) {
  1099. bsChoice = choice;
  1100. var cardBig = document.getElementById('cardBig');
  1101. var cardSmall = document.getElementById('cardSmall');
  1102. var choiceDisplay = document.getElementById('choiceDisplay');
  1103. if (!cardBig || !cardSmall) return;
  1104. if (choice === 'big') {
  1105. // Highlight Big/Odd card with theme glow
  1106. cardBig.style.border = '2px solid ' + themeColor;
  1107. cardBig.style.boxShadow = '0px 0px 12px 0px ' + (isBigSmall ? 'rgba(162, 255, 0, 1)' : 'rgba(179, 59, 208, 0.6)');
  1108. cardBig.querySelector('.bigsmall-btn').textContent = langSelected;
  1109. cardBig.querySelector('.bigsmall-btn').style.background = '#333';
  1110. // Reset Small/Even card
  1111. cardSmall.style.border = '2px solid transparent';
  1112. cardSmall.style.boxShadow = 'none';
  1113. cardSmall.querySelector('.bigsmall-btn').textContent = langSelect;
  1114. cardSmall.querySelector('.bigsmall-btn').style.background = themeColor;
  1115. // Update display
  1116. if (choiceDisplay) {
  1117. choiceDisplay.textContent = labelBig;
  1118. choiceDisplay.style.color = colorBig;
  1119. choiceDisplay.style.webkitTextStroke = '1px #000';
  1120. }
  1121. } else {
  1122. // Highlight Small/Even card with theme glow
  1123. cardSmall.style.border = '2px solid ' + themeColor;
  1124. cardSmall.style.boxShadow = '0px 0px 12px 0px ' + (isBigSmall ? 'rgba(162, 255, 0, 1)' : 'rgba(179, 59, 208, 0.6)');
  1125. cardSmall.querySelector('.bigsmall-btn').textContent = langSelected;
  1126. cardSmall.querySelector('.bigsmall-btn').style.background = '#333';
  1127. // Reset Big/Odd card
  1128. cardBig.style.border = '2px solid transparent';
  1129. cardBig.style.boxShadow = 'none';
  1130. cardBig.querySelector('.bigsmall-btn').textContent = langSelect;
  1131. cardBig.querySelector('.bigsmall-btn').style.background = themeColor;
  1132. // Update display
  1133. if (choiceDisplay) {
  1134. choiceDisplay.textContent = labelSmall;
  1135. choiceDisplay.style.color = colorSmall;
  1136. choiceDisplay.style.webkitTextStroke = '1px #000';
  1137. }
  1138. }
  1139. $("#bsTotalTicketCount").text(1);
  1140. $("#bsTotalPrice").text(formatMoneyV2(50));
  1141. }
  1142. function bsShowPayment(e) {
  1143. preparePayment(e);
  1144. }
  1145. </script>
  1146. <!-- Number Picker Modal (Refined Bottom Sheet) -->
  1147. <div id="numberPickerModal" class="fixed inset-0 bg-black/10 z-[200] hidden items-end justify-center p-0 transition-all">
  1148. <div class="modal-content bg-white w-full md:max-w-[414px] mx-auto shadow-2xl animate__animated animate__slideInUp animate__faster rounded-t-[20px] overflow-hidden">
  1149. <div class="px-4 py-3 bg-[#0062FF] text-white flex justify-between items-center relative">
  1150. <div class="flex flex-col">
  1151. <h3 class="font-black text-[15px] uppercase tracking-wide" id="modalTitle">@Lang.Pick_Number</h3>
  1152. <div class="selection-count-area">
  1153. <span class="text-[10px] font-bold text-white/80 uppercase">Selected: <span id="selectionCount" class="text-white">0</span>/<span id="maxSelectionCount">10</span></span>
  1154. </div>
  1155. </div>
  1156. <button onclick="closeNumberPicker()" class="w-9 h-9 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 transition-all">
  1157. <i class="fa-solid fa-xmark text-lg"></i>
  1158. </button>
  1159. </div>
  1160. <style>
  1161. #numberGrid::-webkit-scrollbar { width: 3px; }
  1162. #numberGrid::-webkit-scrollbar-track { background: transparent; }
  1163. #numberGrid::-webkit-scrollbar-thumb { background: #FFD700; border-radius: 10px; }
  1164. #numberGrid { scrollbar-width: thin; scrollbar-color: #FFD700 transparent; }
  1165. </style>
  1166. <div class="p-1 px-2 grid grid-cols-10 gap-1.5 h-[160px] overflow-y-auto bg-gray-50 border-b" id="numberGrid">
  1167. <!-- 1-80 populated via JS -->
  1168. </div>
  1169. <div class="p-3 bg-white border-t flex gap-3">
  1170. <button onclick="closeNumberPicker()" class="flex-1 py-1 bg-gray-100 text-gray-600 rounded-lg font-black text-[12px] active:bg-gray-200 transition-all uppercase">
  1171. @Lang.millions_back
  1172. </button>
  1173. <button id="confirmBtn" class="hidden flex-[2] py-2 bg-[#0062FF] text-white rounded-lg font-black text-[13px] active:bg-[#CC002D] transition-all uppercase shadow-md">
  1174. @Lang.confirm
  1175. </button>
  1176. </div>
  1177. </div>
  1178. </div>
  1179. <div id="notificationModal" class="fixed inset-0 z-[300] bg-black/60 flex items-center justify-center hidden px-4 font-bricolage backdrop-blur-sm">
  1180. <div class="w-full max-w-[360px] bg-white rounded-[32px] overflow-hidden flex flex-col items-center px-6 pt-5 pb-6 animate__animated animate__zoomIn animate__faster shadow-2xl relative border border-white/50">
  1181. <!-- Alert Icon -->
  1182. <div class="w-full flex justify-center mb-2 mt-0">
  1183. <img src="/Millions/img/modal/success_icon_v2.png" class="w-full max-w-[240px] h-auto object-contain" alt="Notificaton icon" onerror="this.src='https://cdn-icons-png.flaticon.com/512/190/190411.png'" />
  1184. </div>
  1185. <!-- Message Area -->
  1186. <div class="px-2 text-center mb-5">
  1187. <p id="notificationMessage" class="text-black font-[800] text-[17px] leading-snug">
  1188. <!-- Message content -->
  1189. </p>
  1190. </div>
  1191. <!-- Action Button -->
  1192. <div class="w-full">
  1193. <button onclick="closeNotificationModal()" class="w-full bg-[#0062FF] text-white font-[900] text-[18px] py-[13px] rounded-[18px] shadow-[0_8px_20px_rgba(238,0,51,0.25)] active:scale-95 transition-all uppercase tracking-wide">
  1194. OK
  1195. </button>
  1196. </div>
  1197. </div>
  1198. </div>
  1199. <!-- Beautiful Success Receipt Modal (Matches Figma 161:3722) -->
  1200. <div id="receiptSuccessModal" class="fixed inset-0 z-[300] bg-black/80 hidden items-center justify-center px-4 font-bricolage backdrop-blur-md">
  1201. <div class="w-full max-w-[360px] bg-[#F9F9F9] rounded-[32px] overflow-hidden flex flex-col items-center px-6 pt-4 pb-5 shadow-2xl relative animate__animated animate__zoomIn animate__faster border border-white/50">
  1202. <!-- Confetti/Celebration background effect (Subtle removed) -->
  1203. <h2 class="text-[#534A4A] font-[800] text-[19px] tracking-tight relative z-10 w-full text-center mt-1">@Lang.millions_payment_successfully</h2>
  1204. <!-- Ticket / Success Graphic -->
  1205. <div class="relative w-full flex justify-center mt-2 mb-0 z-10 px-4">
  1206. <img src="/Millions/img/modal/success_icon_v2.png" alt="Success" class="w-full h-auto object-contain">
  1207. </div>
  1208. <h3 class="text-[#0A9800] font-[900] text-[20px] uppercase tracking-wide relative z-10">@Lang.success</h3>
  1209. <div class="w-full h-px border-t-[2px] border-dashed border-gray-300 my-3 relative z-10"></div>
  1210. <div class="w-full flex justify-between items-center mb-2 relative z-10 px-1">
  1211. <span class="text-[#534A4A] font-bold text-[14px]">@Lang.phone_number</span>
  1212. <span class="font-black text-[14px] text-gray-800" id="receiptPhone">-</span>
  1213. </div>
  1214. <div class="w-full flex justify-between items-center mb-2 relative z-10 px-1">
  1215. <span class="text-[#534A4A] font-bold text-[14px]">@Lang.millions_your_choice</span>
  1216. <span class="text-[#0062FF] font-[900] text-[15px] uppercase" id="receiptChoice">-</span>
  1217. </div>
  1218. <div class="w-full flex justify-between items-center mb-2 relative z-10 px-1">
  1219. <span class="text-[#534A4A] font-bold text-[14px]">@Lang.ticket_code</span>
  1220. <span class="font-black text-[13px] text-gray-800" id="receiptTicketCode">#</span>
  1221. </div>
  1222. <div class="w-full flex justify-between items-center mb-2 relative z-10 px-1">
  1223. <span class="text-[#534A4A] font-bold text-[14px]">@Lang.total_ticket</span>
  1224. <span class="font-black text-[14px] text-gray-800" id="receiptTotalTickets">-</span>
  1225. </div>
  1226. <div class="w-full flex justify-between items-center mb-2 relative z-10 px-1">
  1227. <span class="text-[#534A4A] font-bold text-[14px]">@Lang.millions_draw_date</span>
  1228. <span class="font-black text-[14px] text-gray-800" id="receiptDrawDate">-</span>
  1229. </div>
  1230. <div class="w-full flex justify-between items-center mb-1 relative z-10 px-1">
  1231. <span class="text-[#534A4A] font-bold text-[14px]">@Lang.total_payment</span>
  1232. <span class="text-[#0062FF] font-[900] text-[15px]" id="receiptAmount">0 HTG</span>
  1233. </div>
  1234. <div class="w-full h-px border-t-[2px] border-dashed border-gray-300 my-3 relative z-10"></div>
  1235. <div class="w-full flex justify-between items-center mb-2 relative z-10 px-1">
  1236. <span class="text-[#534A4A] font-bold text-[14px]">@Lang.time</span>
  1237. <span class="font-bold text-[13px] text-gray-600" id="receiptTime">00:00:00</span>
  1238. </div>
  1239. <div class="w-full flex justify-start items-center relative z-10 px-1 mt-1">
  1240. <span class="text-[#534A4A] font-bold text-[13px] italic text-gray-500" id="receiptGameType">@Lang.millions_buy_ticket_label</span>
  1241. </div>
  1242. <div class="text-[#534A4A] font-[900] text-[18px] relative z-10 text-center mt-3">@Lang.thank_you <span class="text-[#0062FF]">♥️</span></div>
  1243. <div class="w-full flex gap-2.5 mt-4 relative z-10">
  1244. <button type="button" onclick="window.location.href = subDomain + '@Url.Action("BuyTicket", "Home", new { termType = Model.termType })';" class="flex-1 min-w-0 border-2 border-[#0062FF] bg-white text-[#0062FF] font-[900] text-[15px] py-3 rounded-[18px] active:scale-95 transition-all uppercase tracking-wide shadow-sm">
  1245. @Lang.millions_continue
  1246. </button>
  1247. <button type="button" onclick="window.location.href = subDomain + '@Url.Action("GameHome", "Home", new { termType = Model.termType })';" class="flex-1 min-w-0 bg-[#0062FF] text-white font-[900] text-[15px] py-3 rounded-[18px] shadow-[0_8px_20px_rgba(0,98,255,0.25)] active:scale-95 transition-all uppercase tracking-wide">
  1248. @Lang.close
  1249. </button>
  1250. </div>
  1251. </div>
  1252. </div>
  1253. }