public static function changeState()
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     $concurso = new Concurso();
     if (get_class($_SESSION["user"]) != "Administrador" || $concurso->getEstado() == 3) {
         header("Location: ../view/403.php");
         exit;
     }
     $estadoActual = $concurso->getEstado();
     $estadoActual++;
     switch ($estadoActual) {
         case 1:
             $concurso->setFinalistas($_POST["num"]);
             break;
         case 2:
             $num = $_POST["num"];
             $concurso->setGanadorProfesional($num);
             $concurso->setGanadorPopular($num);
             break;
     }
     $concurso->setEstado($estadoActual);
     header("Location: ../view/view_admin_concurso.php");
 }
Exemple #2
0
 public static function votacionProfesionalParaGanador()
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     $concurso = new Concurso();
     if (get_class($_SESSION["user"]) != "JuradoProfesional" || $concurso->getEstado() != 1) {
         header("Location: ../view/403.php");
         exit;
     }
     if ($_POST["pincho"] && $_POST["puntuacion"]) {
         $return = $_SESSION["user"]->votacionFinalista($_POST["pincho"], $_POST["puntuacion"]);
         if ($return) {
             header("Location: ../view/view_votacionprofesionalfinal.php");
         } else {
             echo "Error BD votacionprofesionalparaganador_controller.php";
         }
     }
 }
    <!-- PINCHOS -->
    <section id="pinchos">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <div class="section-title">
                        <a href="view_administrar.php"><div class="back-button"></div></a><h1><?php 
echo $l["view_admin_infoManage"];
?>
</h1>
                        <span class="st-border"></span>
                    </div>
                </div>
                <?php 
$concurso = new Concurso();
$estado = $concurso->getEstado();
?>
                <div class="col-md-12 competition-state">
                    <?php 
switch ($estado) {
    case 0:
        echo "<h3>" . $l["view_admin_1"] . "</h3>";
        echo '<div class="progress progress-striped active">';
        echo '<div class="progress-bar" style="width: 33%"></div>';
        echo '</div>';
        echo '<button type="button" class="btn btn-primary btn-sm pull-right" data-toggle="modal" data-target="#limit">' . $l["view_admin_1_bt"] . '</button>';
        break;
    case 1:
        echo "<h3>" . $l["view_admin_2"] . "</h3>";
        echo '<div class="progress progress-striped active">';
        echo '<div class="progress-bar" style="width: 66%"></div>';