42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?
|
|
#input $_GET['id_espacio_sgu']
|
|
define("INFORMATION", [
|
|
'GET' => [
|
|
],
|
|
]);
|
|
#output rutas: [ ...ruta, salones: [{...salon}] ]
|
|
header('Content-Type: application/json charset=utf-8');
|
|
#return html
|
|
$ruta = "../";
|
|
require_once "../class/c_login.php";
|
|
// check method
|
|
try {
|
|
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
|
// check parameters
|
|
$raw = file_get_contents('php://input');
|
|
$post_get = json_decode($raw, true);
|
|
|
|
$data = $db->get('estado_supervisor');
|
|
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
|
} else {
|
|
http_response_code(405);
|
|
echo json_encode(['error' => 'method not allowed']);
|
|
exit;
|
|
|
|
}
|
|
|
|
} catch (PDOException $th) {
|
|
http_response_code(500);
|
|
echo json_encode([
|
|
'error' => $th->getMessage(),
|
|
'query' => $db->getLastQuery(),
|
|
'post_data' => $post_get,
|
|
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
|
exit;
|
|
} catch (Exception $th) {
|
|
http_response_code(500);
|
|
echo json_encode([
|
|
'error' => $th->getMessage(),
|
|
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
|
exit;
|
|
} |