Files
faveo/resources/views/themes/default1/agent/helpdesk/organization/getautocomplete.blade.php
Shift f9ab4d057e Adopt short array syntax
Since PHP 5.4 the short array syntax `[]` may be used instead of `array()`.
2023-01-03 08:25:32 +00:00

19 lines
371 B
PHP

<?php
$term = $_GET["term"];
$organizations =App\Model\helpdesk\Agent_panel\Organization::where('name', 'LIKE', '%' . $term . '%')->get();
$json = [];
foreach ($organizations as $organization) {
$json[] = [
'value' => $organization["name"],
'label' => $organization["name"],
'org' => $organization["name"],
];
}
echo json_encode($json);