Sindbad~EG File Manager

Current Path : /home/copmadinaarea/thecopmadinaarea.org/portal/sql/
Upload File :
Current File : /home/copmadinaarea/thecopmadinaarea.org/portal/sql/add_sample_events.sql

-- Add sample events for testing the conference page

-- First, make sure the events table has the required columns
ALTER TABLE events 
ADD COLUMN IF NOT EXISTS featured BOOLEAN DEFAULT FALSE,
ADD COLUMN IF NOT EXISTS image_url VARCHAR(500) NULL,
ADD COLUMN IF NOT EXISTS max_attendees INT NULL,
ADD COLUMN IF NOT EXISTS registration_fee DECIMAL(10,2) DEFAULT 0.00,
ADD COLUMN IF NOT EXISTS event_type ENUM('conference', 'workshop', 'rally', 'service', 'program', 'fellowship', 'other') DEFAULT 'other',
ADD COLUMN IF NOT EXISTS public_registration BOOLEAN DEFAULT TRUE,
ADD COLUMN IF NOT EXISTS require_approval BOOLEAN DEFAULT FALSE;

-- Clear existing sample events (optional)
DELETE FROM events WHERE name LIKE 'Sample%' OR name LIKE 'Test%';

-- Add sample events for testing
INSERT INTO events (
    name, description, start_date, end_date, location_type, is_active, 
    registration_status, featured, event_type, public_registration, 
    registration_fee, max_attendees, created_by
) VALUES 
-- Featured Event
(
    'Annual Church Conference 2025', 
    'Join us for our biggest event of the year featuring inspiring speakers, worship sessions, and fellowship opportunities.',
    DATE_ADD(NOW(), INTERVAL 30 DAY),
    DATE_ADD(NOW(), INTERVAL 32 DAY),
    'area',
    1,
    'open',
    1,
    'conference',
    1,
    0.00,
    500,
    1
),

-- Other upcoming events
(
    'Youth Leadership Workshop', 
    'Empowering the next generation of church leaders through interactive workshops and mentorship.',
    DATE_ADD(NOW(), INTERVAL 15 DAY),
    DATE_ADD(NOW(), INTERVAL 15 DAY),
    'district',
    1,
    'open',
    0,
    'workshop',
    1,
    25.00,
    100,
    1
),

(
    'Community Outreach Rally', 
    'Come together to serve our community and make a positive impact in our neighborhood.',
    DATE_ADD(NOW(), INTERVAL 20 DAY),
    DATE_ADD(NOW(), INTERVAL 20 DAY),
    'assembly',
    1,
    'open',
    0,
    'rally',
    1,
    0.00,
    200,
    1
),

(
    'Marriage Enrichment Seminar', 
    'Strengthen your marriage with biblical principles and practical tools for lasting relationships.',
    DATE_ADD(NOW(), INTERVAL 25 DAY),
    DATE_ADD(NOW(), INTERVAL 25 DAY),
    'area',
    1,
    'open',
    0,
    'workshop',
    1,
    15.00,
    80,
    1
),

(
    'Sunday Service Special', 
    'Special guest speaker and worship experience celebrating our church anniversary.',
    DATE_ADD(NOW(), INTERVAL 7 DAY),
    DATE_ADD(NOW(), INTERVAL 7 DAY),
    'assembly',
    1,
    'open',
    0,
    'service',
    1,
    0.00,
    300,
    1
),

(
    'Mens Fellowship Breakfast', 
    'Monthly fellowship breakfast for men to connect, share, and grow together.',
    DATE_ADD(NOW(), INTERVAL 10 DAY),
    DATE_ADD(NOW(), INTERVAL 10 DAY),
    'assembly',
    1,
    'open',
    0,
    'fellowship',
    1,
    10.00,
    50,
    1
),

(
    'Womens Prayer Conference', 
    'A powerful time of prayer, worship, and spiritual renewal for women.',
    DATE_ADD(NOW(), INTERVAL 35 DAY),
    DATE_ADD(NOW(), INTERVAL 36 DAY),
    'district',
    1,
    'open',
    0,
    'conference',
    1,
    20.00,
    150,
    1
);

-- Verify the events were added
SELECT 
    name, 
    start_date, 
    event_type, 
    featured, 
    public_registration,
    registration_fee
FROM events 
WHERE is_active = 1 AND start_date >= NOW()
ORDER BY featured DESC, start_date ASC;

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists