Quran Topic-Ayah Linker v5
===========================

Purpose
-------
Admin interface for linking Quran ayahs to topics without writing SQL manually.

Features
--------
- Search ayahs by text, ayah number, global number, or surah
- Search topics
- Create or update a link
- Relation types:
  Direct, Supporting, Contextual, Indirect, Opposing
- Confidence from 0 to 100
- Draft / Reviewed / Verified status when Link_Status exists
- View all current topic links for the selected ayah
- Delete links
- Full audit history

Files
-----
sql/topic_ayah_linker_v5.sql
admin/topic_ayah_linker.php
assets/js/topic-ayah-linker.js
assets/css/topic-ayah-linker.css

Installation
------------
1. Back up the Quran database.

2. Run:
   sql/topic_ayah_linker_v5.sql

3. Upload the other files under public_html/Quran/ using their matching paths.

4. Protect the admin directory using cPanel Directory Privacy.

5. Open:
   https://how-2-know.com/Quran/admin/topic_ayah_linker.php

Database assumptions
--------------------
Quran_Ayah_Topics contains:
- AyahTopic_ID
- Ayah_ID
- Topic_ID
- Relation_Type
- Confidence_Level

The page automatically detects whether Link_Status exists.
If it is absent, the page still works and treats saved links as Reviewed.

Recommended optional upgrade
----------------------------
To use Draft / Reviewed / Verified physically in the link table:

ALTER TABLE Quran_Ayah_Topics
ADD COLUMN Link_Status ENUM('Draft','Reviewed','Verified')
NOT NULL DEFAULT 'Reviewed'
AFTER Confidence_Level;

Run this optional ALTER only if Link_Status does not already exist.
