#!/bin/bash
# Setup Verification Script untuk LOGBOOK PPDS
# Run: bash verify_setup.sh

echo "=========================================="
echo "LOGBOOK PPDS - Setup Verification"
echo "=========================================="
echo ""

# Check folder structure
echo "✓ Checking folder structure..."
folders=("css" "js" "php" "database" "assets/img")
all_folders_exist=true

for folder in "${folders[@]}"; do
    if [ -d "$folder" ]; then
        echo "  ✓ $folder"
    else
        echo "  ✗ $folder (MISSING)"
        all_folders_exist=false
    fi
done

echo ""

# Check important files
echo "✓ Checking files..."
files=("index.html" "login.html" "css/style.css" "js/script.js" "js/app.js" "php/config.php" "php/api.php" "database/database.sql" "README.md")
all_files_exist=true

for file in "${files[@]}"; do
    if [ -f "$file" ]; then
        echo "  ✓ $file"
    else
        echo "  ✗ $file (MISSING)"
        all_files_exist=false
    fi
done

echo ""
echo "=========================================="

if [ "$all_folders_exist" = true ] && [ "$all_files_exist" = true ]; then
    echo "✓ All files and folders are in place!"
    echo ""
    echo "Next steps:"
    echo "1. Start XAMPP (Apache + MySQL)"
    echo "2. Create database 'logbook_ppds'"
    echo "3. Import database/database.sql"
    echo "4. Access: http://localhost/logbook-ppds/"
    echo ""
    exit 0
else
    echo "✗ Some files or folders are missing!"
    echo "Please check your project structure."
    exit 1
fi
