Sindbad~EG File Manager

Current Path : /home/copmadinaarea/thecopmadinaarea.org/conference/
Upload File :
Current File : /home/copmadinaarea/thecopmadinaarea.org/conference/debug_form_data.php

<?php
require_once 'includes/functions.php';

$eventId = 1; // Test with event ID 1
$db = new CopMadinaDB();
$conn = $db->getConnection();

// Get event details
$stmt = $conn->prepare("SELECT * FROM events WHERE id = ?");
$stmt->execute([$eventId]);
$event = $stmt->fetch();

echo "<h2>Event Details for ID: $eventId</h2>";
echo "<pre>";
print_r($event);
echo "</pre>";

// Check form template
if (!empty($event['form_template_id'])) {
    echo "<h2>Form Template ID: " . $event['form_template_id'] . "</h2>";
    
    $stmt = $conn->prepare("SELECT * FROM event_form_templates WHERE id = ? AND status = 'active'");
    $stmt->execute([$event['form_template_id']]);
    $template = $stmt->fetch();
    
    if ($template) {
        echo "<h3>Template Found:</h3>";
        echo "<pre>";
        print_r($template);
        echo "</pre>";
        
        $formFields = json_decode($template['form_fields'], true);
        echo "<h3>Decoded Form Fields:</h3>";
        echo "<pre>";
        print_r($formFields);
        echo "</pre>";
    } else {
        echo "<p>No active template found with ID: " . $event['form_template_id'] . "</p>";
    }
} else {
    echo "<p>No form_template_id set for this event</p>";
}

// Check custom event form
$stmt = $conn->prepare("SELECT * FROM event_forms WHERE event_id = ?");
$stmt->execute([$eventId]);
$eventForm = $stmt->fetch();

if ($eventForm) {
    echo "<h2>Custom Event Form:</h2>";
    echo "<pre>";
    print_r($eventForm);
    echo "</pre>";
    
    $customFields = json_decode($eventForm['form_fields'], true);
    echo "<h3>Custom Form Fields:</h3>";
    echo "<pre>";
    print_r($customFields);
    echo "</pre>";
} else {
    echo "<p>No custom event form found</p>";
}

// Check recent registrations
echo "<h2>Recent Registrations:</h2>";
$stmt = $conn->prepare("SELECT * FROM event_registrations WHERE event_id = ? ORDER BY created_at DESC LIMIT 3");
$stmt->execute([$eventId]);
$memberRegs = $stmt->fetchAll();

$stmt = $conn->prepare("SELECT * FROM nonmember_registrations WHERE event_id = ? ORDER BY created_at DESC LIMIT 3");
$stmt->execute([$eventId]);
$nonmemberRegs = $stmt->fetchAll();

echo "<h3>Member Registrations:</h3>";
echo "<pre>";
print_r($memberRegs);
echo "</pre>";

echo "<h3>Non-member Registrations:</h3>";
echo "<pre>";
print_r($nonmemberRegs);
echo "</pre>";
?>

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