From cc73ee13dddd3be2509bead468f897b37257d033 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 13 Mar 2024 17:55:27 +0100 Subject: [PATCH] updating --- template-parts/statistics/dashboard.php | 147 +++++++++++++----------- 1 file changed, 81 insertions(+), 66 deletions(-) diff --git a/template-parts/statistics/dashboard.php b/template-parts/statistics/dashboard.php index ce9d78d..3112217 100644 --- a/template-parts/statistics/dashboard.php +++ b/template-parts/statistics/dashboard.php @@ -2,117 +2,132 @@ if (!current_user_can('manage_options')) return; - global $wpdb; - $table_name = "wp_app_users_statistics"; +global $wpdb; +$table_name = "wp_app_users_statistics"; - $level_post_ids = $wpdb->get_col(" +$level_post_ids = $wpdb->get_col(" SELECT DISTINCT level_post_id FROM $table_name "); ?> -
-

+
+

- - + + -
- get_results(" +
+ get_results(" SELECT user_locale, COUNT(user_locale) as count FROM $table_name WHERE level_post_id = $level_post_id GROUP BY user_locale "); - $users_countries = $wpdb->get_results(" + $users_countries = $wpdb->get_results(" SELECT user_country, COUNT(user_country) as count FROM $table_name WHERE level_post_id = $level_post_id GROUP BY user_country "); - $notes_repartition = $wpdb->get_results(" + $notes_repartition = $wpdb->get_results(" SELECT level_score, COUNT(level_score) as count FROM $table_name WHERE level_post_id = $level_post_id GROUP BY level_score "); - $average_level_score = $wpdb->get_var(" + $average_level_score = $wpdb->get_var(" SELECT AVG(level_score) as average FROM $table_name WHERE level_post_id = $level_post_id "); - $completeLevelsScores = $wpdb->get_results(" + $completeLevelsScores = $wpdb->get_results(" SELECT level_score FROM $table_name WHERE level_post_id = $level_post_id "); - ?> + ?> -

post_title ?>

-
-
-
-

Score moyen

+

post_title ?>

+
+
+
+

Score moyen

- -
- - - -

- -
- + +
+ + + +

+ +
+ -
-
-

Répartition des scores

- +
+
+

Répartition des scores

+ +
    + +
  • level_score ?> : count ?> joueurs
  • + +
+ +
+ +
+
+

Langue et Géographie

+
+ +
+

Répartition des langues

    - -
  • level_score ?> : count ?> joueurs
  • + +
  • user_locale ?> : count ?>
-
- -
-
-

Langue et Géographie

-
- -
-

Répartition des langues

-
    - -
  • user_locale ?> : count ?>
  • - -
-
-
-

Répartition des pays

-
    - -
  • user_country ?> : count ?> joueurs
  • - -
-
+
+

Répartition des pays

+
    + +
  • user_country ?> : count ?> joueurs
  • + +
- +
+ -
+
- + -
-get_results(" + SELECT rating, COUNT(rating) as count + FROM $ratings_table_name + GROUP BY rating + "); + + echo '
';
+	print_r($ratings);
+	echo '
'; + ?> + +
+ +
+
\ No newline at end of file