#!/bin/bash

echo "========================================"
echo "Bangladesh Location Data Import Script"
echo "========================================"
echo ""

# Set database credentials (modify as needed)
DB_HOST="localhost"
DB_USER="root"
DB_PASS=""
DB_NAME="cms_db"

echo "Importing Bangladesh location data..."
echo ""

# Run the SQL script
if [ -z "$DB_PASS" ]; then
    mysql -h "$DB_HOST" -u "$DB_USER" "$DB_NAME" < insert_bangladesh_locations.sql
else
    mysql -h "$DB_HOST" -u "$DB_USER" -p"$DB_PASS" "$DB_NAME" < insert_bangladesh_locations.sql
fi

if [ $? -eq 0 ]; then
    echo ""
    echo "========================================"
    echo "SUCCESS: Bangladesh location data imported!"
    echo "========================================"
    echo ""
    echo "Data imported:"
    echo "- 1 Country (Bangladesh)"
    echo "- 8 Divisions"
    echo "- 64 Districts"
    echo "- Major Thanas for all districts"
    echo ""
else
    echo ""
    echo "========================================"
    echo "ERROR: Failed to import data!"
    echo "========================================"
    echo ""
    echo "Please check:"
    echo "1. Database connection settings"
    echo "2. Database name is correct"
    echo "3. MySQL is running"
    echo ""
fi

