Database Error - warwickfoster/qurantools GitHub Wiki

File: app/charts/chart_roots.php

Purpose

The provided HTML code snippet is a PHP script that generates a web page for displaying a chart of root occurrences in the Quran.

Features

  • Chart Type Bar chart using the FusionCharts JavaScript library.
  • Data Source MySQL database.
  • Chart Controls
    • Provenance filter (Meccan, Medinan, All Suras)
    • Occurrence filter (All Occurrences, Occurrences per 100 Words)
    • Sort by option (Sura Number, Occurrences)
  • User Interface
    • Title: Root Occurrences
    • Subtitle: Arabic root (transliterated)
    • Chart container
    • Chart controls
    • Footer with links to other pages

Functionality

  1. Database Query The script retrieves data from the MySQL database based on the selected filters (provenance, occurrence, and sort order).
  2. Data Transformation The retrieved data is transformed into a JSON object in the format required by the FusionCharts JavaScript library.
  3. Chart Creation The FusionCharts JavaScript library is used to create a bar chart with the transformed data.
  4. Chart Controls The user can interact with the chart controls to filter the data and change the sort order.
  5. User Interface The script generates the HTML and JavaScript code for the page, including the title, subtitle, chart container, chart controls, and footer.

Additional Notes

  • The transliterate_new() function is used to transliterate the Arabic root into English.
  • The $user_preference_transliteration_style variable is used to set the font style for the transliteration.
  • The provenance_footer.php file is included if the provenance filter is set to "ANY".

Overall, the script provides a user-friendly interface for visualizing root occurrences in the Quran.