<?php
// api/regimenes_list.php
declare(strict_types=1);
session_start();
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');

if (!isset($_SESSION['ingreso']) || $_SESSION['ingreso'] !== 'YES') {
  echo json_encode(['success'=>false,'data'=>[]]); exit;
}

// TODO: Cambia por tu consulta real
$data = [
  ['id'=>'10','nombre'=>'DAI 10'],
  ['id'=>'70','nombre'=>'DAI 70'],
  ['id'=>'SIMPLE','nombre'=>'SIMPLE'],
];

echo json_encode(['success'=>true,'data'=>$data], JSON_UNESCAPED_UNICODE);
