itskp-odense/Backend/controller/getUser.php

18 lines
294 B
PHP
Raw Normal View History

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