id); header('Content-Type: application/json; charset=utf-8'); echo json_encode($respuesta, JSON_UNESCAPED_UNICODE); } public function ajaxEditarReporte() { $registros = ReportesController::ctrEditarReporte($this->todos_los_campos); echo json_encode($registros, JSON_UNESCAPED_UNICODE); } public function ajaxNuevoReporte() { $registros = ReportesController::ctrNuevoReporte($this->todos_los_campos); echo json_encode($registros, JSON_UNESCAPED_UNICODE); } public function ajaxBorrarReporte() { $respuesta = ReportesController::ctrBorrarReporte($this->id); header('Content-Type: application/json; charset=utf-8'); echo json_encode($respuesta, JSON_UNESCAPED_UNICODE); } } if (isset($_POST['accion']) && $_POST['accion'] == "LISTAR") { $registros = new ajaxReportes(); $registros->ajaxListarReportes(); } if (isset($_POST['accion']) && $_POST['accion'] == "DATOS") { $registros = new ajaxReportes(); $registros->id = $_POST['id']; $registros->ajaxDatosReporte(); } if (isset($_POST['accion']) && $_POST['accion'] == "EDITAR") { $registros = new ajaxReportes(); $registros->todos_los_campos = $_POST; $registros->ajaxEditarReporte(); } if (isset($_POST['accion']) && $_POST['accion'] == "NUEVO") { $registros = new ajaxReportes(); $registros->todos_los_campos = $_POST; $registros->ajaxNuevoReporte(); } if (isset($_POST['accion']) && $_POST['accion'] == "BORRAR") { $registros = new ajaxReportes(); $registros->id = $_POST['id']; $registros->ajaxBorrarReporte(); }