diff --git a/action/action_auditoria_detalle.php b/action/action_auditoria_detalle.php new file mode 100644 index 0000000..52336af --- /dev/null +++ b/action/action_auditoria_detalle.php @@ -0,0 +1,47 @@ + 'unauthorized'])); +} +$user = unserialize($_SESSION['user']); + +// check method +try { + if ($_SERVER['REQUEST_METHOD'] === 'GET') { + + $data = $db + ->where('horario_id', $_GET['horario_id']) + ->where('profesor_id', $_GET['profesor_id']) + ->getOne('auditoria_mat'); + // Print the JSON file + echo json_encode($data); + } 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(), + ], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_PARTIAL_OUTPUT_ON_ERROR); + exit; +} catch (Exception $th) { + http_response_code(500); + echo json_encode([ + 'error' => $th->getMessage(), + ], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); + exit; +} \ No newline at end of file