Browse Source

update fishnish

DESKTOP-LJ825E1\Admin 1 year ago
parent
commit
f2d082bd9a
35 changed files with 2384 additions and 1147 deletions
  1. 141 0
      Website/NEducation/Code/CheckTransactionRequest.cs
  2. 6 6
      Website/NEducation/Code/MiniGame.cs
  3. 40 0
      Website/NEducation/Code/SetLanguage.cs
  4. 23 15
      Website/NEducation/Content/Texts/ErrCode.Designer.cs
  5. 19 20
      Website/NEducation/Content/Texts/ErrCode.resx
  6. 152 107
      Website/NEducation/Content/Texts/Lang.Designer.cs
  7. 169 143
      Website/NEducation/Content/Texts/Lang.km.resx
  8. 163 143
      Website/NEducation/Content/Texts/Lang.resx
  9. 1 1
      Website/NEducation/Content/assets/js/home.js
  10. 5 2
      Website/NEducation/Content/assets/mini_game/css/minigame_main.css
  11. 690 0
      Website/NEducation/Content/assets/mini_game/js/function.js
  12. 151 139
      Website/NEducation/Content/assets/mini_game/js/minigame_function.js
  13. 88 36
      Website/NEducation/Controllers/HomeController.cs
  14. 26 1
      Website/NEducation/Controllers/LanguageController.cs
  15. 52 15
      Website/NEducation/Controllers/MiniGameController.cs
  16. 4 3
      Website/NEducation/Controllers/UtilsController.cs
  17. 297 92
      Website/NEducation/Controllers/WapController.cs
  18. 8 8
      Website/NEducation/Views/Common/CourseView.cshtml
  19. 12 9
      Website/NEducation/Views/Common/LessonView.cshtml
  20. 2 1
      Website/NEducation/Views/Ebook/Index.cshtml
  21. 25 22
      Website/NEducation/Views/Grammar/Index.cshtml
  22. 8 29
      Website/NEducation/Views/Home/EnglishIndex.cshtml
  23. 6 6
      Website/NEducation/Views/Home/_ModalRanking.cshtml
  24. 11 10
      Website/NEducation/Views/Individual/Index.cshtml
  25. 25 24
      Website/NEducation/Views/Listening/Index.cshtml
  26. 85 42
      Website/NEducation/Views/MiniGame/Index.cshtml
  27. 58 19
      Website/NEducation/Views/MiniGame/_RankingDataPartial.cshtml
  28. 5 9
      Website/NEducation/Views/MiniGame/play.cshtml
  29. 5 5
      Website/NEducation/Views/MiniGame/result.cshtml
  30. 64 202
      Website/NEducation/Views/Shared/_LayoutHome.cshtml
  31. 1 1
      Website/NEducation/Views/Shared/_LayoutLearning.cshtml
  32. 9 9
      Website/NEducation/Views/Shared/_LayoutMiniGame.cshtml
  33. 1 1
      Website/NEducation/Views/Shared/_LayoutVoca.cshtml
  34. 22 21
      Website/NEducation/Views/Voca/Index.cshtml
  35. 10 6
      Website/NEducation/Web.config

+ 141 - 0
Website/NEducation/Code/CheckTransactionRequest.cs

@@ -0,0 +1,141 @@
+
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace NEducation.Code
+{
+    public class CheckTransactionRequest : PostObj
+    {
+        public string token { get; set; }
+        public string session { get; set; }
+        public string wsCode { get; set; }
+        public WsRequest wsRequest { get; set; }
+
+        public CheckTransactionRequest() { }
+
+        public CheckTransactionRequest(string json) : this(JObject.Parse(json)) { }
+
+        public CheckTransactionRequest(JObject jObject)
+        {
+            if (jObject != null)
+            {
+                token = (string)jObject["token"];
+                session = (string)jObject["session"];
+                wsCode = (string)jObject["wsCode"];
+                wsRequest = jObject["wsRequest"] != null ? new WsRequest((JObject)jObject["wsRequest"]) : null;
+            }
+        }
+    }
+
+    public class WsRequest
+    {
+        public string msisdn { get; set; }
+        public string refId { get; set; }
+
+        public WsRequest() { }
+
+        public WsRequest(string json) : this(JObject.Parse(json)) { }
+
+        public WsRequest(JObject jObject)
+        {
+            if (jObject != null)
+            {
+                msisdn = (string)jObject["msisdn"];
+                refId = (string)jObject["refId"];
+            }
+        }
+    }
+
+    public class CheckTransactionResponse
+{
+    public string errorCode { get; set; }
+    public string errorMessage { get; set; }
+    public ResultData result { get; set; }
+
+    public CheckTransactionResponse() { }
+
+    public CheckTransactionResponse(string json)
+    {
+        try
+        {
+            var jObject = JObject.Parse(json);
+            errorCode = (string)jObject["errorCode"];
+            errorMessage = (string)jObject["errorMessage"];
+            result = jObject["result"] != null ? new ResultData((JObject)jObject["result"]) : null;
+        }
+        catch (Exception ex)
+        {
+            Console.WriteLine($"Error parsing CheckTransactionResponse: {ex.Message}");
+        }
+    }
+}
+
+public class ResultData
+{
+    public string errorCode { get; set; }
+    public string message { get; set; }
+    public string Object { get; set; }
+    public string userMsg { get; set; }
+    public WsResponse wsResponse { get; set; }
+
+    public ResultData() { }
+
+    public ResultData(JObject jObject)
+    {
+        try
+        {
+            if (jObject != null)
+            {
+                errorCode = (string)jObject["errorCode"];
+                message = (string)jObject["message"];
+                Object = (string)jObject["object"];
+                userMsg = (string)jObject["userMsg"];
+                wsResponse = jObject["wsResponse"] != null ? new WsResponse((JObject)jObject["wsResponse"]) : null;
+            }
+        }
+        catch (Exception ex)
+        {
+            Console.WriteLine($"Error parsing ResultData: {ex.Message}");
+        }
+    }
+}
+
+public class WsResponse
+{
+    public string code { get; set; }
+    public string message { get; set; }
+    public string price { get; set; }
+    public string msisdn { get; set; }
+    public string requestTime { get; set; }
+    public string content { get; set; }
+    public string objData1 { get; set; }
+
+    public WsResponse() { }
+
+    public WsResponse(JObject jObject)
+    {
+        try
+        {
+            if (jObject != null)
+            {
+                code = (string)jObject["code"];
+                message = (string)jObject["message"];
+                price = (string)jObject["price"];
+                msisdn = (string)jObject["msisdn"];
+                requestTime = (string)jObject["requestTime"];
+                content = (string)jObject["content"];
+                objData1 = (string)jObject["objData1"];
+            }
+        }
+        catch (Exception ex)
+        {
+            Console.WriteLine($"Error parsing WsResponse: {ex.Message}");
+        }
+    }
+}
+
+
+}

+ 6 - 6
Website/NEducation/Code/MiniGame.cs

@@ -9,9 +9,9 @@ namespace NEducation.Code
         public string Status { get; set; }
         public string Message { get; set; }
         public string TermID { get; set; }
-        public DateTime StartDate { get; set; }
-        public DateTime EndDate { get; set; }
-        public DateTime Sysdate { get; set; }
+        public string StartDate { get; set; }
+        public string EndDate { get; set; }
+        public string Sysdate { get; set; }
         public string TermStatus { get; set; }
         public string UserIsActive { get; set; }
         public string IsPlay { get; set; }
@@ -30,9 +30,9 @@ namespace NEducation.Code
                 Status = jObject["status"]?.ToString();
                 Message = jObject["message"]?.ToString();
                 TermID = jObject["termID"]?.ToString();
-                StartDate = DateTime.Parse(jObject["startDate"]?.ToString());
-                EndDate = DateTime.Parse(jObject["endDate"]?.ToString());
-                Sysdate = DateTime.Parse(jObject["sysdate"]?.ToString());
+                StartDate = jObject["startDate"]?.ToString();
+                EndDate = jObject["endDate"]?.ToString();
+                Sysdate = jObject["sysdate"]?.ToString();
                 TermStatus = jObject["termStatus"]?.ToString();
                 UserIsActive = jObject["userIsActive"]?.ToString();
                 IsPlay = jObject["isPlay"]?.ToString();

+ 40 - 0
Website/NEducation/Code/SetLanguage.cs

@@ -0,0 +1,40 @@
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace NEducation.Code
+{
+    public class SetLanguageRequest : PostObj
+    {
+        public String users { get; set; }
+        public String language { get; set; }
+        
+    }
+
+    public class SetLanguageResult
+    {
+        public string status { get; set; }
+        public string message { get; set; }
+
+        public string Message { get; set; }
+
+
+        
+
+
+        public SetLanguageResult() { }
+        public SetLanguageResult(string json)
+        {
+            JObject jObject = JObject.Parse(json);
+            if (jObject != null)
+            {
+                status = (string)jObject["status"];
+                message = (string)jObject["message"];
+                Message = (string)jObject["Message"];
+            }
+        }
+    }
+
+}

+ 23 - 15
Website/NEducation/Content/Texts/ErrCode.Designer.cs

@@ -19,7 +19,7 @@ namespace NEducation.Content.Texts {
     // class via a tool like ResGen or Visual Studio.
     // To add or remove a member, edit your .ResX file then rerun ResGen
     // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     public class ErrCode {
@@ -79,7 +79,7 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Err unknow.
+        ///   Looks up a localized string similar to Invalid Error.
         /// </summary>
         public static string ErrUnknown {
             get {
@@ -88,7 +88,7 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Incorrect OTP code/ OTP code expired.
+        ///   Looks up a localized string similar to Invalid OTP.
         /// </summary>
         public static string InvalidIOTP {
             get {
@@ -97,7 +97,7 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Login false because err user or pass or user have locked.
+        ///   Looks up a localized string similar to សូមពិនិត្យមើលគណនី ឬពាក្យសម្ងាត់របស់អ្នកម្តងទៀត។.
         /// </summary>
         public static string LoginFailure {
             get {
@@ -106,7 +106,7 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Not enough money.
+        ///   Looks up a localized string similar to អ្នកមិនមានសមតុល្យគ្រប់គ្រាន់ដើម្បីចុះឈ្មោះសម្រាប់សេវា MEdu ទេ។ សូមបញ្ចូលទឹកប្រាក់ និងចុះឈ្មោះដោយផ្ញើ ON EDU (ថ្លៃសេវា: 10c/day/រៀនវគ្គសិក្សាទាំងអស់) ទៅ 1540.
         /// </summary>
         public static string NotEnoughMoney {
             get {
@@ -115,7 +115,7 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to The new password is invalid. Password must is not null.
+        ///   Looks up a localized string similar to សូមបំពេញពាក្យសម្ងាត់.
         /// </summary>
         public static string PasswordInvalid {
             get {
@@ -124,7 +124,7 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Err type of regist. Type only is REGIST or CANCEL.
+        ///   Looks up a localized string similar to មិនអាចចុះឈ្មោះបានទេ។ បញ្ជាតែចុះឈ្មោះឬបោះបង់.
         /// </summary>
         public static string RegisterFailure {
             get {
@@ -133,7 +133,7 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Success.
+        ///   Looks up a localized string similar to អ្នកបានចុះឈ្មោះសេវាកម្ម MEdu ជាមួយនឹងការចុះឈ្មោះដំបូងដោយឥតគិតថ្លៃ នៅថ្ងៃបន្ទាប់ អ្នកនឹងត្រូវគិតថ្លៃ 10សេន/ថ្ងៃ/រៀនគ្រប់វគ្គសិក្សា។.
         /// </summary>
         public static string Success {
             get {
@@ -142,7 +142,7 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Sys err.
+        ///   Looks up a localized string similar to ប្រព័ន្ធមានបញ្ហា.
         /// </summary>
         public static string SystemErr {
             get {
@@ -151,7 +151,7 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Confirm OTP via USSD time out.
+        ///   Looks up a localized string similar to អស់ពេល OTP.
         /// </summary>
         public static string TimeoutOTP {
             get {
@@ -187,7 +187,7 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Regist false becuase user have registed before.
+        ///   Looks up a localized string similar to គណនីរបស់អ្នកមានរួចហើយ.
         /// </summary>
         public static string UserExisted {
             get {
@@ -196,7 +196,16 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to The old pass is invalid.
+        ///   Looks up a localized string similar to អ្នកប្រើប្រាស់ត្រូវបានចាក់សោ.
+        /// </summary>
+        public static string UserLocked {
+            get {
+                return ResourceManager.GetString("UserLocked", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to OTP ខុស.
         /// </summary>
         public static string WrongOldPass {
             get {
@@ -205,7 +214,7 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Invalid OTP code.
+        ///   Looks up a localized string similar to OTP ខុស.
         /// </summary>
         public static string WrongOTP {
             get {
@@ -214,13 +223,12 @@ namespace NEducation.Content.Texts {
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Wrong service id. Service id is not definition.
+        ///   Looks up a localized string similar to លេខសម្គាល់សេវាកម្មខុស។ លេខសម្គាល់សេវាកម្មមិនត្រូវបានកំណត់ទេ។.
         /// </summary>
         public static string WrongServiceID {
             get {
                 return ResourceManager.GetString("WrongServiceID", resourceCulture);
             }
         }
-
     }
 }

+ 19 - 20
Website/NEducation/Content/Texts/ErrCode.resx

@@ -118,61 +118,60 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <data name="CoinInvalid" xml:space="preserve">
-    <value>ປະເພດຂອງຫຼຽນບໍ່ຖືກຕ້ອງ: 0 = ຫຼຽນທີ່ສູນເສຍໄປ, 1 = ເພີ່ມຕື່ມອີກຫຼຽນໃນຍອດ</value>
+    <value>Type of coin invalid: 0=lost coin, 1= add more coin into balance</value>
   </data>
   <data name="ErrTypePackage" xml:space="preserve">
-    <value>ປະເພດຂໍ້ຜິດພາດ. ຊຸດພຽງແຕ່ 1,7,30</value>
+    <value>Err type Package. Package only is 1,7,30</value>
   </data>
   <data name="ErrUnknown" xml:space="preserve">
-    <value>ບໍ່ຮູ້ຂໍ້ຜິດພາດ</value>
+    <value>Invalid Error</value>
   </data>
   <data name="InvalidIOTP" xml:space="preserve">
-    <value>ລະຫັດ OTP ທີ່ບໍ່ຖືກຕ້ອງ / ລະຫັດ OTP ໝົດ ອາຍຸ</value>
+    <value>Invalid OTP</value>
   </data>
   <data name="LoginFailure" xml:space="preserve">
-    <value>ເຂົ້າສູ່ລະບົບບໍ່ຖືກຕ້ອງເພາະວ່າຜູ້ໃຊ້ຜິດພາດຫຼືຜ່ານຫລືຜູ້ໃຊ້ໄດ້ລັອກ</value>
+    <value>សូមពិនិត្យមើលគណនី ឬពាក្យសម្ងាត់របស់អ្នកម្តងទៀត។</value>
   </data>
   <data name="NotEnoughMoney" xml:space="preserve">
-    <value>ເງິນບໍ່ພຽງພໍ</value>
+    <value>អ្នកមិនមានសមតុល្យគ្រប់គ្រាន់ដើម្បីចុះឈ្មោះសម្រាប់សេវា MEdu ទេ។ សូមបញ្ចូលទឹកប្រាក់ និងចុះឈ្មោះដោយផ្ញើ ON EDU (ថ្លៃសេវា: 10c/day/រៀនវគ្គសិក្សាទាំងអស់) ទៅ 1540</value>
   </data>
   <data name="PasswordInvalid" xml:space="preserve">
-    <value>ລະຫັດລັບ ໃໝ່ ບໍ່ຖືກຕ້ອງ. ລະຫັດຜ່ານຕ້ອງບໍ່ແມ່ນ</value>
+    <value>សូមបំពេញពាក្យសម្ងាត់</value>
   </data>
   <data name="RegisterFailure" xml:space="preserve">
-    <value>ປະເພດຄວາມຜິດພາດຂອງການລົງທະບຽນ. ປະເພດແມ່ນ REGIST ຫຼື CANCEL ເທົ່ານັ້ນ</value>
+    <value>មិនអាចចុះឈ្មោះបានទេ។ បញ្ជាតែចុះឈ្មោះឬបោះបង់</value>
   </data>
   <data name="Success" xml:space="preserve">
-    <value>ຄວາມ​ສໍາ​ເລັດ</value>
+    <value>អ្នកបានចុះឈ្មោះសេវាកម្ម MEdu ជាមួយនឹងការចុះឈ្មោះដំបូងដោយឥតគិតថ្លៃ នៅថ្ងៃបន្ទាប់ អ្នកនឹងត្រូវគិតថ្លៃ 10សេន/ថ្ងៃ/រៀនគ្រប់វគ្គសិក្សា។</value>
   </data>
   <data name="SystemErr" xml:space="preserve">
-    <value>ຂໍ້ຜິດພາດຂອງລະບົບ</value>
+    <value>ប្រព័ន្ធមានបញ្ហា</value>
   </data>
   <data name="TimeoutOTP" xml:space="preserve">
-    <value>ຢືນຢັນ OTP ຜ່ານ USSD ໝົດ ເວລາ</value>
+    <value>អស់ពេល OTP</value>
   </data>
   <data name="TranCodeInvalid" xml:space="preserve">
-    <value>ລະຫັດສິນຄ້າບໍ່ຖືກຕ້ອງ: ADD_COIN, CHANGE_TOPUP_COIN, GAME_BUY_COIN, GAME_WIN_COIN</value>
+    <value>Tran code invalid: ADD_COIN, CHANGE_TOPUP_COIN, GAME_BUY_COIN, GAME_WIN_COIN</value>
   </data>
   <data name="TypeErr" xml:space="preserve">
-    <value>
-ຊ່ອງທາງປະເພດຄວາມຜິດພາດ. ຊ່ອງທາງເທົ່ານັ້ນແມ່ນ IVR, SMS, USSD, WEB</value>
+    <value>Err type channel. Channel only is IVR, SMS,USSD,WEB</value>
   </data>
   <data name="Unknown" xml:space="preserve">
-    <value>ບໍ່ຮູ້</value>
+    <value>Unknown</value>
   </data>
   <data name="UserExisted" xml:space="preserve">
-    <value>ລົງທະບຽນບໍ່ຖືກຕ້ອງເພາະຜູ້ໃຊ້ໄດ້ລົງທະບຽນກ່ອນ</value>
+    <value>គណនីរបស់អ្នកមានរួចហើយ</value>
   </data>
   <data name="UserLocked" xml:space="preserve">
-    <value>User is locked. Waiting for 5 minutes to login again</value>
+    <value>អ្នកប្រើប្រាស់ត្រូវបានចាក់សោ</value>
   </data>
   <data name="WrongOldPass" xml:space="preserve">
-    <value>ໃບຜ່ານແດນເກົ່າແມ່ນບໍ່ຖືກຕ້ອງ</value>
+    <value>OTP ខុស</value>
   </data>
   <data name="WrongOTP" xml:space="preserve">
-    <value>ລະຫັດ OTP ບໍ່ຖືກຕ້ອງ</value>
+    <value>OTP ខុស</value>
   </data>
   <data name="WrongServiceID" xml:space="preserve">
-    <value>id ບໍລິການທີ່ບໍ່ຖືກຕ້ອງ. id ຂອງບໍລິການບໍ່ແມ່ນ ຄຳ ນິຍາມ</value>
+    <value>លេខសម្គាល់សេវាកម្មខុស។ លេខសម្គាល់សេវាកម្មមិនត្រូវបានកំណត់ទេ។</value>
   </data>
 </root>

File diff suppressed because it is too large
+ 152 - 107
Website/NEducation/Content/Texts/Lang.Designer.cs


File diff suppressed because it is too large
+ 169 - 143
Website/NEducation/Content/Texts/Lang.km.resx


File diff suppressed because it is too large
+ 163 - 143
Website/NEducation/Content/Texts/Lang.resx


+ 1 - 1
Website/NEducation/Content/assets/js/home.js

@@ -73,7 +73,7 @@ function checkToRedirect(url, typeCourse) {
                 window.location.href = url;
             } else {
                 //show 
-                window.location.href = "/Home/LoginByUniId";
+                window.location.href = "/Home/Index";
                // $('#login-dialog').modal('show');
             }
         },

+ 5 - 2
Website/NEducation/Content/assets/mini_game/css/minigame_main.css

@@ -208,13 +208,15 @@
 
 .popup-content {
     background-color: #fff;
-    padding: 20px;
+    padding: 40px;
     border-radius: 10px;
     text-align: center;
     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
-    position: relative; /* This is necessary for positioning the close button */
+    position: relative; /* Ensure correct positioning for the close button */
+    z-index: 1010; /* Ensure content is on top of the close button */
 }
 
+
 .close-popup-button {
     position: absolute;
     top: 10px;
@@ -230,6 +232,7 @@
     text-align: center;
     cursor: pointer;
     line-height: 30px; /* Center the "X" vertically */
+    z-index: 1020;
 }
 
     .close-popup-button:hover {

+ 690 - 0
Website/NEducation/Content/assets/mini_game/js/function.js

@@ -0,0 +1,690 @@
+//const { Toast } = require("../lib/bootstrap/dist/js/bootstrap.bundle");
+
+var name_pack = "";
+
+function categoryClick(categoryid) {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/Game/ListGames?categoryId=' + categoryid;
+}
+
+function navigatorClick(navigator) {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/' + navigator;
+}
+
+function buttonHeaderClick(urlRequest) {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    console.log(urlRequest);
+    window.location.href = subDomain + '/' + urlRequest;
+}
+
+function routeBackOnNull() {
+    //startLoading();
+    window.history.back();
+}
+
+function routeBack(url) {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/' + url;
+}
+
+function changeLanguage() {
+    let subDomain = $("#subDomain").val();
+    let url = subDomain + '/Partial/Language';
+    startLoading();
+    $.ajax({
+        type: "POST",
+        url: url,
+        headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
+        data: {
+            "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
+        },
+        success: function (data) {
+            console.log(data);
+            stopLoading();
+            $('#contentModel').html(data);
+            $('#myContent').modal({ "backdrop": "static", keyboard: true });
+            $('#myContent').modal('show');
+        },
+        failure: function (data) {
+            stopLoading();
+        },
+        error: function (data) {
+            stopLoading();
+        }
+    });
+}
+
+function changeLanguageAction(lang) {
+    //let subDomain = $("#subDomain").val();
+    //window.location.href = subDomain + '/Home/SetCulture?lang=' + lang;
+    let subDomain = $("#subDomain").val();
+    let url = subDomain + '/Home/SetCulture';
+    startLoading();
+    $.ajax({
+        type: "POST",
+        url: url,
+        headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
+        data: {
+            "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
+            lang: lang
+        },
+        success: function (data) {
+            $('#myContent').modal('hide');
+            startLoading();
+            location.reload();
+        },
+        failure: function (data) {
+            stopLoading();
+        },
+        error: function (data) {
+            stopLoading();
+        }
+    });
+}
+
+function seeHistoryClick() {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/Account/History';
+}
+
+function seeRuleClick() {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/Account/Rule';
+}
+
+function rewardClick() {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/Account/GetRewards';
+}
+
+function updateProfileClick() {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/Account/UpdateProfile';
+}
+
+function changePassClick() {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/Account/ChangePass';
+}
+
+
+function logoutClick() {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/Home/Logout';
+}
+
+function playClick(gameId) {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/Play?gameId=' + gameId;
+}
+
+function convertPackageToName(pack) {
+    console.log("package name: " + pack);
+    if (pack === 'GTS_IWIN_KCQ_CamID_daily') {
+        return 'GTS_IWIN_KCQ_daily';
+    }
+    return pack;
+}
+
+function convertPackageToTurn(pack) {
+    console.log("package name: " + pack);
+    if (pack === 'Gts_ggame_dailygg1_camid') {
+        return '25';
+    } else if (pack === 'Gts-ggame_dailygg2_camid') {
+        return '50';
+    }
+    return 1;
+}
+
+function convertPackageToPrice(pack) {
+    console.log("package name: " + pack);
+    if (pack === 'Gts_ggame_dailygg1_camid') {
+        return '50000';
+    } else if (pack === 'Gts-ggame_dailygg2_camid') {
+        return '100000';
+    }
+    return 1;
+}
+
+function cancelV2Package(packageName) {
+    //let subDomain = $("#subDomain").val();
+    let url = '/Account/CancelPackage';
+    startLoading();
+    $.ajax({
+        type: "POST",
+        url: url,
+        headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
+        data: {
+            "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
+            packageName: packageName
+        },
+        success: function (data) {
+            if (data.code == "0") {
+                location.reload();
+            } else {
+                toastr.error(data.message);
+            }
+        },
+        failure: function (data) {
+            stopLoading();
+        },
+        error: function (data) {
+            stopLoading();
+        }
+    });
+}
+
+
+
+function showPackage() {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/Account/ListPackages';
+}
+
+function confirmAction(functionName, param) {
+    let subDomain = $("#subDomain").val();
+    let url = subDomain + '/Partial/Confirm';
+    startLoading();
+    $.ajax({
+        type: "POST",
+        url: url,
+        headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
+        data: {
+            "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
+            functionName: functionName,
+            param: param
+        },
+        success: function (data) {
+            console.log(data);
+            stopLoading();
+            $('#contentModel').html(data);
+            $('#myContent').modal({ "backdrop": "static", keyboard: true });
+            $('#myContent').modal('show');
+        },
+        failure: function (data) {
+            stopLoading();
+        },
+        error: function (data) {
+            stopLoading();
+        }
+    });
+}
+
+
+var packg = new Map();
+//var module = new Map();
+var name_pack = "";
+var action = "";
+packg.set("GTS_MEDU_Daily",
+    {
+        name: "GTS MEDU CamID Daily",
+        module: "GTS_MEDU_Daily",
+        regId: 5255,
+        cancelId: 5107,
+        price: 100000,
+        turn: 00,
+        content: "Would you like to register MEDU service 10c/day/learn all courses?",
+        name_pack: "GTS_MEDU_Daily",
+        contentCancel: "Are you sure to cancel MEDU daily package?"
+
+    });
+
+//module.set("GTS_MGame_DailyMG1", "GTS_MGAME_DAILYMG1");
+//module.set("GTS_MGame_DailyMG2", "GTS_MGAME_DAILYMG2");
+
+function buyMoreTurn(msisdn) {
+    //let newName = turn == 1 ? 'BKCQ1' : 'BKCQ3';
+    action = "BUY";
+    name_pack = "MG3";
+    let dataObject = {
+        "price": 30000,
+        "turn": 3,
+        "name": "MGame Daily MG3",
+        //"packageType": "DAILY_PACKAGES",
+        "content": "Would you like to buy more MGame playing turns (3cents/3playing times)?",
+        "msisdn": msisdn,
+        "module": "GTS_MGAME_DAILYMG1",
+        "name_pack": name_pack,
+        "id_pack": 5142
+    };
+
+    let data = JSON.stringify(dataObject);
+    console.log("data " + data);
+
+    console.log("cc.sys.os: " + cc.sys.os);
+    console.log("cc.sys.OS_ANDROID: " + cc.sys.OS_ANDROID);
+    console.log("cc.sys.OS_IOS: " + cc.sys.OS_IOS);
+
+    if (cc.sys.os == cc.sys.OS_ANDROID || cc.sys.os == cc.sys.OS_LINUX) {
+        console.log("luồng adnroid " + data);
+        //toastr.success("On ANDROID");
+        Android.sendDataBuyTurn(data);
+    } else if (cc.sys.os == cc.sys.OS_IOS) {
+        console.log("luồng ios " + data);
+        let d = "sendDataBuyTurn(" + data + ")";
+        console.log("new s: " + d);
+        //toastr.success("On IOS");
+        window.webkit.messageHandlers.log.postMessage("sendDataBuyTurn(" + data + ")");
+    }
+}
+
+function checkMsisdn(phoneNumber) {
+    let countryCode = "855";
+
+    if (!phoneNumber || phoneNumber.length === 0 || !/^\d+$/.test(phoneNumber)) {
+        return "";
+    } else if (phoneNumber.startsWith("0")) {
+        // 066200017
+        phoneNumber = countryCode + phoneNumber.substring(1);
+        return phoneNumber.trim();
+    } else if (phoneNumber.startsWith(countryCode)) {
+        return phoneNumber.trim();
+    }
+    return "";
+}
+
+function convertNamePackage(pack) {
+    console.log("package name: " + pack);
+    if (pack === 'GTS_MEDU_Daily') {
+        return 'GTS_MEDU_Daily';
+    } 
+    return pack;
+}
+
+function registerOnAppV2(msisdn, name) {
+    action = "REG";
+    let packInfo = packg.get(name);
+    name_pack = packInfo.name_pack;
+    let dataObject = {
+        "price": packInfo.price,
+        "turn": packInfo.turn,
+        "name": packInfo.name,
+        "content": packInfo.content,
+        "msisdn": msisdn,
+        "module": packInfo.module,
+        "name_pack": name_pack,
+        "id_pack": packInfo.regId
+    };
+
+    let data = JSON.stringify(dataObject);
+    console.log("data " + data);
+
+    console.log("cc.sys.os: " + cc.sys.os);
+    console.log("cc.sys.OS_ANDROID: " + cc.sys.OS_ANDROID);
+    console.log("cc.sys.OS_IOS: " + cc.sys.OS_IOS);
+
+    if (cc.sys.os == cc.sys.OS_ANDROID || cc.sys.os == cc.sys.OS_LINUX) {
+        console.log("luồng adnroid " + data);
+        //toastr.success("On ANDROID");
+        Android.sendDataBuyTurn(data);
+    } else if (cc.sys.os == cc.sys.OS_IOS) {
+        console.log("luồng ios " + data);
+        let d = "sendDataBuyTurn(" + data + ")";
+        console.log("new s: " + d);
+        //toastr.success("On IOS");
+        window.webkit.messageHandlers.log.postMessage("sendDataBuyTurn(" + data + ")");
+    }
+}
+
+function cancelPackage(msisdn, name) {
+    action = "CANCEL";
+    let packInfo = packg.get(name);
+    name_pack = packInfo.name_pack;
+    let dataObject = {
+        "price": 00,
+        "turn": 00,
+        "name": packInfo.name,
+        "packageType": "CANCEL_PACKAGES",
+        "content": "Are you sure want to cancel daily package?",
+        "msisdn": msisdn,
+        "module": packInfo.module,
+        "name_pack": name_pack,
+        "id_pack": packInfo.cancelId
+    };
+
+    let data = JSON.stringify(dataObject);
+    console.log("data " + data);
+
+    console.log("cc.sys.os: " + cc.sys.os);
+    console.log("cc.sys.OS_ANDROID: " + cc.sys.OS_ANDROID);
+    console.log("cc.sys.OS_IOS: " + cc.sys.OS_IOS);
+
+    if (cc.sys.os == cc.sys.OS_ANDROID || cc.sys.os == cc.sys.OS_LINUX) {
+        console.log("luồng adnroid " + data);
+        //toastr.success("On ANDROID");
+        Android.sendDataBuyTurn(data);
+    } else if (cc.sys.os == cc.sys.OS_IOS) {
+        console.log("luồng ios " + data);
+        let d = "sendDataBuyTurn(" + data + ")";
+        console.log("new s: " + d);
+        //toastr.success("On IOS");
+        window.webkit.messageHandlers.log.postMessage("sendDataBuyTurn(" + data + ")");
+    }
+
+}
+
+function registerOnApp() {
+
+    console.log("registerOnApp");
+    let phoneNumber = document.getElementById("phonenumber").value;
+
+    //let countryCode = configuration.get("country_code");
+
+    let msisdn = checkMsisdn(phoneNumber);
+
+    if (msisdn == "") {
+        toastr.error("Msisdn is invalid!");
+        return;
+    }
+
+    let package_Type = $("#packageName option:selected").attr("package-type");
+    let mType = null;
+
+    //let selectElement = document.getElementById("packageName");
+    if (package_Type == 1) {
+        mType = "DAILY_PACKAGES";
+    } else if (package_Type == 2) {
+        mType = "DETAIL_PACKAGES";
+    }
+
+    let mprice = $("#packageName option:selected").attr("package-price");
+    let turn = $("#packageName option:selected").attr("package-turm");
+    let name = $("#packageName option:selected").attr("package-name");
+
+    let content = "";
+    let module = "GGAME";
+
+    let turnInt = parseInt(turn);
+    let price = parseInt(mprice);
+
+    console.log("name_pack: " + name_pack);
+
+
+    name_pack = convertNamePackage($("#packageName option:selected").attr("value"));
+
+    console.log("name_pack after: " + name_pack);
+
+    let dataObject = {
+        "price": price,
+        "turn": turnInt,
+        "name": name,
+        "packageType": mType,
+        "content": "",
+        "msisdn": msisdn,
+        "module": module,
+        "name_pack": name_pack
+    };
+
+    let data = JSON.stringify(dataObject);
+    console.log("data " + data);
+
+    console.log("cc.sys.os: " + cc.sys.os);
+    console.log("cc.sys.OS_ANDROID: " + cc.sys.OS_ANDROID);
+    console.log("cc.sys.OS_IOS: " + cc.sys.OS_IOS);
+
+    if (cc.sys.os == cc.sys.OS_ANDROID || cc.sys.os == cc.sys.OS_LINUX) {
+        console.log("luồng adnroid " + data);
+        //toastr.success("On ANDROID");
+        Android.sendDataBuyTurn(data);
+    } else if (cc.sys.os == cc.sys.OS_IOS) {
+        console.log("luồng ios " + data);
+        let d = "sendDataBuyTurn(" + data + ")";
+        console.log("new s: " + d);
+        //toastr.success("On IOS");
+        window.webkit.messageHandlers.log.postMessage("sendDataBuyTurn(" + data + ")");
+    }
+}
+
+
+function onPaymentCallback(code, refId, turn, price, content, msisdn) {
+
+    console.log("name_pack: " + name_pack);
+    console.log("content: " + content);
+
+    //name_pack = $("#trongductest").attr("ppacktest");
+    //console.log("name_pack: " + name_pack);
+    //let subDomain = $("#subDomain").val();
+    let url = '/Wap/RegisterFromWap';
+    startLoading();
+    $.ajax({
+        type: "POST",
+        url: url,
+        headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
+        data: {
+            "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
+            action: action,
+            code: code,
+            refId: refId,
+            turn: turn,
+            price: price,
+            content: content,
+            msisdn: msisdn,
+            packg: convertPackageToName(name_pack)
+            //name_pack: name_pack == null || name_pack == "null" || name_pack == "" ? content : name_pack
+        },
+        success: function (data) {
+            stopLoading();
+            if (data.error == "0") {
+                toastr.success("Success");
+                $('#message-dialog').modal('show');
+                $('#message-content').html(data.error_content);
+                setTimeout(function () {
+                    location.reload();
+                }, 1000);
+
+            } else
+                toastr.error(data.error_content);
+        },
+        failure: function (data) {
+            stopLoading();
+        },
+        error: function (data) {
+            stopLoading();
+        }
+    });
+};
+
+
+
+function cancelPackageOnWap(packageCode) {
+    let subDomain = $("#subDomain").val();
+    let url = subDomain + '/Account/CancelOnWap?packageName=' + packageCode;
+    window.location.href = url;
+}
+
+
+function registerPackage(packageCode) {
+    let subDomain = $("#subDomain").val();
+    let url = subDomain + '/Account/RegisterOnWap?packageName=' + packageCode;
+    window.location.href = url;
+}
+
+function registerPackageActionClick() {
+    let otp = $("#otp").val();
+    let subDomain = $("#subDomain").val();
+    let url = subDomain + '/Account/RegisterPackageAction';
+    //startLoading();
+    $.ajax({
+        type: "POST",
+        url: url,
+        headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
+        data: {
+            "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
+            otp: otp
+        },
+        success: function (data) {
+            if (data.code == "0") {
+                startLoading();
+                location.reload();
+            } else {
+                document.getElementById("message").innerHTML = data.message;
+            }
+            //stopLoading();
+        },
+        failure: function (data) {
+            //stopLoading();
+        },
+        error: function (data) {
+            //stopLoading();
+        }
+    });
+}
+
+function updateProfileActionClick() {
+    let username = $("#username").val();
+    let birthday = $("#birthday").val();
+
+    console.log("username: " + username);
+    console.log("birthday: " + birthday);
+
+    var formData = new FormData();
+    formData.append('image', $('#user_avatar')[0].files[0]);
+    formData.append('username', username);
+    formData.append('birthday', birthday);
+    formData.append('__RequestVerificationToken', $('input[name=__RequestVerificationToken]').val());
+
+    let subDomain = $("#subDomain").val();
+    let url = subDomain + '/Account/UpdateProfileAction';
+    startLoading();
+    $.ajax({
+        type: "POST",
+        url: url,
+        headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
+        processData: false,
+        contentType: false,
+        data: formData,
+        success: function (data) {
+            if (data.code == "0") {
+                startLoading();
+                window.location.href = subDomain + "/" + "Account";
+            } else {
+                toastr(data.message);
+            }
+        },
+        failure: function (data) {
+            stopLoading();
+        },
+        error: function (data) {
+            stopLoading();
+        }
+    });
+}
+
+function forgotPassClick() {
+    let account = $("#account").val();
+
+    let subDomain = $("#subDomain").val();
+    let url = subDomain + '/Home/ForgotPass';
+    startLoading();
+    $.ajax({
+        type: "POST",
+        url: url,
+        headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
+        data: {
+            "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
+            phonenumber: account,
+        },
+        success: function (data) {
+            stopLoading();
+            if (data.code == "0")
+                toastr.success(data.message);
+            else
+                toastr.error(data.message);
+        },
+        failure: function (data) {
+            stopLoading();
+        },
+        error: function (data) {
+            stopLoading();
+        }
+    });
+}
+
+function newsReadClick(readId) {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/News/Read?readId=' + readId;
+}
+
+function loginClick() {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/Home/Login';
+}
+
+function registerClick() {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/Account/ListPackages';
+}
+
+
+function gameDetailClick(gameId) {
+    startLoading();
+    let subDomain = $("#subDomain").val();
+    window.location.href = subDomain + '/Game/GameDetail?gameId=' + gameId;
+}
+
+function rateClick(gameId) {
+    let subDomain = $("#subDomain").val();
+    let url = subDomain + '/Partial/RatePartial';
+    startLoading();
+    $.ajax({
+        type: "POST",
+        url: url,
+        headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
+        data: {
+            "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
+            gameId: gameId
+        },
+        success: function (data) {
+            stopLoading();
+            $('#contentModel').html(data);
+            $('#myContent').modal({ "backdrop": "static", keyboard: true });
+            $('#myContent').modal('show');
+        },
+        failure: function (data) {
+            stopLoading();
+        },
+        error: function (data) {
+            stopLoading();
+        }
+    });
+}
+
+function routeBackToApp() {
+    console.log("BACK TO APP");
+    window.location = "natcom://back";
+}
+
+
+function startLoading() {
+
+    $("#loading").removeClass('hide');
+}
+
+function stopLoading() {
+    console.log("stopLoading ...");
+    setTimeout(function () {
+        $("#loading").addClass('hide');
+    }, 10);
+}
+
+window.onpageshow = function (event) {
+    if (event.persisted) {
+        window.location.reload()
+    }
+};

+ 151 - 139
Website/NEducation/Content/assets/mini_game/js/minigame_function.js

@@ -39,145 +39,157 @@ function loadPlay() {
 
 
 
-var packg = new Map();
-//var module = new Map();
-var name_pack = "";
-var action = "";
-packg.set("GTS_MEDU_Daily",
-    {
-        name: "GTS MEDU Daily",
-        module: "GTS_MEDU_Daily",
-        regId: 5100,
-        cancelId: 5107,
-        price: 100000,
-        turn: 00,
-        content: "You have registered MEdu service with free first registration, next day you will be charge 10c/day/learn all courses. To cancel, send OFF EDU to 1540. Help: 1204",
-        name_pack: "GTS_MEDU_Daily",
-        contentCancel: "Are you sure to cancel MEDU daily package?"
-
-    });
-
-
-function registerOnAppV2(msisdn, name) {
-    action = "REG";
-    let packInfo = packg.get(name);
-    name_pack = packInfo.name_pack;
-    let dataObject = {
-        "price": packInfo.price,
-        "turn": packInfo.turn,
-        "name": packInfo.name,
-        "content": packInfo.content,
-        "msisdn": msisdn,
-        "module": packInfo.module,
-        "name_pack": name_pack,
-        "id_pack": packInfo.regId
-    };
-
-    let data = JSON.stringify(dataObject);
-    console.log("data " + data);
-
-    console.log("cc.sys.os: " + cc.sys.os);
-    console.log("cc.sys.OS_ANDROID: " + cc.sys.OS_ANDROID);
-    console.log("cc.sys.OS_IOS: " + cc.sys.OS_IOS);
-
-    if (cc.sys.os == cc.sys.OS_ANDROID || cc.sys.os == cc.sys.OS_LINUX) {
-        console.log("luồng adnroid " + data);
-        //toastr.success("On ANDROID");
-        Android.sendDataBuyTurn(data);
-    } else if (cc.sys.os == cc.sys.OS_IOS) {
-        console.log("luồng ios " + data);
-        let d = "sendDataBuyTurn(" + data + ")";
-        console.log("new s: " + d);
-        //toastr.success("On IOS");
-        window.webkit.messageHandlers.log.postMessage("sendDataBuyTurn(" + data + ")");
-    }
-}
-function cancelPackage(msisdn, name) {
-    action = "CANCEL";
-    let packInfo = packg.get(name);
-    name_pack = packInfo.name_pack;
-    let dataObject = {
-        "price": 00,
-        "turn": 00,
-        "name": packInfo.name,
-        "packageType": "CANCEL_PACKAGES",
-        "content": "Are you sure want to cancel daily package?",
-        "msisdn": msisdn,
-        "module": packInfo.module,
-        "name_pack": name_pack,
-        "id_pack": packInfo.cancelId
-    };
-
-    let data = JSON.stringify(dataObject);
-    console.log("data " + data);
-
-    console.log("cc.sys.os: " + cc.sys.os);
-    console.log("cc.sys.OS_ANDROID: " + cc.sys.OS_ANDROID);
-    console.log("cc.sys.OS_IOS: " + cc.sys.OS_IOS);
-
-    if (cc.sys.os == cc.sys.OS_ANDROID || cc.sys.os == cc.sys.OS_LINUX) {
-        console.log("luồng adnroid " + data);
-        //toastr.success("On ANDROID");
-        Android.sendDataBuyTurn(data);
-    } else if (cc.sys.os == cc.sys.OS_IOS) {
-        console.log("luồng ios " + data);
-        let d = "sendDataBuyTurn(" + data + ")";
-        console.log("new s: " + d);
-        //toastr.success("On IOS");
-        window.webkit.messageHandlers.log.postMessage("sendDataBuyTurn(" + data + ")");
-    }
-
-}
-
-
-
-function onPaymentCallback(code, refId, turn, price, content, msisdn) {
-
-    console.log("name_pack: " + name_pack);
-    console.log("content: " + content);
-
-    //name_pack = $("#trongductest").attr("ppacktest");
-    //console.log("name_pack: " + name_pack);
-    //let subDomain = $("#subDomain").val();
-    let url = '/Wap/RegisterFromWap';
-    startLoading();
-    $.ajax({
-        type: "POST",
-        url: url,
-        headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
-        data: {
-            "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
-            action: action,
-            code: code,
-            refId: refId,
-            turn: turn,
-            price: price,
-            content: content,
-            msisdn: msisdn,
-            packg: convertPackageToName(name_pack)
-            //name_pack: name_pack == null || name_pack == "null" || name_pack == "" ? content : name_pack
-        },
-        success: function (data) {
-            stopLoading();
-            if (data.error == "0") {
-                toastr.success("Success");
-
-                setTimeout(function () {
-                    location.reload();
-                }, 1000);
-
-            } else
-                toastr.error(data.content);
-        },
-        failure: function (data) {
-            stopLoading();
-        },
-        error: function (data) {
-            stopLoading();
-        }
-    });
-};
-
+//var packg = new Map();
+////var module = new Map();
+//var name_pack = "";
+//var action = "";
+//packg.set("GTS_MEDU_Daily",
+//    {
+//        name: "GTS MEDU CamID Daily",
+//        module: "GTS_MEDU_CamID_Daily",
+//        regId: 5255,
+//        cancelId: 5107,
+//        price: 100000,
+//        turn: 00,
+//        content: "Would you like to register MEDU service 10c/day/learn all courses?",
+//        name_pack: "GTS_MEDU_CamID_Daily",
+//        contentCancel: "Are you sure to cancel MEDU daily package?"
+
+//    });
+
+
+//function registerOnAppV2(msisdn, name) {
+//    action = "REG";
+//    let packInfo = packg.get(name);
+//    name_pack = packInfo.name_pack;
+//    let dataObject = {
+//        "price": packInfo.price,
+//        "turn": packInfo.turn,
+//        "name": packInfo.name,
+//        "content": packInfo.content,
+//        "msisdn": msisdn,
+//        "module": packInfo.module,
+//        //"name_pack": name_pack,
+//        "id_pack": packInfo.regId
+//    };
+
+//    let data = JSON.stringify(dataObject);
+//    console.log("data " + data);
+
+//    console.log("cc.sys.os: " + cc.sys.os);
+//    console.log("cc.sys.OS_ANDROID: " + cc.sys.OS_ANDROID);
+//    console.log("cc.sys.OS_IOS: " + cc.sys.OS_IOS);
+
+//    if (cc.sys.os == cc.sys.OS_ANDROID || cc.sys.os == cc.sys.OS_LINUX) {
+//        console.log("luồng adnroid " + data);
+//        //toastr.success("On ANDROID");
+//        Android.sendDataBuyTurn(data);
+//    } else if (cc.sys.os == cc.sys.OS_IOS) {
+//        console.log("luồng ios " + data);
+//        let d = "sendDataBuyTurn(" + data + ")";
+//        console.log("new s: " + d);
+//        //toastr.success("On IOS");
+//        window.webkit.messageHandlers.log.postMessage("sendDataBuyTurn(" + data + ")");
+//    }
+//}
+//function cancelPackage(msisdn, name) {
+//    action = "CANCEL";
+//    let packInfo = packg.get(name);
+//    name_pack = packInfo.name_pack;
+//    let dataObject = {
+//        "price": 00,
+//        "turn": 00,
+//        "name": packInfo.name,
+//        "packageType": "CANCEL_PACKAGES",
+//        "content": "Are you sure want to cancel daily package?",
+//        "msisdn": msisdn,
+//        "module": packInfo.module,
+//        "name_pack": name_pack,
+//        "id_pack": packInfo.cancelId
+//    };
+
+//    let data = JSON.stringify(dataObject);
+//    console.log("data " + data);
+
+//    console.log("cc.sys.os: " + cc.sys.os);
+//    console.log("cc.sys.OS_ANDROID: " + cc.sys.OS_ANDROID);
+//    console.log("cc.sys.OS_IOS: " + cc.sys.OS_IOS);
+
+//    if (cc.sys.os == cc.sys.OS_ANDROID || cc.sys.os == cc.sys.OS_LINUX) {
+//        console.log("luồng adnroid " + data);
+//        //toastr.success("On ANDROID");
+//        Android.sendDataBuyTurn(data);
+//    } else if (cc.sys.os == cc.sys.OS_IOS) {
+//        console.log("luồng ios " + data);
+//        let d = "sendDataBuyTurn(" + data + ")";
+//        console.log("new s: " + d);
+//        //toastr.success("On IOS");
+//        window.webkit.messageHandlers.log.postMessage("sendDataBuyTurn(" + data + ")");
+//    }
+
+//}
+
+
+
+//function onPaymentCallback(code, refId, turn, price, content, msisdn) {
+
+//    console.log("name_pack: " + name_pack);
+//    console.log("content: " + content);
+
+//    //name_pack = $("#trongductest").attr("ppacktest");
+//    //console.log("name_pack: " + name_pack);
+//    //let subDomain = $("#subDomain").val();
+//    let url = '/Wap/RegisterFromWap';
+//    startLoading();
+//    $.ajax({
+//        type: "POST",
+//        url: url,
+//        headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
+//        data: {
+//            "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
+//            action: action,
+//            code: code,
+//            refId: refId,
+//            turn: turn,
+//            price: price,
+//            content: content,
+//            msisdn: msisdn,
+//            packg: convertPackageToName(name_pack)
+//            //name_pack: name_pack == null || name_pack == "null" || name_pack == "" ? content : name_pack
+//        },
+//        success: function (data) {
+//            stopLoading();
+//            if (data.error == "0") {
+//                toastr.success("Success");
+
+//                setTimeout(function () {
+//                    location.reload();
+//                }, 1000);
+
+//            } else
+//                toastr.error(data.content);
+//        },
+//        failure: function (data) {
+//            stopLoading();
+//        },
+//        error: function (data) {
+//            stopLoading();
+//        }
+//    });
+//};
+
+//function startLoading() {
+
+//    $("#loading").removeClass('hide');
+//}
+
+//function convertPackageToName(pack) {
+//    console.log("package name: " + pack);
+//    if (pack === 'GTS_IWIN_KCQ_CamID_daily') {
+//        return 'GTS_IWIN_KCQ_daily';
+//    }
+//    return pack;
+//}
 
 
 

+ 88 - 36
Website/NEducation/Controllers/HomeController.cs

@@ -21,6 +21,9 @@ using Microsoft.Extensions.Configuration;
 using System.Threading.Tasks;
 using System.Net.Http;
 using Microsoft.EntityFrameworkCore.Metadata.Internal;
+using log4net.Core;
+using Newtonsoft.Json.Serialization;
+using Devart.Common;
 
 namespace NEducation.Controllers
 {
@@ -35,7 +38,7 @@ namespace NEducation.Controllers
             HomeModel model = new HomeModel();
             if (token != null)
             {
-
+                log.Info("login_camid:");
                 Session["navitab"] = "Home";
                 //HomeModel model = new HomeModel();
                 // nhan dien thue bao
@@ -171,7 +174,7 @@ namespace NEducation.Controllers
 
         }
 
-
+        
         private string getUserFromToken(string token)
         {
 
@@ -213,7 +216,7 @@ namespace NEducation.Controllers
             return null;
         }
 
-        public string GetUserInfoFromApp(String token)
+        public string GetUserInfoFromApp(string token)
         {
             string res = null;
             try
@@ -221,16 +224,24 @@ namespace NEducation.Controllers
                 ServicePointManager.Expect100Continue = true;
                 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
 
-                HttpClient httpClient = new HttpClient();
-                httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + token);
-                httpClient.DefaultRequestHeaders.Add("accessToken", ConfigurationManager.AppSettings["accessToken"]);
+                using (HttpClient httpClient = new HttpClient())
+                {
+                    httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + token);
+                    httpClient.DefaultRequestHeaders.Add("accessToken", ConfigurationManager.AppSettings["accessToken"]);
 
-                log.Info("Req " + ConfigurationManager.AppSettings["pathDetectUser"]);
-                HttpResponseMessage response = httpClient.GetAsync(ConfigurationManager.AppSettings["pathDetectUser"]).Result;
+                    // Ghi log tất cả các header
+                    log.Info("Headers:");
+                    foreach (var header in httpClient.DefaultRequestHeaders)
+                    {
+                        log.Info($"{header.Key}: {string.Join(", ", header.Value)}");
+                    }
 
-                response.EnsureSuccessStatusCode();
-                httpClient.Dispose();
-                res = response.Content.ReadAsStringAsync().Result;
+                    log.Info("Req " + ConfigurationManager.AppSettings["pathDetectUser"]);
+                    HttpResponseMessage response = httpClient.GetAsync(ConfigurationManager.AppSettings["pathDetectUser"]).Result;
+                    log.Info("response " + response.ToString());
+                    response.EnsureSuccessStatusCode();
+                    res = response.Content.ReadAsStringAsync().Result;
+                }
             }
             catch (Exception ex)
             {
@@ -240,6 +251,7 @@ namespace NEducation.Controllers
         }
 
 
+
         public ActionResult VietnameseIndex()
         {
             // check login
@@ -335,6 +347,29 @@ namespace NEducation.Controllers
                 cookie.Value = LanguageAbbrevation;
                 Response.Cookies.Add(cookie);
 
+                String mMsisdn = Session["msisdn"] as String;
+                String lang = "1";
+                if (LanguageAbbrevation == "en")
+                {
+                    lang = "0";
+                }
+
+                SetLanguageRequest reqStatus = new SetLanguageRequest
+                {
+                    users = mMsisdn,
+                    language = lang
+                };
+                string rsStatus = UtilsController.SendPost(reqStatus, Session.SessionID, UtilsController.WsType.usersSetLanguage);
+                SetLanguageResult resStatus = new SetLanguageResult(rsStatus);
+
+                if (resStatus.status == UtilsController.Constant.SUCCESS)
+                {
+                    log.Debug("ChangeLanguage_SUCCESS");
+                }
+                else
+                {
+                    log.Debug("ChangeLanguage_Faild");
+                }
                 return View();
             }
             else
@@ -352,42 +387,59 @@ namespace NEducation.Controllers
             {
                 log.Debug("RegisterSub: " + phone);
                 String packageName = ConfigurationManager.AppSettings["packname"];
+                String REGISTER_ToBe = ConfigurationManager.AppSettings["packNameREGISTER_ToBe"];
                 String fee = ConfigurationManager.AppSettings["fee"];
-                // Tạo đối tượng mpsparams với các giá trị từ tham số
-                MpsParams mpsparams = new MpsParams
-                {
-                    CMD = "REGISTER",
-                    PRICE = fee,
-                    MOBILE = phone,
-                    CATE = "BLANK",
-                    SUB = packageName
-                };
-
-                // Gọi phương thức bất đồng bộ để đăng ký
-                GenKeyWs.response makeUrl = await WapController.UserRegisteringAsync(wsClient, mpsparams);
+                // check account existed
+                var checkSub = UtilsController.checkAccountSub(phone, REGISTER_ToBe);
 
-                // Lưu thông tin vào session
-                Session["mps-params"] = mpsparams;
-                log.Debug("mpsparams_RegisterSub: " + mpsparams);
-                log.Debug("makeUrl_RegisterSub: " + makeUrl);
-                // Kiểm tra mã lỗi và trả về kết quả tương ứng
-                if (makeUrl.errorCode == UtilsController.WapConstant.SUCCESS)
+                if (checkSub == false)
                 {
-                    return Json(new
+                    // Tạo đối tượng mpsparams với các giá trị từ tham số
+                    MpsParams mpsparams = new MpsParams
                     {
-                        success = true,
-                        redirectUrl = makeUrl.enscrypt
-                    });
+                        CMD = "REGISTER",
+                        PRICE = fee,
+                        MOBILE = phone,
+                        CATE = "BLANK",
+                        SUB = packageName
+                    };
+
+                    // Gọi phương thức bất đồng bộ để đăng ký
+                    GenKeyWs.response makeUrl = await WapController.UserRegisteringAsync(wsClient, mpsparams);
+
+                    // Lưu thông tin vào session
+                    Session["mps-params"] = mpsparams;
+                    log.Debug("mpsparams_RegisterSub: " + mpsparams);
+                    log.Debug("makeUrl_RegisterSub: " + makeUrl);
+                    // Kiểm tra mã lỗi và trả về kết quả tương ứng
+                    if (makeUrl.errorCode == UtilsController.WapConstant.SUCCESS)
+                    {
+                        return Json(new
+                        {
+                            success = true,
+                            redirectUrl = makeUrl.enscrypt
+                        });
+                    }
+                    else
+                    {
+                        return Json(new
+                        {
+                            success = false,
+                            error_code = makeUrl.errorCode,
+                            error_content = UtilsController.GetErrorCodeCharging(makeUrl.errorCode)
+                        });
+                    }
                 }
                 else
                 {
                     return Json(new
                     {
-                        success = false,
-                        error_code = makeUrl.errorCode,
-                        error_content = UtilsController.GetErrorCodeCharging(makeUrl.errorCode)
+                        success = true,
+                        redirectUrl = "/Home/Index"
                     });
+
                 }
+                 
             }
             catch (Exception ex)
             {

+ 26 - 1
Website/NEducation/Controllers/LanguageController.cs

@@ -1,10 +1,12 @@
-using System;
+using NEducation.Code;
+using System;
 using System.Collections.Generic;
 using System.Globalization;
 using System.Linq;
 using System.Threading;
 using System.Web;
 using System.Web.Mvc;
+using System.Web.Services.Description;
 
 namespace NEducation.Controllers
 {
@@ -15,6 +17,7 @@ namespace NEducation.Controllers
         {
             return View();
         }
+        private static log4net.ILog log { get; set; } = log4net.LogManager.GetLogger(typeof(HomeController));
 
         public ActionResult ChangeLanguage(String LanguageAbbrevation)
         {
@@ -25,6 +28,28 @@ namespace NEducation.Controllers
                 Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(LanguageAbbrevation);
                 Thread.CurrentThread.CurrentUICulture = new CultureInfo(LanguageAbbrevation);
             }
+            String mMsisdn = Session["msisdn"] as String;
+            String lang = "1";
+            if (LanguageAbbrevation == "en")
+            {
+               lang = "0";
+            }
+            
+            SetLanguageRequest reqStatus = new SetLanguageRequest {
+                users = mMsisdn,
+                language = lang
+            };
+            string rsStatus = UtilsController.SendPost(reqStatus, Session.SessionID, UtilsController.WsType.usersSetLanguage);
+            SetLanguageResult resStatus = new SetLanguageResult(rsStatus);
+
+            if (resStatus.status == UtilsController.Constant.SUCCESS)
+            {
+                log.Debug("ChangeLanguage_SUCCESS");
+            }
+            else
+            {
+                log.Debug("ChangeLanguage_Faild");
+            }
 
             Response.Cookies.Remove("Language");
 

+ 52 - 15
Website/NEducation/Controllers/MiniGameController.cs

@@ -65,6 +65,12 @@ namespace NEducation.Controllers
             {
                 CheckMiniGameModel model = new CheckMiniGameModel();
 
+                //List<SubInfo> listSub = Session["subInfo"] as List<SubInfo>;
+                //if (listSub == null || listSub.Count <= 0)
+                //{
+                //    ViewBag.checkOPP = "NO_SUB";
+                //    return View("Index", model);
+                //}
                 CheckMiniGameRequest miniGameRequest = new CheckMiniGameRequest
                 {
                     users = Session["msisdn"] as string,
@@ -76,11 +82,12 @@ namespace NEducation.Controllers
                 UserActionResult res = new UserActionResult(rs);
                 MiniGame miniGame = new MiniGame(rs);
                 model.MiniGame = miniGame;
-
-                DateTime sysdate = model.MiniGame.Sysdate;
-                DateTime startDate = model.MiniGame.StartDate;
-                DateTime endDate = model.MiniGame.EndDate;
-                bool isPlay = model.MiniGame.IsPlay == "0";
+                string format = "dd/MM/yyyy HH:mm:ss";
+                
+                DateTime sysdate = DateTime.ParseExact(model.MiniGame.Sysdate, format, null);
+                DateTime startDate = DateTime.ParseExact(model.MiniGame.StartDate, format, null);
+                DateTime endDate = DateTime.ParseExact(model.MiniGame.EndDate, format, null);
+                bool isPlay = model.MiniGame.IsPlay == "1";
                 bool status = model.MiniGame.Status == "0";
                 string isSubscribed = model.MiniGame.UserIsActive;
 
@@ -88,26 +95,56 @@ namespace NEducation.Controllers
                 ViewBag.Sysdate = sysdate.ToString("MM/dd/yyyy HH:mm:ss");
                 ViewBag.StartDate = startDate.ToString("MM/dd/yyyy HH:mm:ss");
                 ViewBag.EndDate = endDate.ToString("MM/dd/yyyy HH:mm:ss");
+                ViewBag.ShowPlayButton = false;
+                ViewBag.ShowClock = false;
 
                 if (sysdate < startDate)
                 {
                     ViewBag.CountdownDate = startDate.ToString("MM/dd/yyyy HH:mm:ss");
                     ViewBag.ShowClock = true;
-                    ViewBag.ShowPlayButton = false;
+
                 }
-                else if (sysdate >= startDate && sysdate <= endDate && isPlay && status)
+                else if (sysdate >= startDate && sysdate <= endDate )
                 {
+                    
                     ViewBag.CountdownDate = endDate.ToString("MM/dd/yyyy HH:mm:ss");
-                    ViewBag.ShowClock = true;
-                    ViewBag.ShowPlayButton = false;
+
+                    if(isSubscribed == "0")
+                    {
+                        ViewBag.ShowPlayButton = true;
+                        ViewBag.checkOPP = "NO_SUB";
+                    }
+                    else if (isPlay && status)
+                    {
+                        ViewBag.CountdownDate = endDate.ToString("MM/dd/yyyy HH:mm:ss");
+                        ViewBag.ShowPlayButton = true;
+                        if(!status)
+                        {
+                            ViewBag.checkOPP = "DA_CHOI";
+                        }
+                    }
+                    else if(!status)
+                    {
+                        ViewBag.checkOPP = "DA_CHOI";
+                        ViewBag.ShowPlayButton = true;
+                    }
+                    
                 }
                 else
                 {
-                    ViewBag.ShowClock = false;
-                    ViewBag.ShowPlayButton = true;
-                }
+                    if (isSubscribed == "0")
+                    {
+                        ViewBag.ShowPlayButton = true;
+                        ViewBag.checkOPP = "NO_SUB";
+                    }
+                    else if (!status)
+                    {
+                        ViewBag.checkOPP = "DA_CHOI";
 
-                ViewBag.IsSubscribed = isSubscribed;
+                    }
+                    ViewBag.ShowClock = true;
+
+                }
                 return View("Index", model);
             }
             else
@@ -150,7 +187,7 @@ namespace NEducation.Controllers
                 }
                 else
                 {
-                    return Redirect("/Common/Error");
+                    return PartialView("_RankingDataPartial", model);
                 }
             }
             else
@@ -165,7 +202,7 @@ namespace NEducation.Controllers
             Session.Remove("model");
             GrammarModel model = new GrammarModel();
             model.answerList = new List<AnswerResult>();
-            model.currentQuestionIndex = 0;
+            model.currentQuestionIndex = 1;
             model.remainTime = UtilsController.questionTimeout;
             model.startTime = DateTime.Now;
 

+ 4 - 3
Website/NEducation/Controllers/UtilsController.cs

@@ -82,7 +82,7 @@ namespace NEducation.Controllers
             }
             else
             {
-                if (!input.StartsWith("855") && input.Length == 10)
+                if (!input.StartsWith("855") && input.Length <=13)
                 {
                     input = "855" + input;
                 }
@@ -175,7 +175,7 @@ namespace NEducation.Controllers
         public class WsType
         {
             public const String UsersCheckStatus = "wsUsersCheckStatus";
-            //public const String UsersUpdateProfile = "wsUsersUpdateProfile";
+            public const String usersSetLanguage = "usersSetLanguage";
             public const String UsersGetProfile = "wsUsersGetProfile";
             public const String UserViewUpdate = "wsUsersViewUpdate";
             public const String UsersSearchProfile = "wsUsersSearchProfile";
@@ -219,7 +219,8 @@ namespace NEducation.Controllers
 
             public const String GetMiniGameCondition = "wsGetMiniGameCondition";
             public const String GetRankMiniGame = "GetRankMiniGame";
-            
+            public const String wsCheckTransaction = "wsCheckTransaction";
+
             public const String SubGetListsubServiceCode = "subGetListsubServiceCode";
 
             public const String GetHfDatabyParentId = "getHfDatabyParentId";

+ 297 - 92
Website/NEducation/Controllers/WapController.cs

@@ -15,6 +15,10 @@ using System.Web;
 using System.Net;
 using NEducation.Code;
 using NEducation.Content.Texts;
+using System.Web.SessionState;
+using Microsoft.EntityFrameworkCore.Metadata.Internal;
+using Newtonsoft.Json;
+using Devart.Common;
 
 namespace NEducation.Controllers
 {
@@ -35,9 +39,7 @@ namespace NEducation.Controllers
         String wsUser;
         String wsPass;
 
-        //static public String wsUrl = "http://paymentgateway.metfone.com.kh/MPS/";
-        //static public String wsUrlRes = "http://happycall.fun/Wap/ResponseFromWap";
-        ////static public String wsUrlRes = "https://localhost:44310/Wap/ResponseFromWap";
+
         static private String PRO = "GTS";
         static private String SER = "GTS_MEDU";
         //static private String SUB = "GTS_HappyCalling_Daily";
@@ -47,8 +49,15 @@ namespace NEducation.Controllers
 
         GenKeyWs.WsGenKeyClient wsClient = new GenKeyWs.WsGenKeyClient();
 
-
-        public async Task<ActionResult> ResponseFromWapAsync(string DATA, string SIG)
+        private void CreateAuthToken()
+        {
+            // create session authen
+            SessionIDManager manager = new SessionIDManager();
+            string newSessionId = manager.CreateSessionID(System.Web.HttpContext.Current);
+            Response.Cookies["AuthToken"].Value = newSessionId;
+            Session["AuthToken"] = newSessionId;
+        }
+        public async Task<ActionResult> ResponseFromWap(string DATA, string SIG)
         {
             try
             {
@@ -60,7 +69,7 @@ namespace NEducation.Controllers
                 var sigGet = Uri.EscapeDataString(SIG).ToString();
                 var data = "DATA=" + dataGet + "&SIG=" + sigGet;
 
-                log.Debug("data " + data);
+                log.Info("data_ResponseFromWap " + data);
 
                 // Load configuration settings
                 String wsUrlRes = ConfigurationManager.AppSettings["domainRes"];
@@ -71,7 +80,7 @@ namespace NEducation.Controllers
                 String packNameCannel_ToBe = ConfigurationManager.AppSettings["packNameCannel_ToBe"];
                 String DIR = ConfigurationManager.AppSettings["directoryPath"];
 
-                log.Debug("DIR_Wap " + DIR);
+                log.Info("DIR_Wap " + DIR);
 
                 if (packageName == null)
                 {
@@ -83,27 +92,27 @@ namespace NEducation.Controllers
                 // Decrypt the key
                 GenKeyWs.wsDecryptKeyResponse decrypt = await wsClient.wsDecryptKeyAsync(null, null, DIR + packageName.ToUpper() + "\\", wsUrl, data);
 
-                log.Debug("errorCode " + decrypt.@return.errorCode);
-                log.Debug("decrypt " + decrypt.@return.descrypt);
+                log.Info("errorCode " + decrypt.@return.errorCode);
+                log.Info("decrypt " + decrypt.@return.descrypt);
 
                 // Log details if available
                 if (decrypt.@return.mpsResponse != null)
                 {
-                    log.Debug("CMD " + decrypt.@return.mpsResponse.CMD);
-                    log.Debug("MOBILE " + decrypt.@return.mpsResponse.MOBILE);
-                    log.Debug("PRICE " + decrypt.@return.mpsResponse.PRICE);
-                    log.Debug("RES " + decrypt.@return.mpsResponse.RES);
-                    log.Debug("REQ " + decrypt.@return.mpsResponse.REQ);
-                    log.Debug("SOURCE " + decrypt.@return.mpsResponse.SOURCE);
-                    log.Debug("STATUS " + decrypt.@return.mpsResponse.STATUS);
-                    log.Debug("SUB_END_DATE " + decrypt.@return.mpsResponse.SUB_END_DATE);
-                    log.Debug("SUB_NEW " + decrypt.@return.mpsResponse.SUB_NEW);
-                    log.Debug("SUB_SERVICE " + decrypt.@return.mpsResponse.SUB_SERVICE);
-                    log.Debug("SUB_START_DATE " + decrypt.@return.mpsResponse.SUB_START_DATE);
+                    log.Info("CMD " + decrypt.@return.mpsResponse.CMD);
+                    log.Info("MOBILE " + decrypt.@return.mpsResponse.MOBILE);
+                    log.Info("PRICE " + decrypt.@return.mpsResponse.PRICE);
+                    log.Info("RES " + decrypt.@return.mpsResponse.RES);
+                    log.Info("REQ " + decrypt.@return.mpsResponse.REQ);
+                    log.Info("SOURCE " + decrypt.@return.mpsResponse.SOURCE);
+                    log.Info("STATUS " + decrypt.@return.mpsResponse.STATUS);
+                    log.Info("SUB_END_DATE " + decrypt.@return.mpsResponse.SUB_END_DATE);
+                    log.Info("SUB_NEW " + decrypt.@return.mpsResponse.SUB_NEW);
+                    log.Info("SUB_SERVICE " + decrypt.@return.mpsResponse.SUB_SERVICE);
+                    log.Info("SUB_START_DATE " + decrypt.@return.mpsResponse.SUB_START_DATE);
                 }
                 else
                 {
-                    log.Debug("mpsResponse null ");
+                    log.Info("mpsResponse null ");
                 }
 
                 if (decrypt.@return.errorCode == UtilsController.WapConstant.SUCCESS)
@@ -124,15 +133,16 @@ namespace NEducation.Controllers
                                 // Perform registration request
                                 UserRequest userRequest = new UserRequest
                                 {
-                                    users = decrypt.@return.mpsResponse.MOBILE,
-                                    msisdn = decrypt.@return.mpsResponse.MOBILE,
+                                    users = phoneNumber,
+                                    msisdn = phoneNumber,
                                     subServiceCode = packNameREGISTER_ToBe + "|" + decrypt.@return.mpsResponse.PRICE,
                                     requestId = "-1",
                                     otp = decrypt.@return.mpsResponse.RES,
                                     serviceId = "3"
                                 };
-
+                                log.Info("MpsRequest_web: " + JsonConvert.SerializeObject(userRequest));
                                 String rs = UtilsController.SendPost(userRequest, Session.SessionID, UtilsController.WsType.MpsRequest);
+                                log.Info("MpsResult_web: " + rs);
                                 UserActionResult ress = new UserActionResult(rs);
 
                                 if (ress.responseCode == UtilsController.Constant.SUCCESS)
@@ -143,6 +153,90 @@ namespace NEducation.Controllers
                                     Session["package"] = packNameCannel;
                                     Session["CHARGE_ACTION"] = UtilsController.Constant.REGISTER;
                                     Session["CHARGE_DATA"] = userRequest;
+                                    if (decrypt.@return.mpsResponse.RES == "0")
+                                    {
+                                        log.Info("decrypt.@return.mpsResponse.RES " + decrypt.@return.mpsResponse.RES);
+                                        // auto login
+                                        // reload user info
+                                        HttpContext.Session.Remove("regInfos");
+                                        Session["msisdnDetect"] = phoneNumber;
+                                        // dang ky tren app
+                                        Session["WHICHDEVICE"] = UtilsController.Constant.REGISTER_ON_WEB;
+
+
+                                        // check user has account
+                                        GetUserProfileReq req = new GetUserProfileReq();
+                                        req.users = phoneNumber;
+
+                                        String rss = UtilsController.SendPost(req, System.Web.HttpContext.Current.Session.SessionID, UtilsController.WsType.UsersGetProfile);
+                                        UserProfile profile = new UserProfile(rs);
+                                        if (profile.id != null)
+                                        {
+                                            System.Web.HttpContext.Current.Session["profile"] = profile;
+
+                                            // create new auth
+                                            CreateAuthToken();
+                                            String sessionId = Session.SessionID;
+                                            // login success --> store session
+                                            Session["msisdn"] = phoneNumber;
+                                            // get sub
+                                            UtilsController.ReloadSubInfo();
+
+                                            // all info of user was loaded from server
+                                            //UserProfile profile = Session["profile"] as UserProfile;
+                                            String typeLanguage = Session["typeLanguage"] as String;
+                                            return Redirect("/Home/Index");
+                                        }
+                                        else
+                                        {
+                                            // Create a free account for the user
+                                            UserRequest userRequests = new UserRequest
+                                            {
+                                                users = phoneNumber,
+                                                msisdn = phoneNumber,
+                                                command = "REGIST",
+                                                channel = "WEB"
+                                            };
+
+                                            string rsRegister = UtilsController.SendPost(userRequest, Session.SessionID, UtilsController.WsType.UsersRegister);
+                                            UserActionResult resRegister = new UserActionResult(rsRegister);
+                                            Session["isSub"] = "false";
+
+                                            if (resRegister.status == UtilsController.Constant.SUCCESS)
+                                            {
+                                                // Load profile
+                                                GetUserProfileReq reqProfile = new GetUserProfileReq { users = phoneNumber };
+                                                string rsProfile = UtilsController.SendPost(reqProfile, Session.SessionID, UtilsController.WsType.UsersGetProfile);
+                                                UserProfile profileGet = new UserProfile(rsProfile);
+
+                                                if (profileGet.id != null)
+                                                {
+                                                    Session["profile"] = profileGet;
+
+                                                    UserInfoRequest reqStatus = new UserInfoRequest { users = phoneNumber };
+                                                    string rsStatus = UtilsController.SendPost(reqStatus, Session.SessionID, UtilsController.WsType.UsersCheckStatus);
+                                                    UserActionResult resStatus = new UserActionResult(rsStatus);
+
+                                                    if (resStatus.status == UtilsController.Constant.SUCCESS)
+                                                    {
+                                                        UserInfo userInfo = new UserInfo(rsStatus);
+                                                        Session["userInfo"] = userInfo;
+                                                        // Create new auth
+                                                        CreateAuthToken();
+                                                        Session["msisdn"] = phoneNumber;
+
+                                                        // Reload user info
+                                                        UtilsController.ReloadSubInfo();
+                                                    }
+                                                }
+                                            }
+                                            return Redirect("/Home/Index");
+                                        }
+                                    }
+                                    else
+                                    {
+                                        return Redirect("/Home/Index");
+                                    }
                                 }
                                 else if (ress.status == "2")
                                 {
@@ -152,7 +246,7 @@ namespace NEducation.Controllers
                                         error_content = UtilsController.GetErrorCodeCharging(ress.status)
                                     });
                                 }
-
+                                
                                 return Json(new
                                 {
                                     error_code = ress.responseCode,
@@ -208,6 +302,31 @@ namespace NEducation.Controllers
                                                 Session["package"] = packageName;
                                                 Session["CHARGE_ACTION"] = UtilsController.Constant.REGISTER;
                                                 Session["CHARGE_DATA"] = userRequest;
+                                                // Load profile
+                                                GetUserProfileReq reqProfile = new GetUserProfileReq { users = phoneNumber };
+                                                string rsProfile = UtilsController.SendPost(reqProfile, Session.SessionID, UtilsController.WsType.UsersGetProfile);
+                                                UserProfile profileGet = new UserProfile(rsProfile);
+
+                                                if (profileGet.id != null)
+                                                {
+                                                    Session["profile"] = profileGet;
+
+                                                    UserInfoRequest reqStatus = new UserInfoRequest { users = phoneNumber };
+                                                    string rsStatus = UtilsController.SendPost(reqStatus, Session.SessionID, UtilsController.WsType.UsersCheckStatus);
+                                                    UserActionResult resStatus = new UserActionResult(rsStatus);
+
+                                                    if (resStatus.status == UtilsController.Constant.SUCCESS)
+                                                    {
+                                                        UserInfo userInfo = new UserInfo(rsStatus);
+                                                        Session["userInfo"] = userInfo;
+                                                        // Create new auth
+                                                        CreateAuthToken();
+                                                        Session["msisdn"] = phoneNumber;
+
+                                                        // Reload user info
+                                                        UtilsController.ReloadSubInfo();
+                                                    }
+                                                }
                                             }
                                             else if (ress.status == "2")
                                             {
@@ -316,7 +435,7 @@ namespace NEducation.Controllers
             GenKeyWs.wsEncryptKeyResponse makeUrl = await wsClient.wsEncryptKeyAsync(null, null, DIR, wsUrl + "mobile.html?", PRO, SER, mpsparams.SUB,
                 mpsparams.CMD, "WAP", mpsparams.CATE, mpsparams.ITEM, SUP_CP, CONT, mpsparams.PRICE, mpsparams.MOBILE, TYPE);
 
-            log.Debug("UserDetecting build req: " + makeUrl.@return.enscrypt);
+            log.Info("UserDetecting build req: " + makeUrl.@return.enscrypt);
             //HttpContext.Session.SetComplexData("mps-params", mpsparams);
 
             return makeUrl.@return;
@@ -327,15 +446,15 @@ namespace NEducation.Controllers
             GenKeyWs.response response = new GenKeyWs.response();
             response.errorCode = UtilsController.WapConstant.FAILURE;
             String DIR = ConfigurationManager.AppSettings["directoryPath"] + mpsparams.SUB.ToUpper() + "/";
-            log.Debug("UserRegistering build DIR: " + DIR);
+            log.Info("UserRegistering build DIR: " + DIR);
             String wsUrl = ConfigurationManager.AppSettings["paymentUrl"];
             //String DIR = configuration.GetSection("directoryPath").Value + mpsparams.SUB.ToUpper() + "/";
             //String wsUrl = configuration.GetSection("paymentUrl").Value;
-            log.Debug("UserRegistering makeUrl:");
+            log.Info("UserRegistering makeUrl:");
             GenKeyWs.wsEncryptKeyResponse makeUrl = await wsClient.wsEncryptKeyAsync(null, null, DIR, wsUrl + "charge.html?", PRO, SER, mpsparams.SUB,
                 mpsparams.CMD, "WAP", mpsparams.CATE, mpsparams.ITEM, SUP_CP, CONT, mpsparams.PRICE, mpsparams.MOBILE, TYPE);
 
-            log.Debug("UserRegistering build req: " + makeUrl.@return.enscrypt);
+            log.Info("UserRegistering build req: " + makeUrl.@return.enscrypt);
             // save session
             //HttpContext.Session.SetComplexData("mps-params", mpsparams);
 
@@ -355,7 +474,7 @@ namespace NEducation.Controllers
             GenKeyWs.wsEncryptKeyResponse makeUrl = await wsClient.wsEncryptKeyAsync(null, null, DIR, wsUrl + "charge.html?", PRO, SER, mpsparams.SUB,
                 mpsparams.CMD, "WAP", mpsparams.CATE, mpsparams.ITEM, SUP_CP, CONT, mpsparams.PRICE, mpsparams.MOBILE, TYPE);
 
-            log.Debug("UserCharging build req: " + makeUrl.@return.enscrypt);
+            log.Info("UserCharging build req: " + makeUrl.@return.enscrypt);
             //HttpContext.Session.SetComplexData("mps-params", mpsparams);
 
             return makeUrl.@return;
@@ -374,7 +493,7 @@ namespace NEducation.Controllers
             GenKeyWs.wsEncryptKeyResponse makeUrl = await wsClient.wsEncryptKeyAsync(null, null, DIR, wsUrl + "charge.html?", PRO, SER, mpsparams.SUB,
                 mpsparams.CMD, "WAP", mpsparams.CATE, mpsparams.ITEM, SUP_CP, CONT, mpsparams.PRICE, mpsparams.MOBILE, TYPE);
 
-            log.Debug("UserCanceling build req: " + makeUrl.@return.enscrypt);
+            log.Info("UserCanceling build req: " + makeUrl.@return.enscrypt);
             // save session
             //HttpContext.Session.SetComplexData("mps-params", mpsparams);
 
@@ -385,7 +504,7 @@ namespace NEducation.Controllers
         {
             String url = mpsurl;
 
-            log.Debug("Request: " + url);
+            log.Info("Request: " + url);
 
             using (var client = new HttpClient())
             {
@@ -395,7 +514,7 @@ namespace NEducation.Controllers
                     var responseContent = response.Content;
                     // by calling .Result you are synchronously reading the result
                     string responseString = responseContent.ReadAsStringAsync().Result;
-                    log.Debug("Response: " + responseString);
+                    log.Info("Response: " + responseString);
                     return responseString;
                 }
                 else
@@ -449,6 +568,9 @@ namespace NEducation.Controllers
         [ValidateAntiForgeryToken]
         public ActionResult RegisterFromWap(String code, String refId, String turn, String price, String content, String msisdn, String packg, String action)
         {
+            String packNameREGISTER_ToBe = ConfigurationManager.AppSettings["packNameREGISTER_ToBe"];
+            String packNameCannel_ToBe = ConfigurationManager.AppSettings["packNameCannel_ToBe"];
+            String packageName = ConfigurationManager.AppSettings["packname"];
             // khi đăng ký thành công từ camID thì gọi hàm này để gọi Be
             log.Info("CALLBACK: " + msisdn + ", packg: " + packg + ", code: " + code + ", content: "
                 + content + ", turn: " + turn + ", action: " + action + ", price: " + price);
@@ -458,34 +580,49 @@ namespace NEducation.Controllers
             }
             try
             {
+                //code = "0";
+                //refId = "56f6a1e9c6714cbab5c62bb65988d128";
                 if (code == "0")
                 {
-
-                    // success
-                    string res = null;
-
-                    // check phone number
-                    msisdn = UtilsController.validateMsisdn(msisdn);
-                    if (msisdn != "" && msisdn == (String)Session["msisdn"])
+                    CheckTransactionRequest checkTransactionRequest = new CheckTransactionRequest
                     {
-                        String packNameREGISTER_ToBe = ConfigurationManager.AppSettings["packNameREGISTER_ToBe"];
-                        String packNameCannel_ToBe = ConfigurationManager.AppSettings["packNameCannel_ToBe"];
-                        String packageName = ConfigurationManager.AppSettings["packname"];
-                        if (action == "CANCEL")
+                        token = "",
+                        session = Session.SessionID,
+                        wsCode = "validateMps",
+                        wsRequest = new WsRequest
                         {
-                            log.Info("Cancel package: " + msisdn + ", packg: " + packg);
+                            msisdn = msisdn,
+                            refId = refId
+                        }
+                    };
+                    log.Info("checkTransactionRequest: " + JsonConvert.SerializeObject(checkTransactionRequest));
+                    String responseJson = UtilsController.SendPost(checkTransactionRequest, Session.SessionID, UtilsController.WsType.wsCheckTransaction);
+                    CheckTransactionResponse response = new CheckTransactionResponse(responseJson);
 
-                            Session["msisdn-detecting"] = msisdn;
+                    log.Info("responseCheckTransactionRequest: " + responseJson);
+                    if (response.result != null && response.result.errorCode == "0")
+                    {
+                        string res = null;
+                        // check phone number
+                        msisdn = UtilsController.validateMsisdn(msisdn);
+                        if (msisdn != "" && msisdn == (String)Session["msisdn"])
+                        {
 
-                            var checkSub = UtilsController.checkAccountSub(msisdn, packNameCannel_ToBe);
-                            if (!checkSub)
+                            if (action == "CANCEL")
                             {
+                                log.Info("Cancel package: " + msisdn + ", packg: " + packg);
+
+                                Session["msisdn-detecting"] = msisdn;
+
+                                //var checkSub = UtilsController.checkAccountSub(msisdn, packNameCannel_ToBe);
+                                //if (!checkSub)
+                                //{
                                 UserRequest userRequest = new UserRequest
                                 {
                                     users = msisdn,
                                     msisdn = msisdn,
                                     subServiceCode = packNameCannel_ToBe + "|" + price,
-                                    requestId = "-1",
+                                    requestId = refId,
                                     otp = code,
                                     serviceId = "3"
                                 };
@@ -498,9 +635,38 @@ namespace NEducation.Controllers
                                     Charging charging = new Charging(rs);
                                     Session["charging"] = charging;
                                     Session["msisdn"] = msisdn;
-                                    Session["package"] = packageName;
+                                    Session["package"] = packNameCannel_ToBe;
                                     Session["CHARGE_ACTION"] = UtilsController.Constant.REGISTER;
                                     Session["CHARGE_DATA"] = userRequest;
+                                    // Load profile
+                                    GetUserProfileReq reqProfile = new GetUserProfileReq { users = msisdn };
+                                    string rsProfile = UtilsController.SendPost(reqProfile, Session.SessionID, UtilsController.WsType.UsersGetProfile);
+                                    UserProfile profileGet = new UserProfile(rsProfile);
+
+                                    if (profileGet.id != null)
+                                    {
+                                        Session["profile"] = profileGet;
+
+                                        UserInfoRequest reqStatus = new UserInfoRequest { users = msisdn };
+                                        string rsStatus = UtilsController.SendPost(reqStatus, Session.SessionID, UtilsController.WsType.UsersCheckStatus);
+                                        UserActionResult resStatus = new UserActionResult(rsStatus);
+
+                                        if (resStatus.status == UtilsController.Constant.SUCCESS)
+                                        {
+                                            UserInfo userInfo = new UserInfo(rsStatus);
+                                            Session["userInfo"] = userInfo;
+
+                                            Session["msisdn"] = msisdn;
+
+                                            // Reload user info
+                                            UtilsController.ReloadSubInfo();
+                                        }
+                                    }
+                                    return Json(new
+                                    {
+                                        error_code = ress.responseCode,
+                                        error_content = UtilsController.GetErrorCodeCharging(ress.responseCode)
+                                    });
                                 }
                                 else if (ress.status == "2")
                                 {
@@ -516,39 +682,40 @@ namespace NEducation.Controllers
                                     error_code = ress.responseCode,
                                     error_content = UtilsController.GetErrorCodeCharging(ress.responseCode)
                                 });
+                                //}
+                                //else
+                                //{
+                                //    return Json(new
+                                //    {
+                                //        error_code = UtilsController.Constant.USER_EXISTED,
+                                //        error_content = UtilsController.GetErrorCodeCharging(UtilsController.Constant.USER_EXISTED)
+                                //    });
+                                //}
                             }
                             else
                             {
-                                return Json(new
-                                {
-                                    error_code = UtilsController.Constant.USER_EXISTED,
-                                    error_content = UtilsController.GetErrorCodeCharging(UtilsController.Constant.USER_EXISTED)
-                                });
-                            }
-                        }
-                        else
-                        {
-                            log.Info("Check package: " + msisdn + ", packg: " + packg);
+                                log.Info("Check package: " + msisdn + ", packg: " + packg);
 
-                            Session["msisdn-detecting"] = msisdn;
-                            
+                                Session["msisdn-detecting"] = msisdn;
+
+
+                                //var checkSub = UtilsController.checkAccountSub(msisdn, packNameCannel_ToBe);
+                                //if (!checkSub)
+                                //{
 
-                            var checkSub = UtilsController.checkAccountSub(msisdn, packNameCannel_ToBe);
-                            if (!checkSub)
-                            {
                                 UserRequest userRequest = new UserRequest
                                 {
                                     users = msisdn,
                                     msisdn = msisdn,
-                                    subServiceCode = packNameCannel_ToBe + "|" + price,
-                                    requestId = "-1",
+                                    subServiceCode = packNameREGISTER_ToBe + "|" + price,
+                                    requestId = refId,
                                     otp = code,
                                     serviceId = "3"
                                 };
-
+                                log.Info("userRequest_CAMID: " + JsonConvert.SerializeObject(userRequest));
                                 String rs = UtilsController.SendPost(userRequest, Session.SessionID, UtilsController.WsType.MpsRequest);
                                 UserActionResult ress = new UserActionResult(rs);
-
+                                log.Info("MpsResult: " + rs);
                                 if (ress.responseCode == UtilsController.Constant.SUCCESS)
                                 {
                                     Charging charging = new Charging(rs);
@@ -557,43 +724,81 @@ namespace NEducation.Controllers
                                     Session["package"] = packageName;
                                     Session["CHARGE_ACTION"] = UtilsController.Constant.REGISTER;
                                     Session["CHARGE_DATA"] = userRequest;
+                                    // Load profile
+                                    GetUserProfileReq reqProfile = new GetUserProfileReq { users = msisdn };
+                                    string rsProfile = UtilsController.SendPost(reqProfile, Session.SessionID, UtilsController.WsType.UsersGetProfile);
+                                    log.Info("rsProfile: " + rsProfile);
+                                    UserProfile profileGet = new UserProfile(rsProfile);
+
+                                    if (profileGet.id != null)
+                                    {
+                                        Session["profile"] = profileGet;
+
+                                        UserInfoRequest reqStatus = new UserInfoRequest { users = msisdn };
+                                        string rsStatus = UtilsController.SendPost(reqStatus, Session.SessionID, UtilsController.WsType.UsersCheckStatus);
+                                        UserActionResult resStatus = new UserActionResult(rsStatus);
+
+                                        if (resStatus.status == UtilsController.Constant.SUCCESS)
+                                        {
+                                            UserInfo userInfo = new UserInfo(rsStatus);
+                                            Session["userInfo"] = userInfo;
+
+                                            Session["msisdn"] = msisdn;
+
+                                            // Reload user info
+                                            UtilsController.ReloadSubInfo();
+                                        }
+                                    }
+                                    //}
+                                    //else if (ress.status == "2")
+                                    //{
+                                    //    return Json(new
+                                    //    {
+                                    //        error_code = ress.status,
+                                    //        error_content = UtilsController.GetErrorCodeCharging(ress.status)
+                                    //    });
+                                    //}
+
+                                    return Json(new
+                                    {
+                                        error_code = ress.responseCode,
+                                        error_content = UtilsController.GetErrorCodeCharging(ress.responseCode)
+                                    });
                                 }
-                                else if (ress.status == "2")
+                                else
                                 {
                                     return Json(new
                                     {
-                                        error_code = ress.status,
-                                        error_content = UtilsController.GetErrorCodeCharging(ress.status)
+                                        error_code = UtilsController.Constant.USER_EXISTED,
+                                        error_content = UtilsController.GetErrorCodeCharging(UtilsController.Constant.USER_EXISTED)
                                     });
                                 }
 
-                                return Json(new
-                                {
-                                    error_code = ress.responseCode,
-                                    error_content = UtilsController.GetErrorCodeCharging(ress.responseCode)
-                                });
                             }
-                            else
+                            //ReloadAccountInfo(msisdn);
+                            return Json(new
                             {
-                                return Json(new
-                                {
-                                    error_code = UtilsController.Constant.USER_EXISTED,
-                                    error_content = UtilsController.GetErrorCodeCharging(UtilsController.Constant.USER_EXISTED)
-                                });
-                            }
-                            
+                                error = code,
+                                content = res,
+                                msisdn = msisdn.Substring(3)
+                            });
                         }
-                        //ReloadAccountInfo(msisdn);
-                        return Json(new
+                        else
                         {
-                            error = code,
-                            content = res,
-                            msisdn = msisdn.Substring(3)
-                        });
+                            log.Info("REGISTER Can not detecting");
+                        }
                     }
                     else
                     {
-                        log.Info("REGISTER Can not detecting");
+                        // Handle error case
+                        string errorCode = response.errorCode ?? response.result?.errorCode;
+                        string errorMessage = response.errorMessage ?? response.result?.message;
+                        return Json(new
+                        {
+                            error_code = errorCode,
+                            error_content = errorMessage
+                        });
+
                     }
                 }
                 else

+ 8 - 8
Website/NEducation/Views/Common/CourseView.cshtml

@@ -22,7 +22,7 @@
             <a href="/Home/EnglishIndex/" class="nav-link">@Lang.english</a>
             <a href="/Home/VietnameseIndex/" class="nav-link">@Lang.vietnamese</a>
             <a href="/Home/LaosIndex/" class="nav-link">@Lang.laos</a>
-            <div class="dropdown nav-link">
+            @*<div class="dropdown nav-link">
                 <button onclick="myFunction()" class="dropbtn">
                     E-Library
                     <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
@@ -31,7 +31,7 @@
                     <a href="/Ebook/">@Lang.Ebook</a>
                     <a href="/Ebook/Video">Children's Video</a>
                 </div>
-            </div>
+            </div>*@
         }
         else
         {
@@ -39,7 +39,7 @@
             <a href="/Common/Course?courseType=@UtilsController.Constant.EN_VOCABULARY" class="nav-link">@Lang.Vocabulary</a>
             <a href="/Common/Course?courseType=@UtilsController.Constant.EN_GRAMMAR" class="nav-link">@Lang.Grammar</a>
             <a href="/Common/Course?courseType=@UtilsController.Constant.EN_LISTEN" class="nav-link">@Lang.Listening</a>
-            <a href="/Common/Course?courseType=@UtilsController.Constant.EN_MINIGAME" class="nav-link">@Lang.MiniGame</a>
+            <a href="/MiniGame" class="nav-link ">@Lang.MiniGame</a>
         }
     }
 }
@@ -56,7 +56,7 @@
                     @Lang.Ebook
                     <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
                 </a>*@
-            <li class="menu-item-has-children header-menu-link ">
+            @*<li class="menu-item-has-children header-menu-link ">
                 <a href="#" class="">
                     E-Library
                     <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
@@ -65,7 +65,7 @@
                     <li><a href="/Ebook/">@Lang.Ebook</a></li>
                     <li><a href="/Ebook/Video">Children's Video</a></li>
                 </ul>
-            </li>
+            </li>*@
 
         }
         else
@@ -74,8 +74,8 @@
             <a href="/Common/Course?courseType=@UtilsController.Constant.EN_VOCABULARY" class="header-menu-link ">@Lang.Vocabulary</a>
             <a href="/Common/Course?courseType=@UtilsController.Constant.EN_GRAMMAR" class="header-menu-link ">@Lang.Grammar</a>
             <a href="/Common/Course?courseType=@UtilsController.Constant.EN_LISTEN" class="header-menu-link ">@Lang.Listening</a>
-            <a href="/Common/Course?courseType=@UtilsController.Constant.EN_MINIGAME" class="nav-link">@Lang.MiniGame</a>
-            <li class="menu-item-has-children header-menu-link ">
+            <a href="/MiniGame" class="header-menu-link ">@Lang.MiniGame</a>
+            @*<li class="menu-item-has-children header-menu-link ">
                 <a href="#" class="">
                     E-Library
                     <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
@@ -84,7 +84,7 @@
                     <li><a href="/Ebook/">@Lang.Ebook</a></li>
                     <li><a href="/Ebook/Video">Children's Video</a></li>
                 </ul>
-            </li>
+            </li>*@
         }
     }
 }

+ 12 - 9
Website/NEducation/Views/Common/LessonView.cshtml

@@ -41,6 +41,7 @@
                     <a href="/Ebook/Video">Children's Video</a>
                 </div>
             </div>
+            <a href="/MiniGame" class="header-menu-link ">@Lang.MiniGame</a>
         }
         else
         {
@@ -48,6 +49,7 @@
             <a href="/Common/Course?courseType=@UtilsController.Constant.EN_VOCABULARY" class="nav-link">@Lang.Vocabulary</a>
             <a href="/Common/Course?courseType=@UtilsController.Constant.EN_GRAMMAR" class="nav-link">@Lang.Grammar</a>
             <a href="/Common/Course?courseType=@UtilsController.Constant.EN_LISTEN" class="nav-link">@Lang.Listening</a>
+            <a href="/MiniGame" class="nav-link">@Lang.MiniGame</a>
         }
     }
 }
@@ -81,6 +83,7 @@
             <a href="/Common/Course?courseType=@UtilsController.Constant.EN_VOCABULARY" class="header-menu-link ">@Lang.Vocabulary</a>
             <a href="/Common/Course?courseType=@UtilsController.Constant.EN_GRAMMAR" class="header-menu-link ">@Lang.Grammar</a>
             <a href="/Common/Course?courseType=@UtilsController.Constant.EN_LISTEN" class="header-menu-link ">@Lang.Listening</a>
+            <a href="/MiniGame" class="header-menu-link ">@Lang.MiniGame</a>
             @*<a href="/Ebook/" class="header-menu-link ">
                     @Lang.Ebook
                     <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
@@ -171,22 +174,22 @@
                             (@Model.course.fee HTG)
                         </a>*@
 
-                    <a id="buy-button" class="button-ranking" style="display: @displayBuy"
-                       data-toggle="modal"
-                       data-target="#buycourse-dialog"
-                       onclick="BuyCourse()"
-                       href="#">
-                        @Lang.Buy
-                    </a>
+                    @*<a id="buy-button" class="button-ranking" style="display: @displayBuy"
+                           data-toggle="modal"
+                           data-target="#buycourse-dialog"
+                           onclick="BuyCourse()"
+                           href="#">
+                            @Lang.Buy
+                        </a>*@
 
                     @{
                         if (msisdn != "false")
                         {
-                            <a id="sub-button" class="button-renew btn-subscribe"
+                            @*<a id="sub-button" class="button-renew btn-subscribe"
                                style="display: @displayReg"
                                href="#">
                                 @Lang.Subscriber
-                            </a>
+                            </a>*@
                         }
                         else
                         {

+ 2 - 1
Website/NEducation/Views/Ebook/Index.cshtml

@@ -29,7 +29,7 @@
             <li><a href="/Ebook/Video">Children's Video</a></li>
         </ul>
     </li>
-
+    <a href="/MiniGame" class="header-menu-link ">@Lang.MiniGame</a>
     @*<a href="/Music/" class="nav-link">Music</a>*@
 }
 
@@ -59,6 +59,7 @@
             <li><a href="/Ebook/Video">Children's Video</a></li>
         </ul>
     </li>
+    <a href="/MiniGame" class="header-menu-link ">@Lang.MiniGame</a>
 }
 
 <style>

+ 25 - 22
Website/NEducation/Views/Grammar/Index.cshtml

@@ -14,27 +14,28 @@
     <a href="/Common/Course?courseType=2" class="nav-link link-libary">@Lang.Library</a>
     <a href="/Voca/" class="nav-link">
         @Lang.Vocabulary
-        @*VOCABULARY*@                                                                                                 
+        @*VOCABULARY*@
     </a>
     @*<a href="/Grammar/" class="nav-link">Grammar</a>*@
     <a href="/Listening/" class="nav-link">
         @Lang.Listening
         @*LISTENING*@
     </a>
+    <a href="/MiniGame" class="header-menu-link ">@Lang.MiniGame</a>
     @*<a href="/Ebook/" class="nav-link">
             @Lang.Ebook
             <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
         </a>*@
-<div class="dropdown nav-link">
-    <button onclick="myFunction()" class="dropbtn">
-        E-Library
-        <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
-    </button>
-    <div id="myDropdown" class="dropdown-content">
-        <a href="/Ebook/">@Lang.Ebook</a>                                                                                                                                                  <a href="/Ebook/">@Lang.Ebook</a>
-        <a href="/Ebook/Video">Children's Video</a>
-    </div>
-</div>
+    @*<div class="dropdown nav-link">
+            <button onclick="myFunction()" class="dropbtn">
+                E-Library
+                <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
+            </button>
+            <div id="myDropdown" class="dropdown-content">
+                <a href="/Ebook/">@Lang.Ebook</a>                                                                                                                                                  <a href="/Ebook/">@Lang.Ebook</a>
+                <a href="/Ebook/Video">Children's Video</a>
+            </div>
+        </div>*@
 
 
     @*<a href="/Grammar/Method" class="nav-link link-help">Method</a>
@@ -60,25 +61,27 @@
         @Lang.Listening
         @*LISTENING*@
     </a>
+    <a href="/MiniGame" class="header-menu-link ">@Lang.MiniGame</a>
     @*<a href="/Ebook/" class="header-menu-link">
             @Lang.Ebook
             <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
         </a>*@
 
-    <li class="menu-item-has-children header-menu-link ">
-        <a href="#" class="">
-            E-Library
-            <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
-        </a>
-        <ul class="" style=" margin-left: 20px;">
-            <li><a href="/Ebook/">@Lang.Ebook</a></li>
-            <li><a href="/Ebook/Video">Children's Video</a></li>
-        </ul>
-    </li>
+    @*<li class="menu-item-has-children header-menu-link ">
+            <a href="#" class="">
+                E-Library
+                <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
+            </a>
+            <ul class="" style=" margin-left: 20px;">
+                <li><a href="/Ebook/">@Lang.Ebook</a></li>
+                <li><a href="/Ebook/Video">Children's Video</a></li>
+            </ul>
+        </li>*@
 
     @*<a href="/Music/" class="header-menu-link ">MUSIC</a>*@
     @*</p>
         <a href="/Home/support" class="header-menu-link ">Help</a>*@
+
 }
 
 <!-- Top -->
@@ -90,7 +93,7 @@
 
                 <h1 class="top-left-header">
                     <img src="~/Content/assets/imgs/student.png" /><br />
-                    <span id="title">USTUDY</span>
+                    <span id="title">MEDU</span>
                 </h1>
                 <p class="top-left-text">
                     @Lang.OvercomingAnObstacleWithYou

+ 8 - 29
Website/NEducation/Views/Home/EnglishIndex.cshtml

@@ -22,23 +22,12 @@
     <a href="/Common/Course?courseType=@UtilsController.Constant.EN_VOCABULARY" class="nav-link">@Lang.Vocabulary</a>
     <a href="/Common/Course?courseType=@UtilsController.Constant.EN_GRAMMAR" class="nav-link">@Lang.Grammar</a>
     <a href="/Common/Course?courseType=@UtilsController.Constant.EN_LISTEN" class="nav-link">@Lang.Listening</a>
-    <a href="/MiniGame" class="nav-link ">@Lang.MiniGame</a>
+    <a href="/MiniGame" class="nav-link">@Lang.MiniGame</a>
     @*<a href="/Ebook/" class="nav-link">
             @Lang.Ebook
             <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
         </a>*@
 
-    <div class="dropdown nav-link">
-        <button onclick="myFunction()" class="dropbtn">
-            E-Library
-            <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
-        </button>
-        <div id="myDropdown" class="dropdown-content">
-            <a href="/Ebook/">@Lang.Ebook</a>
-            <a href="/Ebook/Video">Children's Video</a>
-        </div>
-    </div>
-
     @*<a href="/Music/" class="nav-link">Music</a>*@
 }
 
@@ -53,16 +42,6 @@
             <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
         </a>*@
 
-    <li class="menu-item-has-children header-menu-link ">
-        <a href="#" class="">
-            E-Library
-            <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
-        </a>
-        <ul class="" style=" margin-left: 20px;">
-            <li><a href="/Ebook/">@Lang.Ebook</a></li>
-            <li><a href="/Ebook/Video">Children's Video</a></li>
-        </ul>
-    </li>
 }
 
 <input type="hidden" id="current-url" value="">
@@ -109,7 +88,7 @@
                     <div class="col-md-6 col-xs-12 col-sm-6" align="center">
                         <div id="logo">
                             <img src="~/Content/assets/imgs/student.png" />
-                            <h1 id="title-left-top"><span id="title">USTUDY</span></h1>
+                            <h1 id="title-left-top"><span id="title">MEDU</span></h1>
                             <text style="color:#FFF" font-family="'opensansregular'" font-size="17">
                                 @Lang.OvercomingAnObstacle
                             </text>
@@ -133,10 +112,10 @@
                                 @Lang.LoginNow
                             </a>
 
-                            <a href="javascript:void(0)" id="btn-start" class="btn-subscribe-now"
+                            @*<a href="javascript:void(0)" id="btn-start" class="btn-subscribe-now"
                                style="display:@displaySub">
                                 @Lang.SubscriberNow
-                            </a>
+                            </a>*@
 
                             <a href="/Common/Course" id="btn-start" style="display:@displayUser">
                                 @Lang.GetStartedNow
@@ -173,15 +152,15 @@
                            style="display:block">
                             @Lang.SignUp
                         </a>*@
-                    <a href="javascript:void(0)" class="home-intro-try-free" data-toggle="modal" data-target="#login-dialog"
-                       style="display:block">@Lang.LoginNow</a>
+                    @*<a href="javascript:void(0)" class="home-intro-try-free" data-toggle="modal" data-target="#login-dialog"
+                       style="display:block">@Lang.LoginNow</a>*@
 
                     <a href="/Common/Course" class="home-intro-button" style="display:@displayUser">
                         @Lang.GetStartedNow
                     </a>
-                    <a href="javascript:void(0)" class="home-intro-button" data-toggle="modal" data-target="#signup-dialog" style="display:@displaySub">
+                    @*<a href="javascript:void(0)" class="home-intro-button" data-toggle="modal" data-target="#signup-dialog" style="display:@displaySub">
                         @Lang.SubscriberNow
-                    </a>
+                    </a>*@
                 </div>
             </div>
 

+ 6 - 6
Website/NEducation/Views/Home/_ModalRanking.cshtml

@@ -28,9 +28,9 @@
                                         <p>2</p>
                                     </div>
                                     <div class="top-rank-info top-rank-info-second">
-                                        <p class="rank-avatar">
+                                        @*<p class="rank-avatar">
                                             <img src="@Model.ranking.listRanking[1].picture" />
-                                        </p>
+                                        </p>*@
                                         <p class="rank-name"><a href="#">@Model.ranking.listRanking[1].fullName</a></p>
                                         <div class="rank-number-group rank-number-group-second">
                                             <div class="top-rank-word">
@@ -65,9 +65,9 @@
                                                 <img class="cup-img" src="~/Content/assets/imgs/cup-image.png" />
                                             </p>
                                         </div>
-                                        <p class="rank-avatar">
+                                        @*<p class="rank-avatar">
                                             <img src="@Model.ranking.listRanking[0].picture" />
-                                        </p>
+                                        </p>*@
                                         <p class="rank-name"><a href="#">@Model.ranking.listRanking[0].fullName</a></p>
                                         <div class="rank-number-group">
                                             <div class="top-rank-word">
@@ -97,9 +97,9 @@
                                         <p>3</p>
                                     </div>
                                     <div class="top-rank-info top-rank-info-third">
-                                        <p class="rank-avatar">
+                                        @*<p class="rank-avatar">
                                             <img src="@Model.ranking.listRanking[2].picture" />
-                                        </p>
+                                        </p>*@
                                         <p class="rank-name"><a href="#">@Model.ranking.listRanking[2].fullName</a></p>
                                         <div class="rank-number-group rank-number-group-third">
                                             <div class="top-rank-word">

+ 11 - 10
Website/NEducation/Views/Individual/Index.cshtml

@@ -16,21 +16,22 @@
     <a href="/Grammar/" class="nav-link">@Lang.Grammar</a>
     @*<a href="/Music/" class="nav-link">Music</a>*@
     <a href="/Listening/" class="nav-link">@Lang.Listening</a>
+    <a href="/MiniGame" class="nav-link">@Lang.MiniGame</a>
     @*<a href="/Ebook/" class="nav-link">
             @Lang.Ebook
             <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
         </a>*@
 
-    <div class="dropdown nav-link">
-        <button onclick="myFunction()" class="dropbtn">
-            E-Library
-            <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
-        </button>
-        <div id="myDropdown" class="dropdown-content">
-            <a href="/Ebook/">@Lang.Ebook</a>
-            <a href="/Ebook/Video">Children's Video</a>
-        </div>
-    </div>
+    @*<div class="dropdown nav-link">
+            <button onclick="myFunction()" class="dropbtn">
+                E-Library
+                <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
+            </button>
+            <div id="myDropdown" class="dropdown-content">
+                <a href="/Ebook/">@Lang.Ebook</a>
+                <a href="/Ebook/Video">Children's Video</a>
+            </div>
+        </div>*@
 }
 
 @{

+ 25 - 24
Website/NEducation/Views/Listening/Index.cshtml

@@ -29,17 +29,17 @@
             @Lang.Ebook
             <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
         </a>*@
-
-    <div class="dropdown nav-link">
-        <button onclick="myFunction()" class="dropbtn">
-            E-Library
-            <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
-        </button>
-        <div id="myDropdown" class="dropdown-content">
-            <a href="/Ebook/">@Lang.Ebook</a>
-            <a href="/Ebook/Video">Children's Video</a>
-        </div>
-    </div>
+    <a href="/MiniGame" class="nav-link">@Lang.MiniGame</a>
+    @*<div class="dropdown nav-link">
+            <button onclick="myFunction()" class="dropbtn">
+                E-Library
+                <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
+            </button>
+            <div id="myDropdown" class="dropdown-content">
+                <a href="/Ebook/">@Lang.Ebook</a>
+                <a href="/Ebook/Video">Children's Video</a>
+            </div>
+        </div>*@
 }
 
 @section menu{
@@ -58,21 +58,22 @@
     <a href="/Listening/" class="header-menu-link ">
         @Lang.Listening
     </a>
+    <a href="/MiniGame" class="header-menu-link ">@Lang.MiniGame</a>
     @*<a href="/Ebook/" class="header-menu-link">
             @Lang.Ebook
             <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
         </a>*@
 
-    <li class="menu-item-has-children header-menu-link ">
-        <a href="#" class="">
-            E-Library
-            <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
-        </a>
-        <ul class="" style=" margin-left: 20px;">
-            <li><a href="/Ebook/">@Lang.Ebook</a></li>
-            <li><a href="/Ebook/Video">Children's Video</a></li>
-        </ul>
-    </li>
+    @*<li class="menu-item-has-children header-menu-link ">
+            <a href="#" class="">
+                E-Library
+                <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
+            </a>
+            <ul class="" style=" margin-left: 20px;">
+                <li><a href="/Ebook/">@Lang.Ebook</a></li>
+                <li><a href="/Ebook/Video">Children's Video</a></li>
+            </ul>
+        </li>*@
 }
 
 <!-- Top -->
@@ -168,9 +169,9 @@
                     @*Không Ngôn Ngữ*@
                     @*@Lang.UstudyHasDevelopedANewMethodToImproveSpeakingSkillBaseOnNaturalLanguageApproach*@
                     @*Rejoignez N-EDUCATION pour découvrir plus d'informations sur
-        cette excellente méthode et savoir comment Natural English
-        peut vous aider à améliorer votre compréhension orale en
-        anglais en seulement 6 mois.*@
+                        cette excellente méthode et savoir comment Natural English
+                        peut vous aider à améliorer votre compréhension orale en
+                        anglais en seulement 6 mois.*@
                 </p>
 
             </div>

+ 85 - 42
Website/NEducation/Views/MiniGame/Index.cshtml

@@ -1,4 +1,6 @@
-@model NEducation.Models.CheckMiniGameModel
+@using NEducation.Content.Texts;
+
+@model NEducation.Models.CheckMiniGameModel
 @{
     ViewBag.Title = "MiniGame";
     Layout = "~/Views/Shared/_LayoutMiniGame.cshtml";
@@ -21,11 +23,13 @@
 
         <div class="minigame_content">
             <div class="text-c-1 text-s-36 justify-center top-50">
-                MINI GAME
+                @*"ហ្គេមតូច"*@
+                @Lang.Tille_minigame
             </div>
             <div class="pb-[10px]">
                 <div class="text-c-2 w-full justify-center font-z-10 top-30 bottom-30 text-s-15">
-                    Let me know your answers!
+                    @Lang.LetMeKnowYourAnsWers
+                    @*"អនុញ្ញាតឱ្យខ្ញុំដឹងពីចម្លើយរបស់អ្នក!"*@
                 </div>
             </div>
             <div class="w-full min-h-[200px] flex relative mb-[10px]" id="div_clock" style="display: @(ViewBag.ShowClock ? "block" : "none")">
@@ -40,7 +44,7 @@
                                     </div>
                                 </div>
                                 <div class="text-c-1 justify-center">
-                                    Days
+                                    @Lang.Days
                                 </div>
                             </div>
                             <div class="relative">
@@ -51,7 +55,7 @@
                                     </div>
                                 </div>
                                 <div class="text-c-1 justify-center">
-                                    hours
+                                    @Lang.Hours
                                 </div>
                             </div>
                             <div class="relative mt-[5px]">
@@ -62,7 +66,7 @@
                                     </div>
                                 </div>
                                 <div class="text-c-1 justify-center">
-                                    minutes
+                                    @Lang.Minutes
                                 </div>
                             </div>
                         </div>
@@ -76,7 +80,7 @@
                             <img src="~/Content/assets/mini_game/assets/images/cup_icon.png" />
                         </div>
                         <div class="text-c-1 font-z-18">
-                            Play Now
+                            @Lang.PlayNow
                         </div>
                     </div>
                 </a>
@@ -86,12 +90,12 @@
                 <div class="w-full justify-center gap-[1rem] items-center mb-[2px] pt-[10px] relative z-[999]">
                     <a onclick="redirectToRank()">
                         <div class="btn-option active_predict">
-                            Ranking
+                            @Lang.Ranking
                         </div>
                     </a>
                     <a onclick="ruleClick()">
                         <div class="btn-option">
-                            How to play
+                            @Lang.HowToPlay
                         </div>
                     </a>
                 </div>
@@ -103,10 +107,7 @@
                             <div class="pt-[35px]">
                                 <div class="ranking-box-header">
                                     <div class="flex justify-center items-center pb-1">
-                                        <div class="text-c-1">List of special prize winners</div>
-                                    </div>
-                                    <div class="flex justify-center items-center">
-                                        <div class="text-c-1" style="font-size: 20px;">20 $</div>
+                                        <div class="text-c-1">@Lang.ListOfSpecialPrizeWinners</div>
                                     </div>
                                 </div>
                                 <div class="ranking-data" id="ranking_data"></div>
@@ -117,17 +118,16 @@
             </div>
             <div id="minigame-rule-data-box" class="hide" style="border-radius: 0px 24px 24px 24px;">
                 <div class="rule-box">
-                    <p>1. The mini-game starts at 10:00 AM every Sunday.</p>
-                    <p>2. You have 15 seconds to think and give your answer.</p>
-                    <p>3. Each person can only participate in the minigame once per day. If there is a system error during the minigame, the participant cannot play again, and it will be counted as one play. <br /> 4. Participants must be subscribers of the service.</p>
-                    <p>5. The minigame consists of 20 questions.</p>
-                    <p>6. Each question must be answered within 15 seconds.</p>
-                    <p>7. If a participant answers incorrectly, the game will immediately end, and they will not be able to play again.</p>
-                    <p>8. Prizes:</p>
-                    <p>- There is only one prize for the participant who correctly answers all 20 questions the fastest.</p>
-                    <p>- The prize is 20$, added to Emoney</p>
-                    <p>- If multiple participants answer correctly at the same time, the prize money will be evenly divided among them.</p>
-                    <p>- Results will be sent to the participants via SMS at 09:00 AM on the following Monday.</p>
+                    <p>1. @Lang.TheMiniGameStartsAt</p>
+                    <p>2. @Lang.YouHave15Seconds</p>
+                    <p>3. @Lang.EachPersonCanOnly<br /> 4. @Lang.ParticipantsMustBe.</p>
+                    <p>5. @Lang.TheMinigameConsists </p>
+                    <p>6. @Lang.EachQuestionMustBe.</p>
+                    <p>7. @Lang.IfaParticipantAnswers.</p>
+                    <p>8. @Lang.Prizes:</p>
+                    <p>- @Lang.ThereIsOnlyOnePrizeFor.</p>
+                    <p>- @Lang.IfPultipleParticipantsAnswerCorrectly.</p>
+                    <p>- @Lang.ResultsWillBeSentToTheParticipants.</p>
                 </div>
             </div>
 
@@ -136,13 +136,13 @@
                 <div class="popup-content">
                     <!-- Close button -->
                     <button id="close-popup" class="close-popup-button">✕</button>
-                    <h2>Oops...!</h2>
-                    <p>You haven't registered MEDU service yet. Please try to register and come back to play the mini-game. Thank you.</p>
+                    @*<h2>Oops...!</h2>*@
+                    <p id="popup-message"></p>
                     <div class="flex justify-center items-center gap-[20px] top-50">
                         <a href="/Home" style="z-index:10">
                             <div class="btn-c-2">
                                 <div class="text-c-1 font-z-18 button-box">
-                                    Home
+                                    @Lang.Home
                                 </div>
                             </div>
                         </a>
@@ -156,17 +156,24 @@
 <script>
     $(document).ready(function () {
         redirectToRank();
+        if (checkOPP == "NO_SUB") {
+            popupMessageElement.innerText = '@Lang.YouHaven_tRegisteredMEDU'
+            showPopup();
+        }
     });
 
     var sysdateString = '@ViewBag.Sysdate';
     var startDateString = '@ViewBag.StartDate';
     var endDateString = '@ViewBag.EndDate';
-    var isSubscribed = '@ViewBag.IsSubscribed';
-
     var sysdate = new Date(sysdateString);
     var startDate = new Date(startDateString);
     var endDate = new Date(endDateString);
 
+    var mShowClock = '@ViewBag.ShowClock';
+    var ShowPlayButton = '@ViewBag.ShowPlayButton';
+
+    var checkOPP = '@ViewBag.checkOPP';
+
     var countDownDate;
 
     function showPopup() {
@@ -177,26 +184,62 @@
         document.getElementById('popup-container').classList.add('hidden');
     };
 
-    document.getElementById("playNowButton").onclick = function() {
-        if (isSubscribed != "1") {
+    document.getElementById("playNowButton").onclick = function () {
+        var popupMessageElement = document.getElementById('popup-message');
+
+        if (checkOPP == "NO_SUB") {
+            popupMessageElement.innerText = '@Lang.YouHaven_tRegisteredMEDU'
             showPopup();
-        } else {
+        }
+        else if (checkOPP == "DA_CHOI") {
+             popupMessageElement.innerText = '@Lang.YouHaveOutOfTurnToPlayMinigame';
+             showPopup();
+        }
+        else {
+
             window.location.href = '@Url.Action("StartPlay", "MiniGame")';
         }
     };
-
-    if (sysdate < startDate) {
-        countDownDate = startDate.getTime();
+    countDownDate = startDate.getTime();
+    if (mShowClock) {
         $("#div_clock").show();
-        $("#div_play").hide();
-    } else if (sysdate >= startDate && sysdate <= endDate) {
-        countDownDate = endDate.getTime();
-        $("#div_clock").show();
-        $("#div_play").hide();
-    } else {
-        $("#div_clock").hide();
+    }
+    if (ShowPlayButton) {
         $("#div_play").show();
     }
+    //if (isPlay) {
+    //    $("#div_clock").hide();
+    //    $("#div_play").show();
+    //} else {
+    //    $("#div_clock").show();
+    //    $("#div_play").show();
+    //}
+    //if (sysdate < startDate) {
+    //    countDownDate = startDate.getTime();
+    //    $("#div_play").show();
+    //    $("#div_clock").show();
+    //    //if (isSubscribed == "1" && isPlay) {
+    //    //    $("#div_play").show();
+    //    //    $("#div_clock").hide();
+    //    //} else {
+    //    //    $("#div_clock").show();
+    //    //    $("#div_play").hide();
+    //    //}
+
+    //} else if (sysdate >= startDate && sysdate <= endDate) {
+    //    countDownDate = endDate.getTime();
+    //    if (isPlay) {
+    //        $("#div_play").show();
+    //        $("#div_clock").hide();
+    //    } else {
+    //        $("#div_clock").show();
+    //        $("#div_play").hide();
+    //    }
+
+    //} else {
+    //    $("#div_clock").hide();
+    //    $("#div_play").show();
+    //}
 
     if (countDownDate) {
         $("#div_clock").show();

+ 58 - 19
Website/NEducation/Views/MiniGame/_RankingDataPartial.cshtml

@@ -1,33 +1,72 @@
 @model NEducation.Models.WinnerMiniGameModel
 
+
+<style>
+    .scrollable-container {
+        max-height: 200px; /* Adjust the height to control the visible area */
+        overflow-y: auto; /* Enable vertical scrolling */
+        overflow-x: hidden; /* Prevent horizontal scrolling */
+        padding: 5px;
+    }
+
+    .data-line.bottom-border {
+        border-bottom: 1px solid #ddd;
+        padding: 10px 0;
+    }
+
+    /* Optional: Custom scrollbar styles */
+    .scrollable-container::-webkit-scrollbar {
+        width: 8px;
+    }
+
+    .scrollable-container::-webkit-scrollbar-track {
+        background: #f1f1f1;
+    }
+
+    .scrollable-container::-webkit-scrollbar-thumb {
+        background: #888;
+        border-radius: 4px;
+    }
+
+        .scrollable-container::-webkit-scrollbar-thumb:hover {
+            background: #555;
+        }
+
+    .data-line {
+        display: flex;
+        align-items: center;
+    }
+</style>
+
 <div class="row data-line">
     <div class="col-6">
-        <h6 class="fw-semibold mb-0 text-c-1">Date</h6>
+        <h6 class="fw-semibold mb-0 text-c-1">@NEducation.Content.Texts.Lang.Date</h6>
     </div>
     <div class="col-6 right">
-        <h6 class="fw-semibold mb-0 text-c-1 right">Phone number</h6>
+        <h6 class="fw-semibold mb-0 text-c-1 right">@NEducation.Content.Texts.Lang.Phone_number</h6>
     </div>
 </div>
-<div class="row data-line bottom-border">
-    @if (Model.Winner != null && Model.Winner.listWinner != null)
+
+<div class="scrollable-container">
+    @if (Model != null )
     {
         foreach (var winner in Model.Winner.listWinner)
         {
-            var sysdateParsed = DateTime.TryParseExact(winner.sysdate,
-                     "M/d/yyyy h:mm:ss tt",  // Định dạng chuỗi input
-                     System.Globalization.CultureInfo.InvariantCulture,
-                     System.Globalization.DateTimeStyles.None,
-                     out DateTime sysdate);
-            <div class="col-6">
-                <h6 class="fw-semibold mb-0 fw-semibold mb-1 ">
-                    <div class="text-c-1 font-z-10">@(sysdateParsed ? sysdate.ToString("dd/MM/yyyy") : "Invalid Date")</div>
-                    <div class="text-c-1 font-z-12">@(sysdateParsed ? sysdate.ToString("HH:mm:ss") : "Invalid Time")</div>
-                </h6>
-            </div>
-            <div class="col-6 right">
-                <h6 class="fw-semibold mb-0 fw-semibold mb-1 text-c-1 right">
-                    @winner.msisdn
-                </h6>
+            var sysdateParsed = DateTime.TryParseExact(winner.sysdate, "M/d/yyyy h:mm:ss tt",
+                                                       System.Globalization.CultureInfo.InvariantCulture,
+                                                       System.Globalization.DateTimeStyles.None, out DateTime sysdate);
+            <div class="row data-line bottom-border">
+                <div class="col-6">
+                    <h6 class="fw-semibold mb-0 fw-semibold mb-1">
+                        <div class="text-c-1 font-z-10">@sysdate.ToString("dd/MM/yyyy")</div>
+                        <div class="text-c-1 font-z-12">@sysdate.ToString("HH:mm:ss")</div>
+                    </h6>
+                </div>
+                <div class="col-6 right">
+                    <h6 class="fw-semibold mb-0 fw-semibold mb-1 text-c-1 right">
+                        @winner.msisdn
+                    </h6>
+                </div>
             </div>
         }
     }

+ 5 - 9
Website/NEducation/Views/MiniGame/play.cshtml

@@ -8,7 +8,7 @@
     Layout = "~/Views/Shared/_LayoutMiniGame.cshtml";
     GrammarModel model = Session["model"] as GrammarModel;
 
-    int questionIndex = model.currentQuestionIndex;
+    int questionIndex = model.currentQuestionIndex-1;
 
 }
 <style>
@@ -68,7 +68,7 @@
                 <div class="text-c-1 text-s-32 justify-center top-100 text-black-color">
                     @if (Model.questions != null && Model.questions.Count > 0)
                     {
-                        <text>Question @(questionIndex)/@(Model.questions.Count): @NEducation.Content.Texts.Lang.ContentQuestions</text>
+                        <text>@NEducation.Content.Texts.Lang.Question @(questionIndex)/@(Model.questions.Count): @NEducation.Content.Texts.Lang.ContentQuestions</text>
                     }
                 </div>
 
@@ -112,8 +112,8 @@
                 <div class="flex justify-center items-center gap-[20px] top-50">
                     <button onclick="submitAnswer()">
                         <div class="btn-c-2">
-                            <div class="text-c-1 font-z-18 button-box">
-                                Confirm
+                            <div class="text-c-1 font-z-18 button-box" >
+                                @NEducation.Content.Texts.Lang.Confirm
                             </div>
                         </div>
                     </button>
@@ -122,7 +122,6 @@
         </div>
     </div>
 </div>
-
 @*<script src="~/Content/assets/mini_game/js/minigame_main.js"></script>*@
 <script>
     var totalTime = @UtilsController.questionTimeout;
@@ -257,10 +256,7 @@
      } else {
          alert("Please select an answer before submitting!");
      }
- }
-
-
-
+    }
 
 </script>
 

+ 5 - 5
Website/NEducation/Views/MiniGame/result.cshtml

@@ -19,7 +19,7 @@
         <div class="minigame_content">
             <div>
                 <div class="text-c-1 text-s-36 justify-center top-50">
-                    MINIGAME
+                    @NEducation.Content.Texts.Lang.MiniGame
                 </div>
                 <div class="top-50">
                     <img class="img-result" src="~/Content/assets/mini_game/assets/images/gold_cup_2.png" />
@@ -30,12 +30,12 @@
                         @if (ViewBag.check == 1)
                         {
 
-                            <p>Congratulations! </p>
-                            <p>You're done! [x] correct answers! Your skills and determination have paid off, and we're excited to celebrate your victory. The leaderboard will be updated every Monday morning. Your ranking money will be announced soon. Thank you.</p>
+                            @*<p>@NEducation.Content.Texts.Lang.Congratulation ! </p>*@
+                            <p>Congratulation ! @NEducation.Content.Texts.Lang.You_veDoneit_You_ve20CorrectAnwsers</p>
                         }
                         else
                         {
-                            <p>Oops ..!! Your question is incorrect. But don't worry, you're doing great! Next time, join us for an exciting game and test your skills! It's a fun way to learn and win rewards.</p>
+                            <p>@NEducation.Content.Texts.Lang.Oops</p>
                         }
                     </div>
                 </div>
@@ -45,7 +45,7 @@
                 <a href="/MiniGame" style="z-index:10">
                     <div class="btn-c-2">
                         <div class="text-c-1 font-z-18 button-box">
-                            Home
+                            @NEducation.Content.Texts.Lang.Home
                         </div>
                     </div>
                 </a>

+ 64 - 202
Website/NEducation/Views/Shared/_LayoutHome.cshtml

@@ -1,6 +1,5 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="vi">
-@using NEducation.Content.Texts;
+<html lang="en">
 @using NEducation.Controllers;
 @using NEducation.Code;
 @using NEducation.Content.Texts; 
@@ -83,6 +82,8 @@
     @*<script src="~/Content/assets/mini_game/lib/jquery/dist/jquery.min.js"></script>*@
     <script src="~/Content/assets/mini_game/js/framework.js"></script>
     <script src="~/Content/assets/mini_game/js/minigame_function.js"></script>
+    <script src="~/Content/assets/mini_game/js/function.js"></script>
+    
     <link rel="preconnect" href="https://fonts.googleapis.com" />
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=crossorigin />
     <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;700&family=Quicksand:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
@@ -189,14 +190,14 @@
                 <div class="header-right">
                     <div class="new-footer-img-ad" style="display:inline-block">
                         <a href="" class="btn setLang" data-lang="km" lang="km">
-                            <img src="/Content/assets/imgs/co_cam.png" title="Laos" />
+                            <img src="/Content/assets/imgs/Flag_of_Cambodia.png" title="Cam" />
                         </a>
-                        <a href="" class="btn setLang" data-lang="vi" lang="vi">
-                            <img src="/Content/assets/imgs/flag_vn.png" title="Vietnam" />
-                        </a>
-                        @*<a href="" class="btn setLang" data-lang="en" lang="en">
-                                <img src="../Content/assets/imgs/flag_vn.png" title="USA" />
-                            </a>*@
+                        @*<a href="" class="btn setLang" data-lang="vi" lang="vi">
+                            <img src="/Content/assets/imgs/flag_vn.png" title="English" />
+                        </a>*@
+                        <a href="" class="btn setLang" data-lang="en" lang="en">
+                                <img src="/Content/assets/imgs/Flag_of_the_United_Kingdom.png" title="USA" />
+                            </a>
                     </div>
                 </div>
                 <div class="header-right">
@@ -288,13 +289,13 @@
                         </a>
                     </div>
                     <div class="col-xs-12 col-sm-5 col-md-5 no-padding new-footer-img" style=" text-align: center;">
-                        <p class="footer-title">LaoApp</p>
+                        <p class="footer-title">CamID</p>
 
                         <div class="new-footer-img-ad">
-                            <a class="btn" href="http://laosapp.la/app">
+                            <a class="btn" href="https://apps.apple.com/vn/app/camid-movies-games-rewards/id1321717513?l=vi">
                                 <img src="/Content/assets/imgs/icon-app-store.png" />
                             </a>
-                            <a class="btn" href="http://laosapp.la/app">
+                            <a class="btn" href="https://play.google.com/store/apps/details?id=com.metfone.selfcare">
                                 <img src="/Content/assets/imgs/icon-gg-play.png" />
 
                             </a>
@@ -302,11 +303,11 @@
                         <div class="language">
                             <h3 class="footer-title ">@Lang.language</h3>
                             <div class="new-footer-img-ad ">
-                                <a href="" class="btn setLang" data-lang="la" lang="la" style="width:55px;">
-                                    <img src="/Content/assets/imgs/lao_flag.png" />
+                                <a href="" class="btn setLang" data-lang="km" lang="km" style="width:55px;">
+                                    <img src="/Content/assets/imgs/Flag_of_Cambodia.png" />
                                 </a>
-                                <a href="" class="btn setLang" data-lang="vi" lang="vi" style="width: 55px;">
-                                    <img src="/Content/assets/imgs/vietnam_flag.png" />
+                                <a href="" class="btn setLang" data-lang="en" lang="en" style="width: 55px;">
+                                    <img src="/Content/assets/imgs/Flag_of_the_United_Kingdom.png" />
                                 </a>
 
                             </div>
@@ -593,26 +594,6 @@
 
                                         if (english == null || english.Count == 0)
                                         {
-                                            @*<div class="type-language-container" onclick="chooseCourse(@UtilsController.Constant.LAOS)">
-                                                <a href="#" id="btn-login" class="button btn-login box">@(Lang.laos.ToUpper())</a>
-                                                <div class="free-float-box">
-                                                    <img src="~/Content/assets/imgs/giphy.gif" />
-                                                </div>
-                                                <div class="flag-float-box">
-                                                    <img src="~/Content/assets/imgs/lao_flag.png" />
-                                                </div>
-                                            </div>*@
-
-                                            @*<div class="type-language-container" onclick="chooseCourse(@UtilsController.Constant.VIETNAMESE)">
-                                                <a href="#" id="btn-login" class="button btn-login box">@(Lang.vietnamese.ToUpper())</a>
-                                                <div class="free-float-box">
-                                                    <img src="~/Content/assets/imgs/giphy.gif" />
-                                                </div>
-                                                <div class="flag-float-box">
-                                                    <img src="~/Content/assets/imgs/vietnam_flag.png" />
-                                                </div>
-                                            </div>*@
-
                                             <div class="type-language-container" onclick="chooseCourse(@UtilsController.Constant.ENGLISH)">
                                                 <a href="#" id="btn-login" class="button btn-login box">@(Lang.english.ToUpper())</a>
 
@@ -625,23 +606,10 @@
                                             </div>
 
                                         }
-                                        @*if (homefitness == null || homefitness.Count == 0)
-                                        {
-                                            <div class="type-language-container" onclick="chooseCourse(@UtilsController.Constant.HOMEFITNESS)">
-                                                <a href="#" id="btn-login" class="button btn-login box">@("HOME FITNESS")</a>
-
-                                                <div>
-                                                    <a href="#" class="cost-des-box">@("300 KIP/day".ToUpper())</a>
-                                                </div>
-                                                <div class="flag-float-box">
-                                                    <img src="~/Content/assets/imgs/lao_flag.png" />
-                                                </div>
-                                            </div>
-                                        }*@
-
-                                        <div style=" margin: 10px 0; margin-top: 50px;">
+                                       
+                                        @*<div style=" margin: 10px 0; margin-top: 50px;">
                                             <a class="des-a"><i class="fas fa-check-square"></i> @Lang.haveAccount1 </a><a class="link-button" onclick="login(); return 0;">@Lang.LoginNow</a>
-                                        </div>
+                                        </div>*@
 
                                         @*<div style=" margin: 10px 0;">
                                             <a class="des-a"><i class="fas fa-check-square"></i> @Lang.haveNoAccount </a><a class="link-button" onclick="createFree(); return 0;">@Lang.createNow </a> <a class="des-a">@Lang.toJoinAttractiveCourses</a>
@@ -688,9 +656,9 @@
                                 <a href="#" id="btn-register-sub" class="button btn-signup check-sub-dim">@Lang.Register</a>
 
                                 <div>
-                                    <a class="des-a"><i class="fas fa-check-square"></i> @Lang.haveAccount1 </a>
-                                    <a class="link-button" onclick="login(); return 0;">@Lang.loginNow1 </a>
-                                    <a class="des-a">@Lang.toJoinAttractiveCourses</a>
+                                    @*<a class="des-a"><i class="fas fa-check-square"></i> @Lang.haveAccount1 </a>*@
+                                    @*<a class="link-button" onclick="login(); return 0;">@Lang.loginNow1 </a>*@
+                                    @*<a class="des-a">@Lang.toJoinAttractiveCourses</a>*@
                                 </div>
                             </form>
                         </div>
@@ -736,7 +704,7 @@
                                     <div id="html_element_free" style="margin-top: 10px;"></div>
                                     <br />
                                 </form>
-                                @*<a href="#" id="btn-free-account" class="button btn-create-free check-sub-dim">@Lang.createNow</a>*@
+                                <a href="#" id="btn-free-account" class="button btn-create-free check-sub-dim">@Lang.createNow</a>
                                 <div>
                                     <a class="des-a"><i class="fas fa-check-square"></i> @Lang.haveAccount1 </a>
                                     <a class="link-button" onclick="login(); return 0;">@Lang.loginNow1 </a>
@@ -750,13 +718,6 @@
                     </div>
                 </div>
                 <br />
-                @*<div class="modal-content-thanks" id="div-result" style="display: none">
-                        <div class="row">
-                            <div class="col-xs-12">
-                                <p class="feedback-thanks text-center" id="login-result" style="color:red"></p>
-                            </div>
-                        </div>
-                    </div>*@
             </div>
         </div>
     </div>
@@ -821,10 +782,6 @@
                                     $('#login-result').html(data.error_content);
                                 }, 1000);
                             } else {
-                                //setTimeout(function () {
-                                //    $('#login-dialog').modal('hide');
-                                //    window.location.href = currentLocation;
-                                //}, 1000);
                                 setTimeout(function () {
                                     $('#div-result').css('display', 'block');
                                     $('#login-result').html('@NEducation.Content.Texts.Lang.PasswordSent');
@@ -886,7 +843,7 @@
         })
 
         $('.btn-subscribe').click(function () {
-
+            
             var phoneNumber = $('#msisdn').val();
             if (phoneNumber != "") {
                 console.log("btn-register-sub click");
@@ -994,53 +951,17 @@
                 $('#message-content').html('@Lang.InvalidMsisdn');
             }
         })
-        @*$('.btn-subscribe-now').click(function () {
-            var phoneNumber = $('#msisdn').val();
-            if (phoneNumber != "") {
-                console.log("btn-register-sub click");
-                $.ajax({
-                    url: urlConfig("/Home/RegisterSubWithoutCaptcha"),
-                    type: "POST",
-                    data: {
-                        __RequestVerificationToken: $('input[name=__RequestVerificationToken]').val(),
-                        phone: phoneNumber,
-                    }
-                }).success(function (data) {
-                    console.log(data);
-
-                    if (data.error_code == "100") {
-                        // success
-                        $('#free-account-dialog').modal('hide');
-                        $('#choose-language-dialog').modal('hide');
-                        $('#login-dialog').modal('hide');
-                        $('#signup-dialog').modal('hide');
-                        $('#sub-register-dialog').modal('show');
-                    } else {
-                        $('#message-dialog').modal('show');
-                        $('#message-content').html(data.error_content);
-                        grecaptcha.reset(capt1);
-                    }
-                });
-            } else {
-                $('#message-dialog').modal('show');
-                $('#message-content').html('@Lang.InvalidMsisdn');
-            }
-        })*@
-
         function SubConfirmOtpClick() {
             var otpConfirm = document.getElementById("otpSubData").value;
             //var phoneNumber = $('#msisdn').val();
 
             if (otpConfirm == "") {
-                //$('#message-dialog').modal('show');
-                //$('#message-content').html("Please check your OTP");
                 $("#otp-result").html('@ErrCode.InvalidIOTP');
             } else {
                 $.ajax({
                     url: urlConfig("/Home/RegisterSub"),
                     data: {
                         __RequestVerificationToken: $('input[name=__RequestVerificationToken]').val(),
-                        //phone: phoneNumber,
                         otp: otpConfirm
                     },
                     type: "POST"
@@ -1049,8 +970,6 @@
 
                     if (data.error_code != "0") {
                         // success
-                        //$('#message-dialog').modal('show');
-                        //$('#message-content').html(data.error_content);
                         $("#otp-result").html(data.error_content);
                     } else {
                         $('#sub-register-dialog').modal('hide');
@@ -1073,7 +992,6 @@
             var password = $('#txtPassLogin').val();
             console.log(phoneNumber);
             console.log(password);
-            //var currentLocation = window.location.href;
             //console.log(currentLocation);
             if (phoneNumber != "" && password != "") {
                 $.ajax({
@@ -1090,9 +1008,7 @@
                         console.log("asawfawfd");
 
                         // success
-                        //$('.modal-content-thanks').css('display', 'block');
                         $('#login-result').html(data.error_content);
-                        //location.reload();
 
                     } else {
                         console.log("asd");
@@ -1109,7 +1025,6 @@
                         }
                         setTimeout(function () {
                             $('#login-dialog').modal('hide');
-                            //window.location.href = currentLocation;
                         }, 1000);
                         if (data.href != null) {
                             location.href = data.href;
@@ -1120,11 +1035,6 @@
                 });
             } else {
                 console.log("ac");
-
-                @*$('#login-dialog').modal('hide');
-                $('#message-dialog').modal('show');
-                $('#message-content').html('@Lang.CheckUserPass');*@
-                //$('.modal-content-thanks').css('display', 'block');
                 $('#login-result').html('@Lang.CheckUserPass');
             }
         });
@@ -1144,99 +1054,61 @@
             }
         });
         $('#btn-register-sub').click(function () {
-    var phone = document.getElementById('phone-register').value;
-    console.log("phone: " + phone);
-    var captcha = $('#captcha').val();
-
-    if (phone != "") {
-        console.log("#btn-register-sub click");
-
-        $.ajax({
-            url: urlConfig("/Home/CheckButton"),
-            type: "POST",
-            data: {
-                __RequestVerificationToken: $('input[name=__RequestVerificationToken]').val(),
-                phone: phone
-            }
-        }).done(function (data) {
-            console.log(data);
-
-            if (data.token == null) {
+            var phone = document.getElementById('phone-register').value;
+            console.log("phone: " + phone);
+            var captcha = $('#captcha').val();
+            if (phone != "") {
                 console.log("#btn-register-sub click");
 
                 $.ajax({
-                    url: urlConfig("/Home/RegisterSub"),
+                    url: urlConfig("/Home/CheckButton"),
                     type: "POST",
                     data: {
                         __RequestVerificationToken: $('input[name=__RequestVerificationToken]').val(),
-                        phone: phone,
-                        captcha: captcha
+                        phone: phone
                     }
                 }).done(function (data) {
                     console.log(data);
-                    location.href = data.redirectUrl;
 
-                    if (data.error_code == "100") {
-                        // fail
-                        $('#free-account-dialog').modal('hide');
-                        $('#choose-language-dialog').modal('hide');
-                        $('#login-dialog').modal('hide');
-                        $('#signup-dialog').modal('hide');
-                        $('#sub-register-dialog').modal('show');
-                    } else {
-                        console.log(data.error_content);
-                        $('#signup-result').html(data.error_content);
-                        grecaptcha.reset(capt1);
-                    }
-                });
-            } else {
-                // dangky camid
-                console.log("dkCamID");
-                registerOnAppV2(phone, "GTS_MEDU_Daily");
-            }
-        });
+                    if (data.token == null) {
+                        console.log("#btn-register-sub click");
 
-    } else {
-        $('#signup-result').html('@Lang.CheckUserPass');
-    }
-});
+                        $.ajax({
+                            url: urlConfig("/Home/RegisterSub"),
+                            type: "POST",
+                            data: {
+                                __RequestVerificationToken: $('input[name=__RequestVerificationToken]').val(),
+                                phone: phone,
+                                captcha: captcha
+                            }
+                        }).done(function (data) {
+                            console.log(data);
+                            location.href = data.redirectUrl;
 
-        @*$('#btn-register-sub').click(function () {
-            // check phone number
-            var phone = document.getElementById('phone-register').value;
-            console.log("phone: " + phone)
-            var captcha = $('#captcha').val();
-            if (phone != '') {
-                console.log("#btn-register-sub click");
-                $.ajax({
-                    url: urlConfig("/Home/RegisterSub"),
-                    type: "POST",
-                    data: {
-                        __RequestVerificationToken: $('input[name=__RequestVerificationToken]').val(),
-                        phone: phone,
-                        captcha: captcha,
-                    }
-                }).success(function (data) {
-                    console.log(data);
-                    location.href = data.redirectUrl;
-                    if (data.error_code == "100") {
-                        // fail
-                        $('#free-account-dialog').modal('hide');
-                        $('#choose-language-dialog').modal('hide');
-                        $('#login-dialog').modal('hide');
-                        $('#signup-dialog').modal('hide');
-                        $('#sub-register-dialog').modal('show');
+                            if (data.error_code == "100") {
+                                // fail
+                                $('#free-account-dialog').modal('hide');
+                                $('#choose-language-dialog').modal('hide');
+                                $('#login-dialog').modal('hide');
+                                $('#signup-dialog').modal('hide');
+                                $('#sub-register-dialog').modal('show');
+                            } else {
+                                console.log(data.error_content);
+                                $('#signup-result').html(data.error_content);
+                                grecaptcha.reset(capt1);
+                            }
+                        });
                     } else {
-                        console.log(data.error_content);
-                        $('#signup-result').html(data.error_content);
-                        grecaptcha.reset(capt1);
+                        // dangky camid
+                        console.log("dkCamID");
+                        registerOnAppV2(phone, "GTS_MEDU_Daily");
                     }
                 });
-            } else {
 
+            } else {
                 $('#signup-result').html('@Lang.CheckUserPass');
             }
-        })*@
+        });
 
         $('#btn-register-sub-confirm').click(function () {
             // check phone number
@@ -1244,7 +1116,7 @@
             if (otp != '') {
                 console.log("btn-register-sub-confirm click");
                 $.ajax({
-                    url: urlConfig("/Home/RegisterSub"),
+                    url: "/Home/RegisterSub",
                     type: "POST",
                     data: {
                         __RequestVerificationToken: $('input[name=__RequestVerificationToken]').val(),
@@ -1263,11 +1135,7 @@
                         console.log(data.error_content);
                         $('#signup-dialog').modal('hide');
                         $('#login-dialog').modal('show');
-                        //if (data.href != null) {
-                        //    location.href = data.href;
-                        //} else {
-                        //    location.reload();
-                        //}
+                       
                     }
                 });
             } else {
@@ -1296,9 +1164,6 @@
 
                     if (data.error_code != @UtilsController.Constant.SUCCESS) {
                         // fail
-                        //$('#signup-dialog').modal('hide');
-                        //$('#message-dialog').modal('show');
-                        //$('#message-content').html(data.error_content);
                         $('#free-result').html(data.error_content);
                         grecaptcha.reset(capt2);
                     } else {
@@ -1309,9 +1174,6 @@
                     }
                 });
             } else {
-                @*$('#signup-dialog').modal('hide');
-                $('#message-dialog').modal('show');
-                $('#message-content').html('@Lang.CheckUserPass');*@
                 $('#free-result').html('@Lang.CheckUserPass');
             }
         })

+ 1 - 1
Website/NEducation/Views/Shared/_LayoutLearning.cshtml

@@ -11,7 +11,7 @@
     <meta property="fb:app_id" content="1554472698103925" /><!-- CHANGE API-->
     <meta property="fb:admins" content="100011896126791" />
     <meta property="og:url" content="#" />
-    <title>USTUDY | SMART ENGLISH LEARNING SYSTEM</title>
+    <title>MEDU | SMART ENGLISH LEARNING SYSTEM</title>
     <meta name="description" content="" />
 
     <link type="text/css" rel="stylesheet" href="~/Content/assets/css/voca-main.css" />

+ 9 - 9
Website/NEducation/Views/Shared/_LayoutMiniGame.cshtml

@@ -1,9 +1,8 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="vi">
-@using NEducation.Content.Texts;
+<html lang="en">
 @using NEducation.Controllers;
 @using NEducation.Code;
-@using NEducation.Content.Texts; 
+@using NEducation.Content.Texts;
 
 <head>
     <meta name="robots" content="noodp,index,follow" />
@@ -13,11 +12,11 @@
     <link rel="canonical" href="#" />
     <meta name="author" content="nedu" />
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>USTUDY | SMART ENGLISH LEARNING SYSTEM</title>
+    <title>MEDU | SMART ENGLISH LEARNING SYSTEM</title>
     <meta name="description" content="" />
     <meta name="keywords" content="edu, nedu, natcom" />
-    <meta name="author" content="NEDU" />
-    <meta property="og:title" content="USTUDY | SMART ENGLISH LEARNING SYSTEM" />
+    <meta name="author" content="MEDU" />
+    <meta property="og:title" content="MEDU | SMART ENGLISH LEARNING SYSTEM" />
     <meta property="og:type" content="video.movie" />
     <meta property="og:description" content="#" />
     <meta property="og:image" content="~/Content/assets/imgs/voca-register.png" />
@@ -39,14 +38,15 @@
     <link href="~/Content/assets/mini_game/css/minigame_global.css" rel="stylesheet" />
     <link href="~/Content/assets/mini_game/css/minigame_main.css" rel="stylesheet" />
     <link href="~/Content/assets/mini_game/css/minigame_history.css" rel="stylesheet" />
+    <link rel="stylesheet" href="~/Content/assets/mini_game/lib/bootstrap/dist/css/bootstrap.min.css" />
     <script src="~/Content/assets/mini_game/lib/jquery/dist/jquery.min.js"></script>
     <script src="~/Content/assets/mini_game/js/framework.js"></script>
-    
+
     <link rel="preconnect" href="https://fonts.googleapis.com" />
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=crossorigin />
     <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;700&family=Quicksand:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
 
-</head> 
+</head>
 <body>
 
     <div id="fb-root"></div>
@@ -61,7 +61,7 @@
     <!--END CONTENT-->
 
     <script src="~/Content/assets/mini_game/js/minigame_function.js"></script>
-   
+
 
 </body>
 </html>

+ 1 - 1
Website/NEducation/Views/Shared/_LayoutVoca.cshtml

@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="vi">
+<html lang="en">
 <head>
     <meta charset="utf-8" />
     <meta http-equiv="X-UA-Compatible" content="IE=edge" />

+ 22 - 21
Website/NEducation/Views/Voca/Index.cshtml

@@ -26,21 +26,22 @@
         @Lang.Listening
         @*LISTENING*@
     </a>
+    <a href="/MiniGame" class="nav-link">@Lang.MiniGame</a>
     @*<a href="/Ebook/" class="nav-link">
             @Lang.Ebook
             <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
         </a>*@
 
-    <div class="dropdown nav-link">
-        <button onclick="myFunction()" class="dropbtn">
-            E-Library
-            <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
-        </button>
-        <div id="myDropdown" class="dropdown-content">
-            <a href="/Ebook/">@Lang.Ebook</a>
-            <a href="/Ebook/Video">Children's Video</a>
-        </div>
-    </div>
+    @*<div class="dropdown nav-link">
+            <button onclick="myFunction()" class="dropbtn">
+                E-Library
+                <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
+            </button>
+            <div id="myDropdown" class="dropdown-content">
+                <a href="/Ebook/">@Lang.Ebook</a>
+                <a href="/Ebook/Video">Children's Video</a>
+            </div>
+        </div>*@
 
     @*<a href="/Voca/Method" class="nav-link link-help">Method</a>
         <a href="/Voca/Help" class="nav-link link-help">Help</a>*@
@@ -73,17 +74,17 @@
             @Lang.Ebook
             <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
         </a>*@
-
-    <li class="menu-item-has-children header-menu-link ">
-        <a href="#" class="">
-            E-Library
-            <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
-        </a>
-        <ul class="" style=" margin-left: 20px;">
-            <li><a href="/Ebook/">@Lang.Ebook</a></li>
-            <li><a href="/Ebook/Video">Children's Video</a></li>
-        </ul>
-    </li>
+    <a href="/MiniGame" class="header-menu-link ">@Lang.MiniGame</a>
+    @*<li class="menu-item-has-children header-menu-link ">
+            <a href="#" class="">
+                E-Library
+                <img src="~/Content/assets/imgs/giphy.gif" style=" width: 50px;" />
+            </a>
+            <ul class="" style=" margin-left: 20px;">
+                <li><a href="/Ebook/">@Lang.Ebook</a></li>
+                <li><a href="/Ebook/Video">Children's Video</a></li>
+            </ul>
+        </li>*@
 
     @*<a href="/Music/" class="header-menu-link ">MUSIC</a>*@
     @*</p>

+ 10 - 6
Website/NEducation/Web.config

@@ -34,7 +34,7 @@
     <add key="service_id" value="3" />
     <add key="country_code" value="855" />
 	<add key="paymentUrl" value="http://paymentgateway.metfone.com.kh/MPS/" />
-	<add key="domainRes" value="https://medu.metfone.com.kh" />
+	<add key="domainRes" value="http://medu.metfone.com.kh" />
 	<add key="packname" value="GTS_MEDU_Daily" />
 	<add key="packNameREGISTER_ToBe" value="MEDU_DAILY_REGISTER" />
 	<add key="packNameCannel_ToBe" value="MEDU_DAILY_CANCEL" />
@@ -48,12 +48,16 @@
 	<add key="GetRankMiniGame" value="http://27.71.225.61:9989/api/edu/getMiniGameListWinner/data" />
     <!--CamID-->
 	<!--<add key="pathDetectUser" value="https://openid.camid.app/camid-auth/gts/api/v1/partner/user-profile" />-->
-	  <!--<add key="accessToken" value="eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJndHMiLCJwYXJ0bmVyQ29kZSI6Imd0cyIsImFwaUtleSI6ImNkN2FiMmU3ZmE2YTU2NTExNzVmMDMwOWM5ZGQ2ZTI5IiwiZXhwIjoyMDI0MjkxMzU5LCJpYXQiOjE3MDg5MzEzNTl9.cyRX2Dhb7S6pcx14-SokPtSQ5RvWW2rhPlgmFOnthVN9dEL-f6QHBxE6tVRq2XQgXGw6rwi9PccUib14UPzEUw" />-->
-	  <add key="pathDetectUser" value="https://openid.altek.com.vn:8125/camid-auth/funtap/api/v1/partner/user-profile" />
-	  <add key="accessToken" value="eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJmdW50YXAiLCJwYXJ0bmVyQ29kZSI6ImZ1bnRhcCIsImFwaUtleSI6IjBjOTlkNjAxMzVmMGIzOTViYjExM2IxYWUyNTc4YmFkIiwiZXhwIjoyMDM2ODAxMDQyLCJpYXQiOjE3MjE0NDEwNDJ9.eMT2q-uZQf_EtX4Jt9JuFl91vr91MnA6DycAasHf1QmZJn_5SsYp1MWipEmilCRFskFEwo5FzI868EjILPpflA" />
+	<!--<add key="accessToken" value="eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJndHMiLCJwYXJ0bmVyQ29kZSI6Imd0cyIsImFwaUtleSI6ImNkN2FiMmU3ZmE2YTU2NTExNzVmMDMwOWM5ZGQ2ZTI5IiwiZXhwIjoxNzA4Nzc2OTc5LCJpYXQiOjE2NzcyNDA5Nzl9.OHqaF-pto0n5Kdsveh1_tjYLMihpBazwLoDzMD-rucRcZmpWiWT0SHqV7o07BHcM9ptfW5d68FED-M3OsJzxOQ" />-->
+	<add key="pathDetectUser" value="https://openid.altek.com.vn:8125/camid-auth/funtap/api/v1/partner/user-profile" />
+	<add key="accessToken" value="eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJmdW50YXAiLCJwYXJ0bmVyQ29kZSI6ImZ1bnRhcCIsImFwaUtleSI6IjBjOTlkNjAxMzVmMGIzOTViYjExM2IxYWUyNTc4YmFkIiwiZXhwIjoyMDM2ODAxMDQyLCJpYXQiOjE3MjE0NDEwNDJ9.eMT2q-uZQf_EtX4Jt9JuFl91vr91MnA6DycAasHf1QmZJn_5SsYp1MWipEmilCRFskFEwo5FzI868EjILPpflA" />
+	<!--<add key="wsCheckTransaction" value="https://apigw.camid.app/CoreService/UserRouting" />-->
+	  <add key="wsCheckTransaction" value="https://apigwcamid.altek.com.vn:8123/ApiGateway/CoreService/UserRouting" />
 	  
 	  <add key="wsUsersCheckStatus" value="http://27.71.225.61:9989/api/userApi/usersCheckStatus/data" />
-    <!--<add key="wsUsersCheckStatus" value="http://192.168.168.61:9201/unitel/api/userApi/usersCheckStatus/data" />-->
+    <add key="usersSetLanguage" value="http://27.71.225.61:9989/api/userApi/usersSetLanguage/data" />
+	  
+	  <!--<add key="wsUsersCheckStatus" value="http://192.168.168.61:9201/unitel/api/userApi/usersCheckStatus/data" />-->
     <add key="wsUsersUpdateProfile" value="http://27.71.225.61:9989/api/userApi/usersUpdateProfile/data" />
     <add key="wsUsersGetProfile" value="http://27.71.225.61:9989/api/userApi/usersGetProfile/data" />
     <add key="wsUserGetListLike" value="http://27.71.225.61:9989/api/userApi/usersGetListLike/data" />
@@ -143,7 +147,7 @@
   <system.web>
     <compilation debug="true" targetFramework="4.6" />
     <httpRuntime targetFramework="4.5.1" />
-    <customErrors mode="On" defaultRedirect="~/Common/Error" />
+    <customErrors mode="Off" defaultRedirect="~/Common/Error" />
   </system.web>
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

Some files were not shown because too many files changed in this diff