Sindbad~EG File Manager
-- MariaDB dump 10.19 Distrib 10.4.32-MariaDB, for Win64 (AMD64)
--
-- Host: localhost Database: copmadinaconf
-- ------------------------------------------------------
-- Server version 10.4.32-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `areas`
--
DROP TABLE IF EXISTS `areas`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `areas` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` text DEFAULT NULL,
`status` enum('active','inactive') DEFAULT 'active',
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `areas`
--
LOCK TABLES `areas` WRITE;
/*!40000 ALTER TABLE `areas` DISABLE KEYS */;
INSERT INTO `areas` VALUES (1,'Madina Area','The Church of Pentecost - Madina Area','active','2025-09-03 12:09:17','2025-09-03 12:09:17');
/*!40000 ALTER TABLE `areas` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `assemblies`
--
DROP TABLE IF EXISTS `assemblies`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `assemblies` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`district_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`description` text DEFAULT NULL,
`location` varchar(255) DEFAULT NULL,
`address` text DEFAULT NULL,
`contact_phone` varchar(20) DEFAULT NULL,
`contact_email` varchar(255) DEFAULT NULL,
`contact_person` varchar(255) DEFAULT NULL,
`status` enum('active','inactive','deleted') DEFAULT 'active',
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `fk_assemblies_district` (`district_id`),
CONSTRAINT `fk_assemblies_district` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `assemblies`
--
LOCK TABLES `assemblies` WRITE;
/*!40000 ALTER TABLE `assemblies` DISABLE KEYS */;
INSERT INTO `assemblies` VALUES (1,1,'Madina Central Assembly','Main assembly in Madina District','Madina Market Area','Madina Market Road, Accra','+233 24 123 4567','madina.central@cop.org','Elder Peter Kwame','active','2025-09-03 12:09:24','2025-09-03 12:09:24'),(3,2,'East Legon Assembly','Main assembly in East Legon District','East Legon Community','East Legon, Accra','+233 24 345 6789','eastlegon@cop.org','Elder Michael Owusu','active','2025-09-03 12:09:24','2025-09-03 12:09:24');
/*!40000 ALTER TABLE `assemblies` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `audit_logs`
--
DROP TABLE IF EXISTS `audit_logs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `audit_logs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`action` varchar(100) NOT NULL,
`table_name` varchar(100) NOT NULL,
`record_id` int(11) DEFAULT NULL,
`old_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`old_values`)),
`new_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`new_values`)),
`ip_address` varchar(45) DEFAULT NULL,
`user_agent` text DEFAULT NULL,
`created_at` timestamp NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
KEY `fk_audit_logs_user` (`user_id`),
CONSTRAINT `fk_audit_logs_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `audit_logs`
--
LOCK TABLES `audit_logs` WRITE;
/*!40000 ALTER TABLE `audit_logs` DISABLE KEYS */;
INSERT INTO `audit_logs` VALUES (1,1,'create','events',1,NULL,'{\"title\": \"Madina Area Annual Conference 2024\", \"event_type\": \"area\", \"status\": \"published\"}',NULL,NULL,'2025-09-03 12:09:25'),(2,1,'create','events',2,NULL,'{\"title\": \"East Legon District Youth Summit\", \"event_type\": \"district\", \"status\": \"published\"}',NULL,NULL,'2025-09-03 12:09:25'),(3,NULL,'create','event_registrations',1,NULL,'{\"event_id\": 1, \"user_id\": 11, \"registration_code\": \"CONF2024001\"}',NULL,NULL,'2025-09-03 12:09:25'),(4,NULL,'update','event_registrations',1,'{\"payment_status\": \"pending\"}','{\"payment_status\": \"paid\"}',NULL,NULL,'2025-09-03 12:09:25'),(10,1,'login','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 12:16:38'),(11,1,'login','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0','2025-09-03 17:13:30'),(12,1,'delete','assemblies',9,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 17:25:35'),(13,1,'delete','users',7,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 17:26:22'),(14,1,'delete','assemblies',8,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 17:27:20'),(15,1,'delete','districts',5,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 17:27:50'),(16,1,'logout','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 21:35:53'),(17,1,'login','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 21:55:18'),(18,1,'logout','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 22:15:12'),(19,1,'login','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 22:24:26'),(20,1,'logout','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 22:26:36'),(21,1,'login','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 22:28:32'),(22,1,'logout','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 22:54:27'),(23,1,'login','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 22:58:18'),(24,1,'logout','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 23:03:44'),(25,1,'login','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 23:04:41'),(26,1,'delete','users',3,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 23:19:20'),(27,1,'delete','areas',2,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 23:24:10'),(28,1,'delete','assemblies',2,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 23:24:33'),(29,1,'delete','assemblies',5,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 23:24:51'),(30,1,'delete','assemblies',6,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 23:24:55'),(31,1,'delete','assemblies',4,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 23:25:02'),(32,1,'delete','users',6,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 23:26:23'),(33,1,'delete','users',5,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36','2025-09-03 23:26:31'),(34,1,'login','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0','2025-09-04 06:38:42'),(35,1,'logout','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0','2025-09-04 06:39:55'),(36,1,'login','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0','2025-09-04 06:39:59'),(37,1,'delete','backup',0,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0','2025-09-04 09:18:51');
/*!40000 ALTER TABLE `audit_logs` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `districts`
--
DROP TABLE IF EXISTS `districts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `districts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`area_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`description` text DEFAULT NULL,
`location` varchar(255) DEFAULT NULL,
`contact_person` varchar(255) DEFAULT NULL,
`contact_email` varchar(255) DEFAULT NULL,
`contact_phone` varchar(20) DEFAULT NULL,
`status` enum('active','inactive','deleted') DEFAULT 'active',
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `fk_districts_area` (`area_id`),
CONSTRAINT `fk_districts_area` FOREIGN KEY (`area_id`) REFERENCES `areas` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `districts`
--
LOCK TABLES `districts` WRITE;
/*!40000 ALTER TABLE `districts` DISABLE KEYS */;
INSERT INTO `districts` VALUES (1,1,'Madina District','Main district in Madina Area','Madina, Accra','Pastor Emmanuel Asante','madina.district@cop.org','+233 24 111 2222','active','2025-09-03 12:09:24','2025-09-03 12:09:24'),(2,1,'East Legon District','East Legon District in Madina Area','East Legon, Accra','Pastor Grace Osei','eastlegon.district@cop.org','+233 24 333 4444','active','2025-09-03 12:09:24','2025-09-03 12:09:24'),(3,1,'Dome District','Dome District in Madina Area','Dome, Accra','Pastor Samuel Mensah','dome.district@cop.org','+233 24 555 6666','active','2025-09-03 12:09:24','2025-09-03 12:09:24');
/*!40000 ALTER TABLE `districts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `email_logs`
--
DROP TABLE IF EXISTS `email_logs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `email_logs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`recipient_email` varchar(255) NOT NULL,
`recipient_name` varchar(255) DEFAULT NULL,
`recipient_type` enum('member','user','external') NOT NULL,
`recipient_id` int(11) DEFAULT NULL,
`subject` varchar(500) NOT NULL,
`body` text NOT NULL,
`email_type` enum('welcome','notification','reminder','announcement','custom') NOT NULL,
`status` enum('pending','sent','failed','bounced') DEFAULT 'pending',
`sent_at` timestamp NULL DEFAULT NULL,
`error_message` text DEFAULT NULL,
`opened_at` timestamp NULL DEFAULT NULL,
`clicked_at` timestamp NULL DEFAULT NULL,
`sent_by` int(11) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
KEY `sent_by` (`sent_by`),
KEY `idx_recipient_email` (`recipient_email`),
KEY `idx_recipient_type` (`recipient_type`,`recipient_id`),
KEY `idx_status` (`status`),
KEY `idx_email_type` (`email_type`),
KEY `idx_sent_at` (`sent_at`),
KEY `idx_created_at` (`created_at`),
CONSTRAINT `email_logs_ibfk_1` FOREIGN KEY (`sent_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `email_logs`
--
LOCK TABLES `email_logs` WRITE;
/*!40000 ALTER TABLE `email_logs` DISABLE KEYS */;
/*!40000 ALTER TABLE `email_logs` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `email_settings`
--
DROP TABLE IF EXISTS `email_settings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `email_settings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`smtp_host` varchar(255) NOT NULL,
`smtp_port` int(11) NOT NULL DEFAULT 587,
`smtp_username` varchar(255) NOT NULL,
`smtp_password` varchar(255) NOT NULL,
`smtp_encryption` enum('tls','ssl','none') DEFAULT 'tls',
`from_email` varchar(255) NOT NULL,
`from_name` varchar(255) NOT NULL,
`reply_to_email` varchar(255) DEFAULT NULL,
`welcome_email_subject` varchar(255) DEFAULT 'Welcome to COP Madina!',
`welcome_email_template` text DEFAULT NULL,
`is_active` tinyint(1) DEFAULT 1,
`daily_limit` int(11) DEFAULT 100,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `email_settings`
--
LOCK TABLES `email_settings` WRITE;
/*!40000 ALTER TABLE `email_settings` DISABLE KEYS */;
INSERT INTO `email_settings` VALUES (1,'smtp.gmail.com',587,'your-email@gmail.com','your-app-password','tls','noreply@copmadinaconf.org','COP Madina Conference',NULL,'Welcome to COP Madina Church!','<h2>Welcome to COP Madina!</h2>\n <p>Dear {member_name},</p>\n <p>We are delighted to welcome you to the Church of Pentecost - Madina Area family!</p>\n <p><strong>Your Membership Details:</strong></p>\n <ul>\n <li>Member ID: {member_id}</li>\n <li>Area: {area_name}</li>\n <li>District: {district_name}</li>\n <li>Assembly: {assembly_name}</li>\n <li>Join Date: {join_date}</li>\n </ul>\n <p>We look forward to your active participation in our church activities and spiritual growth.</p>\n <p>God bless you!</p>\n <p><strong>COP Madina Leadership Team</strong></p>',1,100,'2025-09-03 23:07:54','2025-09-03 23:07:54');
/*!40000 ALTER TABLE `email_settings` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `event_form_templates`
--
DROP TABLE IF EXISTS `event_form_templates`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `event_form_templates` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` text DEFAULT NULL,
`form_fields` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`form_fields`)),
`created_by` int(11) NOT NULL,
`status` enum('active','inactive') DEFAULT 'active',
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `fk_form_templates_user` (`created_by`),
CONSTRAINT `fk_form_templates_user` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `event_form_templates`
--
LOCK TABLES `event_form_templates` WRITE;
/*!40000 ALTER TABLE `event_form_templates` DISABLE KEYS */;
INSERT INTO `event_form_templates` VALUES (1,'Basic Conference Form','Standard form for conference registrations','[\n {\"name\": \"dietary_requirements\", \"label\": \"Dietary Requirements\", \"type\": \"textarea\", \"required\": false, \"description\": \"Please specify any dietary restrictions or allergies\"},\n {\"name\": \"emergency_contact\", \"label\": \"Emergency Contact Name\", \"type\": \"text\", \"required\": true},\n {\"name\": \"emergency_phone\", \"label\": \"Emergency Contact Phone\", \"type\": \"text\", \"required\": true},\n {\"name\": \"church_background\", \"label\": \"Church Background\", \"type\": \"select\", \"required\": false, \"options\": [\"Member\", \"Visitor\", \"First Time Attendee\", \"Other Church Member\"]},\n {\"name\": \"special_needs\", \"label\": \"Special Accommodation Needs\", \"type\": \"textarea\", \"required\": false, \"description\": \"Any special accommodations needed\"}\n]',1,'active','2025-09-03 12:09:24','2025-09-03 12:09:24'),(2,'Youth Event Form','Form template for youth events','[\n {\"name\": \"age_group\", \"label\": \"Age Group\", \"type\": \"select\", \"required\": true, \"options\": [\"13-17\", \"18-25\", \"26-35\"]},\n {\"name\": \"parent_guardian\", \"label\": \"Parent/Guardian Name (if under 18)\", \"type\": \"text\", \"required\": false},\n {\"name\": \"parent_phone\", \"label\": \"Parent/Guardian Phone (if under 18)\", \"type\": \"text\", \"required\": false},\n {\"name\": \"t_shirt_size\", \"label\": \"T-Shirt Size\", \"type\": \"select\", \"required\": false, \"options\": [\"XS\", \"S\", \"M\", \"L\", \"XL\", \"XXL\"]},\n {\"name\": \"interests\", \"label\": \"Areas of Interest\", \"type\": \"textarea\", \"required\": false, \"description\": \"What topics or activities interest you most?\"}\n]',1,'active','2025-09-03 12:09:24','2025-09-03 12:09:24');
/*!40000 ALTER TABLE `event_form_templates` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `event_forms`
--
DROP TABLE IF EXISTS `event_forms`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `event_forms` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`event_id` int(11) NOT NULL,
`template_id` int(11) DEFAULT NULL,
`form_fields` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`form_fields`)),
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `fk_event_forms_event` (`event_id`),
KEY `fk_event_forms_template` (`template_id`),
CONSTRAINT `fk_event_forms_event` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
CONSTRAINT `fk_event_forms_template` FOREIGN KEY (`template_id`) REFERENCES `event_form_templates` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `event_forms`
--
LOCK TABLES `event_forms` WRITE;
/*!40000 ALTER TABLE `event_forms` DISABLE KEYS */;
INSERT INTO `event_forms` VALUES (1,1,1,'[\n {\"name\": \"dietary_requirements\", \"label\": \"Dietary Requirements\", \"type\": \"textarea\", \"required\": false, \"description\": \"Please specify any dietary restrictions or allergies\"},\n {\"name\": \"emergency_contact\", \"label\": \"Emergency Contact Name\", \"type\": \"text\", \"required\": true},\n {\"name\": \"emergency_phone\", \"label\": \"Emergency Contact Phone\", \"type\": \"text\", \"required\": true},\n {\"name\": \"church_background\", \"label\": \"Church Background\", \"type\": \"select\", \"required\": false, \"options\": [\"Member\", \"Visitor\", \"First Time Attendee\", \"Other Church Member\"]},\n {\"name\": \"accommodation_needed\", \"label\": \"Accommodation Needed\", \"type\": \"select\", \"required\": false, \"options\": [\"Yes\", \"No\"]},\n {\"name\": \"workshop_preference\", \"label\": \"Workshop Preference\", \"type\": \"select\", \"required\": false, \"options\": [\"Leadership\", \"Marriage & Family\", \"Youth Ministry\", \"Evangelism\", \"Worship\"]}\n]','2025-09-03 12:09:24','2025-09-03 12:09:24'),(2,2,2,'[\n {\"name\": \"age_group\", \"label\": \"Age Group\", \"type\": \"select\", \"required\": true, \"options\": [\"13-17\", \"18-25\", \"26-35\"]},\n {\"name\": \"parent_guardian\", \"label\": \"Parent/Guardian Name (if under 18)\", \"type\": \"text\", \"required\": false},\n {\"name\": \"parent_phone\", \"label\": \"Parent/Guardian Phone (if under 18)\", \"type\": \"text\", \"required\": false},\n {\"name\": \"t_shirt_size\", \"label\": \"T-Shirt Size\", \"type\": \"select\", \"required\": true, \"options\": [\"XS\", \"S\", \"M\", \"L\", \"XL\", \"XXL\"]},\n {\"name\": \"career_interest\", \"label\": \"Career Interest Area\", \"type\": \"select\", \"required\": false, \"options\": [\"Technology\", \"Business\", \"Healthcare\", \"Education\", \"Ministry\", \"Arts & Media\", \"Other\"]}\n]','2025-09-03 12:09:24','2025-09-03 12:09:24'),(4,4,1,'[\n {\"name\": \"ministry_position\", \"label\": \"Ministry Position\", \"type\": \"text\", \"required\": true},\n {\"name\": \"years_in_ministry\", \"label\": \"Years in Ministry\", \"type\": \"select\", \"required\": true, \"options\": [\"1-5\", \"6-10\", \"11-20\", \"20+\"]},\n {\"name\": \"church_size\", \"label\": \"Church/Assembly Size\", \"type\": \"select\", \"required\": false, \"options\": [\"Under 50\", \"50-100\", \"101-300\", \"301-500\", \"500+\"]},\n {\"name\": \"workshop_interest\", \"label\": \"Workshop of Interest\", \"type\": \"select\", \"required\": false, \"options\": [\"Church Growth\", \"Pastoral Care\", \"Leadership Development\", \"Financial Management\", \"Youth Ministry\"]}\n]','2025-09-03 12:09:24','2025-09-03 12:09:24');
/*!40000 ALTER TABLE `event_forms` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `event_registrations`
--
DROP TABLE IF EXISTS `event_registrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `event_registrations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`event_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`ticket_type_id` int(11) DEFAULT NULL,
`registration_code` varchar(20) NOT NULL,
`form_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`form_data`)),
`payment_status` enum('pending','paid','refunded','cancelled') DEFAULT 'pending',
`payment_method` varchar(50) DEFAULT NULL,
`payment_reference` varchar(255) DEFAULT NULL,
`amount_paid` decimal(10,2) DEFAULT 0.00,
`registration_date` timestamp NULL DEFAULT current_timestamp(),
`status` enum('confirmed','cancelled','attended') DEFAULT 'confirmed',
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
UNIQUE KEY `registration_code` (`registration_code`),
KEY `fk_registrations_event` (`event_id`),
KEY `fk_registrations_user` (`user_id`),
KEY `fk_registrations_ticket` (`ticket_type_id`),
CONSTRAINT `fk_registrations_event` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
CONSTRAINT `fk_registrations_ticket` FOREIGN KEY (`ticket_type_id`) REFERENCES `ticket_types` (`id`) ON DELETE SET NULL,
CONSTRAINT `fk_registrations_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `event_registrations`
--
LOCK TABLES `event_registrations` WRITE;
/*!40000 ALTER TABLE `event_registrations` DISABLE KEYS */;
/*!40000 ALTER TABLE `event_registrations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `event_templates`
--
DROP TABLE IF EXISTS `event_templates`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `event_templates` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` text DEFAULT NULL,
`template_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`template_data`)),
`created_by` int(11) NOT NULL,
`status` enum('active','inactive') DEFAULT 'active',
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `fk_event_templates_user` (`created_by`),
CONSTRAINT `fk_event_templates_user` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `event_templates`
--
LOCK TABLES `event_templates` WRITE;
/*!40000 ALTER TABLE `event_templates` DISABLE KEYS */;
/*!40000 ALTER TABLE `event_templates` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `events`
--
DROP TABLE IF EXISTS `events`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `events` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`description` text DEFAULT NULL,
`event_type` enum('area','district','assembly') NOT NULL,
`area_id` int(11) DEFAULT NULL,
`district_id` int(11) DEFAULT NULL,
`assembly_id` int(11) DEFAULT NULL,
`start_date` datetime NOT NULL,
`end_date` datetime NOT NULL,
`venue` varchar(255) DEFAULT NULL,
`address` text DEFAULT NULL,
`capacity` int(11) DEFAULT 0,
`registration_fee` decimal(10,2) DEFAULT 0.00,
`early_bird_fee` decimal(10,2) DEFAULT 0.00,
`early_bird_deadline` datetime DEFAULT NULL,
`registration_deadline` datetime DEFAULT NULL,
`banner_image` varchar(255) DEFAULT NULL,
`status` enum('draft','active','cancelled','completed') DEFAULT 'draft',
`featured` tinyint(1) DEFAULT 0,
`seo_title` varchar(255) DEFAULT NULL,
`seo_description` text DEFAULT NULL,
`seo_keywords` text DEFAULT NULL,
`created_by` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `fk_events_area` (`area_id`),
KEY `fk_events_district` (`district_id`),
KEY `fk_events_assembly` (`assembly_id`),
KEY `fk_events_user` (`created_by`),
CONSTRAINT `fk_events_area` FOREIGN KEY (`area_id`) REFERENCES `areas` (`id`) ON DELETE CASCADE,
CONSTRAINT `fk_events_assembly` FOREIGN KEY (`assembly_id`) REFERENCES `assemblies` (`id`) ON DELETE CASCADE,
CONSTRAINT `fk_events_district` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`) ON DELETE CASCADE,
CONSTRAINT `fk_events_user` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `events`
--
LOCK TABLES `events` WRITE;
/*!40000 ALTER TABLE `events` DISABLE KEYS */;
INSERT INTO `events` VALUES (1,'Madina Area Annual Conference 2025','Join us for our annual area conference featuring powerful ministrations, workshops, and fellowship. This year\'s theme is \"Walking in Divine Purpose\" with renowned speakers and inspiring worship sessions.','area',1,NULL,NULL,'2025-09-23 09:00:00','2025-09-25 17:00:00','Madina Conference Center','Madina Market Road, Accra',500,50.00,35.00,'2024-09-23 23:59:59','2025-09-23 23:59:59',NULL,'active',1,'Madina Area Annual Conference 2024 - COP','Join the Madina Area Annual Conference 2024 with theme Walking in Divine Purpose. Register now for early bird rates.',NULL,1,'2025-09-03 12:09:24','2025-09-03 21:36:32'),(2,'East Legon District Youth Summit','A dynamic youth summit focusing on leadership development, career guidance, and spiritual growth. Designed for young people aged 13-35 with interactive sessions and networking opportunities.','district',1,2,NULL,'2025-09-23 09:00:00','2025-09-25 17:00:00','East Legon Community Center','East Legon, Accra',200,25.00,20.00,'2024-02-05 23:59:59','2024-02-18 23:59:59',NULL,'active',0,'East Legon District Youth Summit 2024','Youth Summit for leadership development and spiritual growth in East Legon District.',NULL,4,'2025-09-03 12:09:24','2025-09-03 18:18:02'),(4,'Dome District Ministers Conference','A specialized conference for ministers and church leaders focusing on effective ministry strategies, pastoral care, and church growth principles.','district',1,3,NULL,'2025-09-23 09:00:00','2025-09-25 17:00:00','Dome District Office','Dome Market, Accra',100,75.00,60.00,'2024-02-20 23:59:59','2024-03-02 23:59:59',NULL,'active',0,'Dome District Ministers Conference 2024','Ministers and church leaders conference focusing on effective ministry strategies.',NULL,1,'2025-09-03 12:09:24','2025-09-03 18:18:02');
/*!40000 ALTER TABLE `events` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `members`
--
DROP TABLE IF EXISTS `members`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `members` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`member_id` varchar(20) NOT NULL,
`event_id` int(11) NOT NULL,
`first_name` varchar(100) NOT NULL,
`last_name` varchar(100) NOT NULL,
`email` varchar(255) NOT NULL,
`phone` varchar(20) DEFAULT NULL,
`date_of_birth` date DEFAULT NULL,
`gender` enum('male','female') NOT NULL,
`marital_status` enum('single','married','divorced','widowed') DEFAULT NULL,
`occupation` varchar(100) DEFAULT NULL,
`address` text DEFAULT NULL,
`city` varchar(100) DEFAULT NULL,
`state` varchar(100) DEFAULT NULL,
`country` varchar(100) DEFAULT 'Ghana',
`postal_code` varchar(20) DEFAULT NULL,
`area_id` int(11) DEFAULT NULL,
`district_id` int(11) DEFAULT NULL,
`assembly_id` int(11) DEFAULT NULL,
`membership_type` enum('full_member','associate_member','visitor') DEFAULT 'associate_member',
`baptism_date` date DEFAULT NULL,
`confirmation_date` date DEFAULT NULL,
`join_date` date NOT NULL,
`membership_status` enum('active','inactive','suspended','transferred') DEFAULT 'active',
`emergency_contact_name` varchar(200) DEFAULT NULL,
`emergency_contact_phone` varchar(20) DEFAULT NULL,
`emergency_contact_relationship` varchar(50) DEFAULT NULL,
`skills_talents` text DEFAULT NULL,
`ministry_interests` text DEFAULT NULL,
`notes` text DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`created_by` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `member_id` (`member_id`),
UNIQUE KEY `email` (`email`),
KEY `created_by` (`created_by`),
KEY `idx_member_id` (`member_id`),
KEY `idx_email` (`email`),
KEY `idx_area` (`area_id`),
KEY `idx_district` (`district_id`),
KEY `idx_assembly` (`assembly_id`),
KEY `idx_status` (`membership_status`),
KEY `idx_join_date` (`join_date`),
CONSTRAINT `members_ibfk_1` FOREIGN KEY (`area_id`) REFERENCES `areas` (`id`) ON DELETE SET NULL,
CONSTRAINT `members_ibfk_2` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`) ON DELETE SET NULL,
CONSTRAINT `members_ibfk_3` FOREIGN KEY (`assembly_id`) REFERENCES `assemblies` (`id`) ON DELETE SET NULL,
CONSTRAINT `members_ibfk_4` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `members`
--
LOCK TABLES `members` WRITE;
/*!40000 ALTER TABLE `members` DISABLE KEYS */;
/*!40000 ALTER TABLE `members` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `nonmember_registrations`
--
DROP TABLE IF EXISTS `nonmember_registrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `nonmember_registrations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`event_id` int(11) NOT NULL,
`ticket_type_id` int(11) DEFAULT NULL,
`registration_code` varchar(20) NOT NULL,
`first_name` varchar(100) NOT NULL,
`last_name` varchar(100) NOT NULL,
`email` varchar(255) NOT NULL,
`phone` varchar(20) DEFAULT NULL,
`form_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`form_data`)),
`payment_status` enum('pending','paid','refunded','cancelled') DEFAULT 'pending',
`payment_method` varchar(50) DEFAULT NULL,
`payment_reference` varchar(255) DEFAULT NULL,
`amount_paid` decimal(10,2) DEFAULT 0.00,
`registration_date` timestamp NULL DEFAULT current_timestamp(),
`status` enum('confirmed','cancelled','attended') DEFAULT 'confirmed',
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
UNIQUE KEY `registration_code` (`registration_code`),
KEY `fk_nonmember_registrations_event` (`event_id`),
KEY `fk_nonmember_registrations_ticket` (`ticket_type_id`),
CONSTRAINT `fk_nonmember_registrations_event` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
CONSTRAINT `fk_nonmember_registrations_ticket` FOREIGN KEY (`ticket_type_id`) REFERENCES `ticket_types` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `nonmember_registrations`
--
LOCK TABLES `nonmember_registrations` WRITE;
/*!40000 ALTER TABLE `nonmember_registrations` DISABLE KEYS */;
INSERT INTO `nonmember_registrations` VALUES (1,1,NULL,'CONF2024003','Samuel','Asante','samuel.asante@example.com','+233 24 555 6666','{\"dietary_requirements\": \"No restrictions\", \"emergency_contact\": \"Grace Asante\", \"emergency_phone\": \"+233 24 777 8888\", \"church_background\": \"Visitor\", \"accommodation_needed\": \"Yes\", \"workshop_preference\": \"Evangelism\"}','pending',NULL,NULL,50.00,'2025-09-03 12:09:25','confirmed','2025-09-03 12:09:25','2025-09-03 12:09:25'),(4,1,NULL,'3T7OA9OQ','bismark','nkansah','nabibo3@gmail.com','','{\"dietary_requirements\":\"\",\"emergency_contact\":\"0244444444\",\"emergency_phone\":\"0244444444\",\"church_background\":\"First Time Attendee\",\"accommodation_needed\":\"Yes\",\"workshop_preference\":\"Leadership\"}','pending',NULL,NULL,50.00,'2025-09-03 22:16:05','confirmed','2025-09-03 22:16:05','2025-09-03 22:16:05');
/*!40000 ALTER TABLE `nonmember_registrations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `notifications`
--
DROP TABLE IF EXISTS `notifications`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notifications` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`title` varchar(255) NOT NULL,
`message` text NOT NULL,
`type` enum('info','success','warning','error') DEFAULT 'info',
`status` enum('read','unread') DEFAULT 'unread',
`is_read` tinyint(1) DEFAULT 0,
`created_at` timestamp NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
KEY `fk_notifications_user` (`user_id`),
CONSTRAINT `fk_notifications_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `notifications`
--
LOCK TABLES `notifications` WRITE;
/*!40000 ALTER TABLE `notifications` DISABLE KEYS */;
INSERT INTO `notifications` VALUES (4,1,'New Registration','New registration received for Madina Area Annual Conference 2024','info','read',0,'2025-09-03 12:09:25'),(7,1,'Success','Area deleted successfully!','success','unread',0,'2025-09-03 23:24:11'),(8,1,'Success','Assembly deleted successfully!','success','unread',0,'2025-09-03 23:24:33'),(9,1,'Success','Assembly deleted successfully!','success','unread',0,'2025-09-03 23:24:51'),(10,1,'Success','Assembly deleted successfully!','success','unread',0,'2025-09-03 23:24:55'),(11,1,'Success','Assembly deleted successfully!','success','unread',0,'2025-09-03 23:25:02'),(12,1,'Success','User deleted successfully!','success','unread',0,'2025-09-03 23:26:23'),(13,1,'Success','User deleted successfully!','success','unread',0,'2025-09-03 23:26:31'),(14,1,'Error','Failed to create database backup.','error','unread',0,'2025-09-04 09:18:33'),(15,1,'Error','Failed to create database backup.','error','unread',0,'2025-09-04 09:18:44'),(16,1,'Success','Backup file deleted successfully.','success','unread',0,'2025-09-04 09:18:51');
/*!40000 ALTER TABLE `notifications` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `order_items`
--
DROP TABLE IF EXISTS `order_items`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `order_items` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`unit_price` decimal(10,2) NOT NULL,
`total_price` decimal(10,2) NOT NULL,
`created_at` timestamp NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
KEY `fk_order_items_order` (`order_id`),
KEY `fk_order_items_product` (`product_id`),
CONSTRAINT `fk_order_items_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
CONSTRAINT `fk_order_items_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `order_items`
--
LOCK TABLES `order_items` WRITE;
/*!40000 ALTER TABLE `order_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `order_items` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `orders`
--
DROP TABLE IF EXISTS `orders`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `orders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_number` varchar(50) NOT NULL,
`event_id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`customer_name` varchar(255) NOT NULL,
`customer_email` varchar(255) NOT NULL,
`customer_phone` varchar(20) DEFAULT NULL,
`subtotal` decimal(10,2) NOT NULL,
`tax_amount` decimal(10,2) DEFAULT 0.00,
`discount_amount` decimal(10,2) DEFAULT 0.00,
`total_amount` decimal(10,2) NOT NULL,
`payment_status` enum('pending','paid','refunded','cancelled') DEFAULT 'pending',
`payment_method` varchar(50) DEFAULT NULL,
`payment_reference` varchar(255) DEFAULT NULL,
`status` enum('processing','shipped','delivered','cancelled') DEFAULT 'processing',
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
UNIQUE KEY `order_number` (`order_number`),
KEY `fk_orders_event` (`event_id`),
KEY `fk_orders_user` (`user_id`),
CONSTRAINT `fk_orders_event` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
CONSTRAINT `fk_orders_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `orders`
--
LOCK TABLES `orders` WRITE;
/*!40000 ALTER TABLE `orders` DISABLE KEYS */;
/*!40000 ALTER TABLE `orders` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `products`
--
DROP TABLE IF EXISTS `products`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`event_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`description` text DEFAULT NULL,
`price` decimal(10,2) NOT NULL,
`category` varchar(100) DEFAULT NULL,
`stock_quantity` int(11) DEFAULT 0,
`image` varchar(255) DEFAULT NULL,
`status` enum('active','inactive','out_of_stock') DEFAULT 'active',
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `fk_products_event` (`event_id`),
CONSTRAINT `fk_products_event` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `products`
--
LOCK TABLES `products` WRITE;
/*!40000 ALTER TABLE `products` DISABLE KEYS */;
INSERT INTO `products` VALUES (1,1,'Conference T-Shirt','Official Madina Area Conference 2024 T-Shirt with theme design',15.00,'Apparel',200,NULL,'active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(2,1,'Conference Handbook','Complete conference handbook with schedules and speaker profiles',10.00,'Materials',300,NULL,'active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(3,1,'USB Drive - Conference Materials','USB drive containing all conference materials and resources',20.00,'Digital',100,NULL,'active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(4,1,'Conference Mug','Commemorative mug with conference logo and theme',8.00,'Merchandise',150,NULL,'active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(5,2,'Youth Summit Hoodie','Stylish hoodie with Youth Summit branding',25.00,'Apparel',100,NULL,'active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(6,2,'Leadership Workbook','Comprehensive leadership development workbook',12.00,'Materials',150,NULL,'active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(7,4,'Ministers Handbook','Comprehensive guide for effective ministry',18.00,'Materials',80,NULL,'active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(8,4,'Ministry Resources CD','Collection of ministry resources and tools',15.00,'Digital',60,NULL,'active','2025-09-03 12:09:25','2025-09-03 12:09:25');
/*!40000 ALTER TABLE `products` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `promo_codes`
--
DROP TABLE IF EXISTS `promo_codes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `promo_codes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`event_id` int(11) NOT NULL,
`code` varchar(50) NOT NULL,
`type` enum('percentage','fixed_amount') NOT NULL,
`discount_value` decimal(10,2) NOT NULL,
`usage_limit` int(11) DEFAULT 0,
`used_count` int(11) DEFAULT 0,
`valid_from` datetime NOT NULL,
`valid_until` datetime NOT NULL,
`status` enum('active','inactive','expired') DEFAULT 'active',
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`),
KEY `fk_promo_codes_event` (`event_id`),
CONSTRAINT `fk_promo_codes_event` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `promo_codes`
--
LOCK TABLES `promo_codes` WRITE;
/*!40000 ALTER TABLE `promo_codes` DISABLE KEYS */;
INSERT INTO `promo_codes` VALUES (1,1,'EARLY2024','percentage',10.00,50,0,'2024-01-01 00:00:00','2024-02-15 23:59:59','active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(2,1,'MEMBER20','percentage',20.00,100,0,'2024-01-01 00:00:00','2024-03-10 23:59:59','active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(3,2,'YOUTH15','fixed_amount',5.00,30,0,'2024-01-15 00:00:00','2024-02-18 23:59:59','active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(4,4,'MINISTER10','percentage',15.00,20,0,'2024-02-01 00:00:00','2024-03-02 23:59:59','active','2025-09-03 12:09:25','2025-09-03 12:09:25');
/*!40000 ALTER TABLE `promo_codes` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `settings`
--
DROP TABLE IF EXISTS `settings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `settings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`setting_key` varchar(100) NOT NULL,
`setting_value` text DEFAULT NULL,
`description` text DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
UNIQUE KEY `setting_key` (`setting_key`),
KEY `fk_settings_user` (`updated_by`),
CONSTRAINT `fk_settings_user` FOREIGN KEY (`updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `settings`
--
LOCK TABLES `settings` WRITE;
/*!40000 ALTER TABLE `settings` DISABLE KEYS */;
INSERT INTO `settings` VALUES (1,'site_title','COP Madina Conference Management','Website title',NULL,'2025-09-03 12:09:17'),(2,'site_logo','assets/images/logo.png','Website logo path',NULL,'2025-09-03 12:09:17'),(3,'theme_color','blue','Primary theme color',NULL,'2025-09-03 12:09:17'),(4,'site_name','COP Madina Conference Platform',NULL,NULL,'2025-09-03 12:09:25'),(5,'site_description','Conference and Event Management Platform for The Church of Pentecost - Madina Area',NULL,NULL,'2025-09-03 12:09:25'),(6,'contact_email','info@copmadinaconf.org',NULL,NULL,'2025-09-03 12:09:25'),(7,'contact_phone','+233 24 123 4567',NULL,NULL,'2025-09-03 12:09:25'),(8,'timezone','Africa/Accra',NULL,NULL,'2025-09-03 12:09:25'),(9,'currency','GHS',NULL,NULL,'2025-09-03 12:09:25'),(10,'email_notifications','1',NULL,NULL,'2025-09-03 12:09:25'),(11,'sms_notifications','0',NULL,NULL,'2025-09-03 12:09:25'),(12,'auto_approve_registrations','1',NULL,NULL,'2025-09-03 12:09:25'),(13,'max_file_size','5',NULL,NULL,'2025-09-03 12:09:25'),(14,'allowed_file_types','jpg,jpeg,png,pdf,doc,docx',NULL,NULL,'2025-09-03 12:09:25'),(15,'maintenance_mode','0',NULL,NULL,'2025-09-03 12:09:25'),(16,'maintenance_message','The system is currently under maintenance. Please check back later.',NULL,NULL,'2025-09-03 12:09:25');
/*!40000 ALTER TABLE `settings` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ticket_types`
--
DROP TABLE IF EXISTS `ticket_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticket_types` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`event_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`description` text DEFAULT NULL,
`type` enum('free','paid','donation','tiered') NOT NULL,
`price` decimal(10,2) DEFAULT 0.00,
`capacity` int(11) DEFAULT 0,
`sales_start` datetime DEFAULT NULL,
`sales_end` datetime DEFAULT NULL,
`status` enum('active','inactive','sold_out') DEFAULT 'active',
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `fk_ticket_types_event` (`event_id`),
CONSTRAINT `fk_ticket_types_event` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ticket_types`
--
LOCK TABLES `ticket_types` WRITE;
/*!40000 ALTER TABLE `ticket_types` DISABLE KEYS */;
INSERT INTO `ticket_types` VALUES (1,1,'Early Bird Registration','Early bird pricing for the annual conference','paid',35.00,200,'2024-01-01 00:00:00','2024-02-15 23:59:59','active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(2,1,'Regular Registration','Regular pricing for the annual conference','paid',50.00,300,'2024-02-16 00:00:00','2024-03-10 23:59:59','active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(3,1,'Student Discount','Discounted rate for students with valid ID','paid',25.00,50,'2024-01-01 00:00:00','2024-03-10 23:59:59','active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(4,2,'Youth Summit Pass','Full access to all youth summit activities','paid',25.00,150,'2024-01-15 00:00:00','2024-02-18 23:59:59','active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(5,2,'Day Pass','Single day access to youth summit','paid',15.00,50,'2024-01-15 00:00:00','2024-02-18 23:59:59','active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(7,4,'Ministers Pass','Full conference access for ministers','paid',75.00,80,'2024-02-01 00:00:00','2024-03-02 23:59:59','active','2025-09-03 12:09:25','2025-09-03 12:09:25'),(8,4,'Early Bird Ministers','Early bird rate for ministers','paid',60.00,20,'2024-02-01 00:00:00','2024-02-20 23:59:59','active','2025-09-03 12:09:25','2025-09-03 12:09:25');
/*!40000 ALTER TABLE `ticket_types` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(100) DEFAULT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`first_name` varchar(100) NOT NULL,
`last_name` varchar(100) NOT NULL,
`phone` varchar(20) DEFAULT NULL,
`date_of_birth` date DEFAULT NULL,
`gender` enum('male','female','other') DEFAULT NULL,
`address` text DEFAULT NULL,
`role` enum('superuser','area_admin','district_admin','assembly_admin','member') NOT NULL,
`area_id` int(11) DEFAULT NULL,
`district_id` int(11) DEFAULT NULL,
`assembly_id` int(11) DEFAULT NULL,
`profile_image` varchar(255) DEFAULT NULL,
`status` enum('active','inactive','suspended') DEFAULT 'active',
`email_verified` tinyint(1) DEFAULT 0,
`last_login` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`),
UNIQUE KEY `username` (`username`),
KEY `fk_users_area` (`area_id`),
KEY `fk_users_district` (`district_id`),
KEY `fk_users_assembly` (`assembly_id`),
CONSTRAINT `fk_users_area` FOREIGN KEY (`area_id`) REFERENCES `areas` (`id`) ON DELETE SET NULL,
CONSTRAINT `fk_users_assembly` FOREIGN KEY (`assembly_id`) REFERENCES `assemblies` (`id`) ON DELETE SET NULL,
CONSTRAINT `fk_users_district` FOREIGN KEY (`district_id`) REFERENCES `districts` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'nabibo','nabibo2@yahoo.co.uk','$2y$10$kf0KTJ4SdV1qIvfTpsvySuqlURlEriiAF3eE8OJkrxMHIumucvk6m','Super','User',NULL,NULL,NULL,NULL,'superuser',NULL,NULL,NULL,NULL,'active',0,'2025-09-04 06:39:59','2025-09-03 12:09:17','2025-09-04 06:39:59'),(2,'area_admin1','madina.area@cop.org','$2y$10$e0MYzXyjpJS7Pd0RVvHwHuFEDf6X/2TV8k8B95JieuK2LnQinmFW2','Emmanuel','Asante','+233 24 111 1111',NULL,NULL,NULL,'area_admin',1,NULL,NULL,NULL,'active',0,NULL,'2025-09-03 12:09:24','2025-09-03 12:09:24'),(4,'district_admin1','madina.district@cop.org','$2y$10$e0MYzXyjpJS7Pd0RVvHwHuFEDf6X/2TV8k8B95JieuK2LnQinmFW2','Samuel','Osei','+233 24 222 2222',NULL,NULL,NULL,'district_admin',1,1,NULL,NULL,'active',0,NULL,'2025-09-03 12:09:24','2025-09-03 12:09:24');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping routines for database 'copmadinaconf'
--
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2025-09-04 9:21:30
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists