Exhaustive Root References - warwickfoster/qurantools GitHub Wiki

File: app/charts/chart_user_searches_by_month.php

Purpose

This PHP script generates a chart that displays the monthly or daily search/verse lookup activity for a specific user.

Features

  • Sorts data by date or number of searches/lookups.
  • Filters data by month and year.
  • Links to a detailed view of daily searches.

Steps

  1. Data Retrieval The script retrieves user information, email address, and search/verse lookup data based on the provided user ID.

  2. Chart Configuration The JavaScript code configures a chart using the Chart.js library.

    • Data points are created based on the retrieved search/verse lookup data.
    • Labels represent the months or days.
    • Values represent the number of searches/lookups.
    • Links are added for daily views.
  3. Chart Rendering The chart is rendered within an HTML element with the id "chartContainer".

  4. Navigation The script provides links to the user details page and a print control.

Usage

To use the script, pass the user ID as a parameter in the URL. For example:

/admin/chart_user_searches_by_month.php?USER=123

Note

  • The script assumes that the USERS and SEARCH_HISTORY tables are available in the database.
  • The menu.php and footer.php files should be included in the project.