<?php
include 'includes/db.php';

// Create job_applications table
$sql = "CREATE TABLE IF NOT EXISTS job_applications (
    id INT(11) NOT NULL AUTO_INCREMENT,
    name VARCHAR(100) NOT NULL,
    email VARCHAR(100) NOT NULL,
    contact VARCHAR(50) NOT NULL,
    address TEXT NOT NULL,
    resume_path VARCHAR(255) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (id)
)";

if ($conn->query($sql) === TRUE) {
    echo "Table 'job_applications' checked/created successfully.<br>";
} else {
    echo "Error creating table 'job_applications': " . $conn->error . "<br>";
}

echo "<h3>Database Update Complete.</h3>";
echo "<a href='admin/dashboard.php'>Go to Dashboard</a>";
?>
