diff --git a/main.go b/main.go index 35af638..79700f0 100755 --- a/main.go +++ b/main.go @@ -612,66 +612,66 @@ func main() { body := fmt.Sprintf(` - - - - - Registration Update – UAE Stats App - - - - - - -
- - - - - - - - - - - - - -
- - إعادة تعيين كلمة المرور - تطبيق إحصاءات الإمارات العربية المتحدة
-

Reset your FCSC password -


-
- - - - - -
- Hello,

- Click on the link below to reset your password. -

- Reset Password -

- If you didn't ask to reset your password, you can ignore this email. -
- مرحبًا،

- يُرجى الضغط على الرابط أدناه لإعادة تعيين كلمة المرور الخاصة بك: 


- إعادة تعيين كلمة المرور -

- إذا لم تطلب إعادة تعيين كلمة المرور، يمكنك تجاهل هذا البريد الإلكتروني. -
-
- We The UAE 2031 -
- تنويه: المعلومات الواردة في هذه الرسالة الإلكترونية والمرفقات الخاصة بها سرية وقد تكون محمية بموجب القانون. إذا لم تكن الشخص المعني باستلام هذه الرسالة، فيرجى إخطار المرسل وحذف هذه الرسالة فوراً. -

- Disclaimer: The information contained and transmitted within this email message is PRIVILEGED AND/OR CONFIDENTIAL. If you are not the intended recipient, please notify the sender and delete this email immediately. -
-
- -`, resetURL, resetURL) + + + + + Registration Update – UAE Stats App + + + + + + +
+ + + + + + + + + + + + + +
+ + إعادة تعيين كلمة المرور - تطبيق إحصاءات الإمارات العربية المتحدة
+

Reset your FCSC password +


+
+ + + + + +
+ Hello,

+ Click on the link below to reset your password. +

+ Reset Password +

+ If you didn't ask to reset your password, you can ignore this email. +
+ مرحبًا،

+ يُرجى الضغط على الرابط أدناه لإعادة تعيين كلمة المرور الخاصة بك:

+ إعادة تعيين كلمة المرور +

+ إذا لم تطلب إعادة تعيين كلمة المرور، يمكنك تجاهل هذا البريد الإلكتروني. +
+
+ We The UAE 2031 +
+ تنويه: المعلومات الواردة في هذه الرسالة الإلكترونية والمرفقات الخاصة بها سرية وقد تكون محمية بموجب القانون. إذا لم تكن الشخص المعني باستلام هذه الرسالة، فيرجى إخطار المرسل وحذف هذه الرسالة فوراً. +

+ Disclaimer: The information contained and transmitted within this email message is PRIVILEGED AND/OR CONFIDENTIAL. If you are not the intended recipient, please notify the sender and delete this email immediately. +
+
+ + `, resetURL, resetURL) // Create the email message message := &mailer.Message{ @@ -937,6 +937,7 @@ func main() { Dataset string `json:"dataset"` KPI string `json:"kpi"` Language string `json:"language"` + ColorMode string `json:"color_mode"` FilterData []utils.Filter `json:"filter_data"` } @@ -955,6 +956,7 @@ func main() { dataset := requestData.Dataset language := requestData.Language langKey := "value_" + language + colorMode := requestData.ColorMode // Fetch all matching records from charts table param := dbx.NewExp("dataset = {:dataset}", dbx.Params{"dataset": dataset}) @@ -1225,10 +1227,13 @@ func main() { BorderColor string `db:"border_color" json:"border_color"` }{} + header_color := "header_color_" + colorMode + body_color := "body_color_" + colorMode + border_color := "border_color_" + colorMode data_set_tile_heading := "data_set_tile_heading_" + language main_topic := "main_topic_" + language sub_topic := "sub_topic_" + language - query := ` SELECT id,data_set,` + data_set_tile_heading + ` AS data_set_tile_heading,` + main_topic + ` AS main_topic,` + sub_topic + ` AS sub_topic,header_color,body_color,border_color FROM uae_numbers_screen WHERE data_set = {:data_set} ` + query := ` SELECT id,data_set,` + data_set_tile_heading + ` AS data_set_tile_heading,` + main_topic + ` AS main_topic,` + sub_topic + ` AS sub_topic, ` + header_color + ` AS header_color,` + body_color + ` AS body_color, ` + border_color + ` AS border_color FROM uae_numbers_screen WHERE data_set = {:data_set} ` err = app.DB().NewQuery(query).Bind(dbx.Params{"data_set": dataset}).One(&headingAndColor) if err != nil { log.Printf("Failed to fetch data-set for sub topic %s: %v", dataset, err) @@ -1254,6 +1259,10 @@ func main() { e.Router.GET("/api/getHomePageData", func(c echo.Context) error { language := c.QueryParam("language") + colorMode := c.QueryParam("color_mode") + + // Determine the column name dynamically + colorPatternColumn := "color_pattern_" + colorMode // Define the struct for holding the query results mainTopics := []struct { @@ -1264,12 +1273,25 @@ func main() { }{} // Execute the query - err := app.DB(). - Select("main_topic_en", "main_topic_ar", "main_topic_list_order", "color_pattern"). - From("home_screen"). - GroupBy("main_topic_en", "main_topic_ar", "color_pattern"). - OrderBy("main_topic_list_order ASC"). - All(&mainTopics) + query := fmt.Sprintf(` + SELECT + main_topic_en, + main_topic_ar, + main_topic_list_order, + %s AS color_pattern + FROM home_screen + GROUP BY main_topic_en, main_topic_ar, main_topic_list_order, %s + ORDER BY main_topic_list_order ASC + `, colorPatternColumn, colorPatternColumn) + + err := app.DB().NewQuery(query).All(&mainTopics) + + // err := app.DB(). + // Select("main_topic_en", "main_topic_ar", "main_topic_list_order", "color_pattern"). + // From("home_screen"). + // GroupBy("main_topic_en", "main_topic_ar", "color_pattern"). + // OrderBy("main_topic_list_order ASC"). + // All(&mainTopics) if err != nil { log.Printf("Failed to fetch home_screen data: %v", err) @@ -1333,6 +1355,10 @@ func main() { e.Router.GET("/api/getUAENumbersData", func(c echo.Context) error { language := c.QueryParam("language") + colorMode := c.QueryParam("color_mode") + + // Determine the column name dynamically + colorPatternColumn := "color_pattern_" + colorMode // Define the struct for holding the query results mainTopics := []struct { @@ -1343,12 +1369,27 @@ func main() { }{} // Execute the query - err := app.DB(). - Select("main_topic_en", "main_topic_ar", "main_topic_list_order", "color_pattern"). - From("uae_numbers_screen"). - GroupBy("main_topic_en", "main_topic_ar", "color_pattern"). - OrderBy("main_topic_list_order ASC"). - All(&mainTopics) + + // Execute the query + query := fmt.Sprintf(` + SELECT + main_topic_en, + main_topic_ar, + main_topic_list_order, + %s AS color_pattern + FROM uae_numbers_screen + GROUP BY main_topic_en, main_topic_ar, %s + ORDER BY main_topic_list_order ASC + `, colorPatternColumn, colorPatternColumn) + + err := app.DB().NewQuery(query).All(&mainTopics) + + // err := app.DB(). + // Select("main_topic_en", "main_topic_ar", "main_topic_list_order", "color_pattern"). + // From("uae_numbers_screen"). + // GroupBy("main_topic_en", "main_topic_ar", "color_pattern"). + // OrderBy("main_topic_list_order ASC"). + // All(&mainTopics) if err != nil { log.Printf("Failed to fetch uae_numbers_screen data: %v", err) @@ -1460,6 +1501,7 @@ func main() { language := c.QueryParam("language") user_id := c.QueryParam("user_id") + colorMode := c.QueryParam("color_mode") // Define the struct for holding the query results bookmarks := []struct { @@ -1503,7 +1545,8 @@ func main() { data_set_tile_heading := "data_set_tile_heading_" + language main_topic := "main_topic_" + language sub_topic := "sub_topic_" + language - query := ` SELECT id,data_set,` + data_set_tile_heading + ` AS data_set_tile_heading,` + main_topic + ` AS main_topic,` + sub_topic + ` AS sub_topic,color_pattern,value_source,value FROM uae_numbers_screen WHERE data_set = {:bookmark} ` + color_pattern := "color_pattern_" + colorMode + query := ` SELECT id,data_set,` + data_set_tile_heading + ` AS data_set_tile_heading,` + main_topic + ` AS main_topic,` + sub_topic + ` AS sub_topic,` + color_pattern + ` AS color_pattern,value_source,value FROM uae_numbers_screen WHERE data_set = {:bookmark} ` err := app.DB(). NewQuery(query). Bind(dbx.Params{ diff --git a/pb_data/data.db b/pb_data/data.db index 5d8d2ac..bacf5f1 100755 Binary files a/pb_data/data.db and b/pb_data/data.db differ diff --git a/pb_data/logs.db b/pb_data/logs.db index faa5013..7f8c3f1 100755 Binary files a/pb_data/logs.db and b/pb_data/logs.db differ