25 lines
487 B
PHP
25 lines
487 B
PHP
<?
|
|
namespace front\controls;
|
|
|
|
class ContactsMapsApi
|
|
{
|
|
static public function index()
|
|
{
|
|
// JSON header
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
|
|
$only_active = true;
|
|
if (\S::get('all') == 1) $only_active = false; // przykład ?all=1
|
|
|
|
$data = \front\factory\ContactsMaps::api_list($only_active);
|
|
|
|
echo json_encode([
|
|
'status' => 'ok',
|
|
'count' => count($data),
|
|
'data' => $data,
|
|
], JSON_UNESCAPED_UNICODE);
|
|
|
|
exit;
|
|
}
|
|
}
|