Server : LiteSpeed
System : Linux terra.hostitbro.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64
User : outerorb ( 1091)
PHP Version : 8.1.34
Disable Function : mail
Directory :  /home2/outerorb/.trash/survey_system/

📁 Create New:
⬆️ Upload File:
Current Dir [ Writable ] Root [ Writable ]


OR Upload from URL:
URL: Save as:

📄 File: setup_chat.php

Path: /home2/outerorb/.trash/survey_system/setup_chat.php

Size: 1.37 KB

Permissions: 0666

<?php
/**
 * Chat System Setup Script
 * Run this once to initialize the chat database tables
 */

require_once __DIR__ . '/config.php';

echo "<h2>Setting up Chat System...</h2>";

// Read the SQL schema
$sqlFile = __DIR__ . '/chat_schema.sql';
if (!file_exists($sqlFile)) {
    die("Error: chat_schema.sql not found!");
}

$sql = file_get_contents($sqlFile);

// Split by statements (simple approach)
$statements = array_filter(array_map('trim', explode(';', $sql)));

$success = 0;
$errors = [];

foreach ($statements as $statement) {
    if (empty($statement)) continue;
    
    try {
        $pdo->exec($statement);
        $success++;
        echo "<p>✓ Executed statement " . $success . "</p>";
    } catch (PDOException $e) {
        $errors[] = $e->getMessage();
        echo "<p style='color:red;'>✗ Error: " . h($e->getMessage()) . "</p>";
    }
}

if (empty($errors)) {
    echo "<p style='color:green;'><strong>✓ Chat system initialized successfully!</strong></p>";
    echo "<p>You can now use the chat system. Visit <a href='/survey_system/dashboard.php'>Dashboard</a></p>";
} else {
    echo "<p style='color:red;'><strong>✗ Some errors occurred:</strong></p>";
    foreach ($errors as $error) {
        echo "<p>" . h($error) . "</p>";
    }
}

echo "<p><a href='/survey_system/dashboard.php'>Back to Dashboard</a></p>";
?>

← Back to Directory Edit File 🔒 Chmod

WP File Manager