2021-06-09 08:29:33 +00:00
|
|
|
<?php
|
2021-06-09 11:20:49 +00:00
|
|
|
session_start();
|
2021-06-09 08:29:33 +00:00
|
|
|
require "../../bootstrap.php";
|
|
|
|
|
2021-06-09 10:36:46 +00:00
|
|
|
use Backend\Model\User;
|
2021-06-09 08:29:33 +00:00
|
|
|
|
|
|
|
header('Content-Type: application/json;charset=UTF-8');
|
|
|
|
|
|
|
|
if(isset($_POST['id']))
|
2021-06-09 10:36:46 +00:00
|
|
|
$data = User::find($_POST['id']);
|
2021-06-09 08:29:33 +00:00
|
|
|
else
|
2021-06-09 10:36:46 +00:00
|
|
|
$data = User::all('id', 'name');
|
2021-06-09 11:20:49 +00:00
|
|
|
echo json_encode(array($data, $_SESSION['id']));
|
2021-06-09 08:29:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|