πŸ” Codifications Admin

Enter the shared admin token to continue.
Your token is cached for this browser session only.

Codifications Admin / Margosatubig Legislative Archive

● Not authenticated

Select a subject

Pick a subject on the left to view and edit its documents.
πŸ“– How to use this page

What this page does

Every codification subject (e.g. Anti-Smoking Tobacco Control) is stored in MySQL as a row in codification_subjects, and every ordinance/resolution assigned to a subject is a row in codification_subject_docs. The actual TXT and PDF files live in uploads/ordinances/ and uploads/resolutions/ β€” never duplicated per subject.

Add a new codification subject

  1. Click + New on the top-left.
  2. Type a name (e.g. Solid Waste Management). The slug is generated automatically.
  3. Click Create. The subject appears in the left list immediately.

Assign an ordinance/resolution to a subject

  1. Select the subject on the left.
  2. At the bottom of the right panel, choose Type (ordinance / resolution).
  3. Start typing the document number in the Document field β€” an autocomplete list appears. Click the right one (or press Enter).
  4. (Optional) Add an annotation like (PWD CODE) β€” this is shown in reports but doesn't change the filename.
  5. Click + Add. The assignment is saved and logged.

Remove or edit an assignment

Upload / download a TXT or PDF

Each document row has two file badges: πŸ“„TXT and πŸ“•PDF. Their color tells you the status:

When you upload, the file is automatically saved to its canonical decade folder (uploads/ordinances/PDF/2020s/) or council-term folder (uploads/resolutions/2025-2028 15cc/). Filenames are rewritten to <number>.<ext> β€” no matter what the original filename was. Existing files are overwritten (with audit log entry).

After uploading a new file, also hit /api/maintenance/rebuild-all.php?token=… once to refresh the search index. The file badges on this page will update the moment you reload.

Rename / deactivate / delete a subject

Audit Log

Every mutation here is written to codification_audit_log β€” open the Audit Log button on the top-right to see the most recent 50 actions with timestamps.

Where your changes appear

The site's Report Center (Codification Index) reads directly from these tables. There's no additional rebuild step needed for subject assignments β€” they take effect on the next page load. If you upload a new PDF/TXT file, also call /api/maintenance/rebuild-all.php?token=… so the search index picks it up.