merge
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
<?php
|
||||
require_once dirname(__DIR__, 2) . '/vendor/autoload.php';
|
||||
require_once __DIR__ . '/class/db-functions.php';
|
||||
include dirname(__DIR__) . '/../extra/auth.php';
|
||||
if (!Auth::check()) { http_response_code(401); echo json_encode(['error' => 'Unauthorized']); exit; }
|
||||
|
||||
header('Content-Type: application/json');
|
||||
ini_set('display_errors', '0');
|
||||
|
||||
@@ -42,6 +47,18 @@ if ($id !== null) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Return unique MacroMatrice list
|
||||
if (isset($_GET['macro_list'])) {
|
||||
$macros = [];
|
||||
foreach ($matrici as $m) {
|
||||
$mv = $m['MacroMatrice'] ?? '';
|
||||
if ($mv !== '' && !in_array($mv, $macros, true)) $macros[] = $mv;
|
||||
}
|
||||
sort($macros);
|
||||
echo json_encode(['success' => true, 'value' => $macros]);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Search (with optional MacroMatrice filter)
|
||||
$results = [];
|
||||
foreach ($matrici as $m) {
|
||||
|
||||
Reference in New Issue
Block a user