Sindbad~EG File Manager
<?php
require_once '../../config/config.php';
checkLogin();
$pageTitle = "AI Chatbot Management - " . APP_NAME;
// Check access
if (!isSuperuser()) {
redirect('../../dashboard.php');
}
require_once '../../classes/ChatbotService.php';
$chatbot = new ChatbotService();
$success = '';
$error = '';
// Get statistics
$stats = $chatbot->getStatistics();
include '../../includes/header.php';
include '../../includes/sidebar.php';
?>
<main class="main-content md:ml-64 pt-16">
<div class="container mx-auto px-4 py-8">
<!-- Header -->
<div class="mb-8">
<h1 class="text-3xl font-bold text-gray-800">
<i class="fas fa-robot mr-2 text-blue-500"></i>AI Chatbot Management
</h1>
<p class="text-gray-600 mt-2">Manage FAQs, documents, and chatbot settings</p>
</div>
<!-- Statistics Cards -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
<div class="bg-white rounded-xl shadow-lg p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-blue-100 text-blue-600">
<i class="fas fa-comments text-2xl"></i>
</div>
<div class="ml-4">
<p class="text-sm text-gray-600">Total Conversations</p>
<p class="text-2xl font-bold text-gray-800"><?php echo number_format($stats['total_conversations']); ?></p>
</div>
</div>
</div>
<div class="bg-white rounded-xl shadow-lg p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-green-100 text-green-600">
<i class="fas fa-question-circle text-2xl"></i>
</div>
<div class="ml-4">
<p class="text-sm text-gray-600">Active FAQs</p>
<p class="text-2xl font-bold text-gray-800"><?php echo number_format($stats['active_faqs']); ?></p>
</div>
</div>
</div>
<div class="bg-white rounded-xl shadow-lg p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-purple-100 text-purple-600">
<i class="fas fa-file-alt text-2xl"></i>
</div>
<div class="ml-4">
<p class="text-sm text-gray-600">Documents</p>
<p class="text-2xl font-bold text-gray-800"><?php echo number_format($stats['active_documents']); ?></p>
</div>
</div>
</div>
<div class="bg-white rounded-xl shadow-lg p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-yellow-100 text-yellow-600">
<i class="fas fa-star text-2xl"></i>
</div>
<div class="ml-4">
<p class="text-sm text-gray-600">Avg Rating</p>
<p class="text-2xl font-bold text-gray-800"><?php echo $stats['avg_rating']; ?>/5</p>
</div>
</div>
</div>
</div>
<!-- Quick Actions -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<a href="faqs.php" class="bg-gradient-to-r from-blue-500 to-blue-600 text-white rounded-xl p-6 hover:shadow-lg transition-all duration-300 group">
<div class="flex items-center justify-between">
<div>
<i class="fas fa-question-circle text-3xl mb-3"></i>
<h3 class="text-xl font-bold">Manage FAQs</h3>
<p class="text-blue-100 text-sm mt-2">Add, edit, and organize frequently asked questions</p>
</div>
<i class="fas fa-arrow-right text-2xl group-hover:translate-x-2 transition-transform"></i>
</div>
</a>
<a href="documents.php" class="bg-gradient-to-r from-purple-500 to-purple-600 text-white rounded-xl p-6 hover:shadow-lg transition-all duration-300 group">
<div class="flex items-center justify-between">
<div>
<i class="fas fa-file-upload text-3xl mb-3"></i>
<h3 class="text-xl font-bold">Manage Documents</h3>
<p class="text-purple-100 text-sm mt-2">Upload and index documents for AI learning</p>
</div>
<i class="fas fa-arrow-right text-2xl group-hover:translate-x-2 transition-transform"></i>
</div>
</a>
<a href="settings.php" class="bg-gradient-to-r from-orange-500 to-orange-600 text-white rounded-xl p-6 hover:shadow-lg transition-all duration-300 group">
<div class="flex items-center justify-between">
<div>
<i class="fas fa-cog text-3xl mb-3"></i>
<h3 class="text-xl font-bold">Settings</h3>
<p class="text-orange-100 text-sm mt-2">Configure chatbot appearance and behavior</p>
</div>
<i class="fas fa-arrow-right text-2xl group-hover:translate-x-2 transition-transform"></i>
</div>
</a>
</div>
<!-- Recent Conversations -->
<div class="bg-white rounded-xl shadow-lg p-6">
<h3 class="text-lg font-bold text-gray-800 mb-4">
<i class="fas fa-history mr-2 text-gray-600"></i>Recent Activity
</h3>
<div class="text-gray-600 text-center py-8">
<i class="fas fa-chart-line text-4xl text-gray-300 mb-3"></i>
<p>Analytics and conversation history coming soon!</p>
</div>
</div>
</div>
</main>
<?php include '../../includes/footer.php'; ?>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists