tieneAcceso() && isset($_POST["id"]) && $_POST["id"]!="" && isset($_POST["check"]) && $_POST["check"]!=""){ $grupo = filter_input(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT);//limpia texto $str_check = trim(filter_input(INPUT_POST, "check", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto $stmt = $pdo->prepare('Select * from fs_horariogrupo(:gpo, NULL, NULL)'); $stmt->bindParam(":gpo", $grupo); $error = false; if(!$stmt->execute()){ $t = $stmt->errorInfo(); $return["error"] = "Ocurrió un error al obtener los horarios del grupo ".$t[2]; $error = true; } $horario_rs = $stmt->fetchAll(); $stmt->closeCursor(); $horario_hash = ""; foreach($horario_rs as $horario){//crea objeto json $tipo = 0; if(isset($horario["TipoSubmateria_id"]) && $horario["TipoSubmateria_id"] != "") $tipo = $horario["TipoSubmateria_id"]; $horario_hash .= $horario["Dia_id"].substr($horario["Horario_hora"], 0, 5).$horario["Materia_id"].$horario["Horario_duracion"].fechaSlash($horario["fecha_inicial"]).fechaSlash($horario["fecha_final"]).$tipo; } if(!$error){ $return["reload"] = !(md5($horario_hash) == $str_check); $return["compare"] = md5($horario_hash)." == ".$str_check; } }else{ $return["reload"] = false; $return["error"] = "No se recibieron los parámetros esperados."; } $return["json"] = json_encode($return); echo json_encode($return); ?>