<?php
/**
 * نصب جداول ABC آموزش
 * C:\xampp\php\php.exe run-education-abc-install.php
 */
declare(strict_types=1);

if ( ! defined( 'ACC_BASE_PATH' ) ) {
    define( 'ACC_BASE_PATH', __DIR__ );
    require __DIR__ . '/standalone/bootstrap.php';
}

header( 'Content-Type: application/json; charset=utf-8' );

require_once ACC_PATH . 'includes/helpers/education-activity-cost.php';
Edu_Activity_Cost::ensure_tables();

$acts = Edu_Activity_Cost::list_activities( false );
echo wp_json_encode( [
    'success' => true,
    'message' => 'جداول ABC آموزش آماده شد',
    'activities' => count( $acts ),
    'sample' => array_slice( $acts, 0, 3 ),
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT );
