Sindbad~EG File Manager
# β
Reference IDs PDF Export - Member Upload Page
## π― Feature Overview
Added **PDF export functionality** for the Reference IDs list on the member upload page, allowing admins to export complete lists of all areas, districts, and assemblies with their database IDs.
---
## π¦ What Was Implemented
### **1. PDF Export Button**
- Red "Export Full List" button added to Reference IDs section
- Located next to the "Reference IDs" heading
- Small, compact design to fit in the yellow info box
### **2. Complete Reference List PDF**
- Exports ALL areas, districts, and assemblies from database
- Includes database IDs and codes
- Color-coded sections matching theme
- Filename: `reference_ids_YYYYMMDD_HHMMSS.pdf`
---
## π PDF Content
### **Areas Section (Blue Header):**
| Column | Description |
|--------|-------------|
| ID | Database ID (for upload) |
| Area Code | Area reference code |
| Area Name | Full area name |
### **Districts Section (Orange Header):**
| Column | Description |
|--------|-------------|
| ID | Database ID (for upload) |
| District Code | District reference code |
| District Name | Full district name |
| Area | Parent area name |
### **Assemblies Section (Purple Header):**
| Column | Description |
|--------|-------------|
| ID | Database ID (for upload) |
| Assembly Code | Assembly reference code |
| Assembly Name | Full assembly name |
| District | Parent district name |
| Area | Parent area name |
---
## π¨ PDF Features
β
**Church Branding** - APP_NAME as title
β
**Purpose Label** - "For Member Upload"
β
**Generation Date** - Timestamp included
β
**Color-Coded Sections** - Blue (Areas), Orange (Districts), Purple (Assemblies)
β
**Complete Data** - Shows ALL records, not just the first 3
β
**Hierarchical Info** - Shows parent relationships
β
**Database IDs** - Essential for CSV/Excel uploads
---
## π How to Use
### **Step 1: Access Upload Page**
```
Visit: http://localhost/copmadinaarea/modules/membership/upload.php
```
### **Step 2: Find Reference IDs Section**
- Scroll down below the upload form
- Yellow info box with "Reference IDs" heading
- Shows first 3 items of each category
### **Step 3: Export Full List**
- Click **"Export Full List"** button (red, top-right of yellow box)
- PDF downloads with complete reference data
- File name: `reference_ids_20251113_120830.pdf`
---
## π‘ Use Cases
### **1. Member Upload Preparation**
- Get all valid IDs before preparing CSV/Excel
- Reference correct area_id, district_id, assembly_id values
- Avoid upload errors due to invalid IDs
### **2. Offline Reference**
- Print PDF for offline data entry
- Keep physical copy at registration desk
- Distribute to staff handling member registration
### **3. Data Verification**
- Cross-reference uploaded data
- Verify correct location assignments
- Ensure data consistency
### **4. Training Materials**
- Share with new staff
- Include in onboarding documentation
- Reference during training sessions
---
## π PDF Layout Example
```
[Church Name]
Location Reference IDs
For Member Upload - Generated: November 13, 2025 - 12:08 PM
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AREAS (5) β
βββββββ¬ββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ€
β ID βArea Code β Area Name β
βββββββΌββββββββββββΌβββββββββββββββββββββββββββββββββββββββ€
β 1 β GA β Greater Accra β
β 2 β ASH β Ashanti Region β
βββββββ΄ββββββββββββ΄βββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DISTRICTS (25) β
βββββββ¬βββββββββ¬βββββββββββββββ¬ββββββββββββββββββββββββββββ€
β ID βDistrictβ District β Area β
β β Code β Name β β
βββββββΌβββββββββΌβββββββββββββββΌββββββββββββββββββββββββββββ€
β 1 β MAD β Madina Dist β Greater Accra β
βββββββ΄βββββββββ΄βββββββββββββββ΄ββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ASSEMBLIES (125) β
βββββββ¬βββββββββ¬ββββββββββββ¬βββββββββββ¬βββββββββββββββββββ€
β ID βAssemblyβ Assembly β District β Area β
β β Code β Name β β β
βββββββΌβββββββββΌββββββββββββΌβββββββββββΌβββββββββββββββββββ€
β 1 βMCA001 βMadina Cen β Madina β Greater Accra β
βββββββ΄βββββββββ΄ββββββββββββ΄βββββββββββ΄βββββββββββββββββββ
```
---
## β¨ Benefits
1. **Complete Reference** - All IDs in one document (not just first 3)
2. **Always Current** - Generated from live database
3. **Easy to Share** - PDF format, ready to print/email
4. **Upload Helper** - Shows exact IDs needed for CSV/Excel
5. **Hierarchical View** - See parent relationships
6. **Professional Format** - Clean, organized layout
7. **Quick Access** - One click from upload page
---
## π What's Different from Administration PDFs?
| Feature | Administration PDF | Upload Page PDF |
|---------|-------------------|-----------------|
| **Location** | Administration pages | Member upload page |
| **Purpose** | General reference | Member upload reference |
| **Content** | Codes + stats | **IDs + codes** |
| **Focus** | Comprehensive data | **Database IDs for upload** |
| **Color** | Red button | Red button |
| **Label** | "Export PDF" | **"Export Full List"** |
**Key Difference:** Upload page PDF emphasizes **database IDs** which are required for CSV/Excel member uploads.
---
## π Files Modified
1. β
`modules/membership/upload.php`
- Added PDF export handler (lines 19-129)
- Added "Export Full List" button to Reference IDs section
- Queries include codes for complete reference
2. β
`REFERENCE_IDS_PDF_EXPORT.md` - This documentation
---
## π― Technical Details
### **PDF Specifications:**
- **Library**: TCPDF
- **Page Size**: A4 Portrait
- **Margins**: 15mm all sides
- **Sections**: 3 (Areas, Districts, Assemblies)
- **Color Coding**: Blue, Orange, Purple headers
### **Data Queries:**
```sql
-- Areas with codes
SELECT id, area_name, area_code FROM areas WHERE is_active = 1
-- Districts with parent area
SELECT d.id, d.district_name, d.district_code, a.area_name
FROM districts d JOIN areas a ON d.area_id = a.id
-- Assemblies with full hierarchy
SELECT asm.id, asm.assembly_name, asm.assembly_code,
d.district_name, a.area_name
FROM assemblies asm
JOIN districts d ON asm.district_id = d.id
JOIN areas a ON asm.area_id = a.id
```
---
## π Summary
**Feature Status:** β
Complete and Ready to Use
**Page Updated:** Member Upload Page
**Button Added:** "Export Full List" (red)
**Dependencies:** TCPDF (already installed)
**Installation Required:** None
---
**Admins can now export complete reference IDs directly from the member upload page!** π
This makes it easy to prepare CSV/Excel files with correct database IDs for bulk member uploads.
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists