@echo off
REM ============================================
REM JBR Sofa - Live Deployment Helper Script
REM ============================================
REM This script helps prepare the application for deployment

echo.
echo ============================================
echo JBR Sofa - Deployment Checker
echo ============================================
echo.

REM Check if config.php exists
if exist config.php (
    echo [OK] config.php found
) else (
    echo [ERROR] config.php not found
)

REM Check if .env file exists
if exist .env (
    echo [OK] .env file found
) else (
    echo [WARNING] .env file not found - copy from .env.example
)

REM Check if database.sql exists
if exist database.sql (
    echo [OK] database.sql found
) else (
    echo [ERROR] database.sql not found
)

REM Check if vendor exists
if exist vendor (
    echo [OK] vendor directory found
) else (
    echo [ERROR] vendor directory not found - run: composer install --no-dev
)

REM Check if temp directory exists
if exist temp (
    echo [OK] temp directory found
) else (
    echo [WARNING] Creating temp directory...
    mkdir temp
    echo [OK] temp directory created
)

REM Check includes
echo.
echo Checking core files...
if exist includes\db.php (
    echo [OK] includes/db.php found
) else (
    echo [ERROR] includes/db.php not found
)

if exist includes\functions.php (
    echo [OK] includes/functions.php found
) else (
    echo [ERROR] includes/functions.php not found
)

if exist includes\header.php (
    echo [OK] includes/header.php found
) else (
    echo [ERROR] includes/header.php not found
)

echo.
echo ============================================
echo Checklist:
echo ============================================
echo [ ] 1. Copy .env.example to .env
echo [ ] 2. Update .env with live server database credentials
echo [ ] 3. Upload all files to live server
echo [ ] 4. Create database on live server using database.sql
echo [ ] 5. Set correct file permissions (755 for temp, 644 for error_log)
echo [ ] 6. Test at https://bismitrichy.com/jbrsofa
echo [ ] 7. Check error_log for any issues
echo.
echo For detailed instructions, see DEPLOYMENT.md
echo.
pause
