function actualizar_preguntas($id, $pregunta, $cuestionario) { require "DAT/DATpreguntas.php"; $preguntaa = new pregunta(); $preguntaa->__construct3($id, $pregunta, $cuestionario); $resultado = preguntas_upd($preguntaa->get_id(), $preguntaa->get_preguntas(), $preguntaa->get_id_cuestionario()); }
function listar($id_enc) { $consulta = "SELECT id_pre FROM pregunta WHERE id_enc = '" . $id_enc . "'"; $mysqli = conectar(); $r = NULL; $resultado = $mysqli->query($consulta); if ($resultado) { while ($fila = $resultado->fetch_assoc()) { $r[] = $fila['id_pre']; } } $mysqli->close(); $preguntas = NULL; echo '<form method="POST" action="encuestar.php" onsubmit="return validar()">' . "\n"; echo '<input id="button" type="hidden" name=encuesta value="' . $id_enc . '">'; for ($i = 0; $i < count($r); $i++) { $P = new pregunta(); $P->instanciar($r[$i], $id_enc); $preguntas[] = $P; $P->mostrarPreguntas(); } echo '<input id="button" type="submit" name="votar" value="Votar"></form>' . "\n"; return $preguntas; }
echo '<input type="hidden" value="' . $fila['id_enc'] . '" name="encuesta">'; echo '<input id="button" type="submit" value="' . $fila['titulo'] . '"></form>' . "\n</div>"; $noRespuestas = false; } } if ($noRespuestas) { ?> <div id="divError"> <label id="labelError">Error: Usted no tiene ninguna encuesta disponible para responder</label> </div> <?php session_destroy(); } $mysqli->close(); } else { $preguntas = new pregunta(); $preguntas->listar($_POST['encuesta']); } } else { ?> <div id="divError"> <label id="labelError">Error: Debe identificarse para poder ver las Encuestas Disponibles</label> </div> <?php } ?> <br><br><br> </div> <?php