This commit is contained in:
Antoine M 2024-03-13 17:55:27 +01:00
parent 26df4edcce
commit cc73ee13dd

View File

@ -2,16 +2,16 @@
if (!current_user_can('manage_options')) return; if (!current_user_can('manage_options')) return;
global $wpdb; global $wpdb;
$table_name = "wp_app_users_statistics"; $table_name = "wp_app_users_statistics";
$level_post_ids = $wpdb->get_col(" $level_post_ids = $wpdb->get_col("
SELECT DISTINCT level_post_id SELECT DISTINCT level_post_id
FROM $table_name FROM $table_name
"); ");
?> ?>
<div class="page-sessions-datas"> <div class="page-sessions-datas">
<h1 class="page-title"><?php echo esc_html(get_admin_page_title()); ?></h1> <h1 class="page-title"><?php echo esc_html(get_admin_page_title()); ?></h1>
<?php foreach ($level_post_ids as $level_post_id) : ?> <?php foreach ($level_post_ids as $level_post_id) : ?>
@ -114,5 +114,20 @@ if (!current_user_can('manage_options')) return;
<?php endforeach; ?> <?php endforeach; ?>
</div> <?php
<?php $ratings_table_name = "wp_app_ratings";
$ratings = $wpdb->get_results("
SELECT rating, COUNT(rating) as count
FROM $ratings_table_name
GROUP BY rating
");
echo '<pre>';
print_r($ratings);
echo '</pre>';
?>
<section class="ratings">
</section>
</div>