<?php
session_start();

// Asegúrate de que el ID del evaluador esté en la sesión
$evaluador_id = isset($_SESSION['usuario']['id']) ? $_SESSION['usuario']['id'] : null;

if (!$evaluador_id) {
    header("Location: ../../index.php");
    exit; // Asegúrate de detener la ejecución del script después de redirigir
}
?>
<div class="modal fade" id="evaluarResumenModal" tabindex="-1" aria-labelledby="guardarCalificaciones" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header bg-primary text-white">
        <h5 class="modal-title" id="evaluarResumenModalLabel">
          <i class="bi bi-bar-chart-line"></i> Evaluar Resumen
        </h5>
        <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body">
        <form id="formularioCalificaciones" onsubmit="guardarCalificaciones(event)">
          <input type="hidden" name="id" id="idresumen" />
          
          <!-- Resumen -->
          <div class="row">
            <div class="col-md-6">
              <!-- Detalles del resumen -->
              <div class="mb-3">
                <label for="codigo" class="form-label"><i class="bi bi-code"></i> Código</label>
                <input type="text" class="form-control" id="codigo" name="codigo" readonly />
              </div>
              <div class="mb-3">
                <label for="tipo_competicion" class="form-label"><i class="bi bi-card-text"></i> Tipo de Competición</label>
                <input type="text" class="form-control" id="tipo_competicion" name="tipo_competicion" readonly />
              </div>
              <div class="mb-3">
                <label for="tipo_presentacion" class="form-label"><i class="bi bi-card-text"></i> Tipo de Presentación</label>
                <input type="text" class="form-control" id="tipo_presentacion" name="tipo_presentacion" readonly />
              </div>
              <div class="mb-3">
                <label for="titulo" class="form-label"><i class="bi bi-card-text"></i> Título</label>
                <input type="text" class="form-control" id="titulo" name="titulo" readonly />
              </div>
              <div class="mb-3">
                <label for="introduccion" class="form-label"><i class="bi bi-card-text"></i> Introducción</label>
                <textarea class="form-control" id="introduccion" name="introduccion" readonly rows="3"></textarea>
              </div>
              <div class="mb-3">
                <label for="materiales" class="form-label"><i class="bi bi-card-text"></i> Materiales</label>
                <textarea class="form-control" id="materiales" name="materiales" readonly rows="3"></textarea>
              </div>
              <div class="mb-3">
                <label for="resultados" class="form-label"><i class="bi bi-card-text"></i> Resultados</label>
                <textarea class="form-control" id="resultados" name="resultados" readonly rows="3"></textarea>
              </div>
              <div class="mb-3">
                <label for="conclusiones" class="form-label"><i class="bi bi-card-text"></i> Conclusiones</label>
                <textarea class="form-control" id="conclusiones" name="conclusiones" readonly rows="3"></textarea>
              </div>
            </div>

            <!-- Calificaciones -->
            <div class="col-md-6">
              <!-- Evaluador 1 -->
              <div class="card mb-4" id="seccion-evaluador1">
                <div class="card-body">
                  <h5 class="card-title"><i class="bi bi-person-circle"></i> Evaluador 1: <span id="nombre_evaluador1"></span></h5>
                  <p><strong>Fecha de calificación:</strong> <span id="fecha-evaluador1">No disponible</span></p>

                  <div>
                    <label class="form-label">Clear Objectives(0-10):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion1_1" min="0" max="10" step="1" value="0" />
                      <span class="slider-value" id="valor1-1">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Appropriate Methodology(0-30):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion1_2" min="0" max="30" step="1" value="0" />
                      <span class="slider-value" id="valor1-2">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Clear Description of Results(0-20):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion1_3" min="0" max="20" step="1" value="0" />
                      <span class="slider-value" id="valor1-3">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Innovation(0-10):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion1_4" min="0" max="10" step="1" value="0" />
                      <span class="slider-value" id="valor1-4">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Applicability(0-10):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion1_5" min="0" max="10" step="1" value="0" />
                      <span class="slider-value" id="valor1-5">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Relevance & Usefulness(0-20):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion1_6" min="0" max="20" step="1" value="0" />
                      <span class="slider-value" id="valor1-6">0</span>
                    </div>
                  </div>

                  <!-- Total -->
                  <div class="mt-3">
                    <strong>Total:</strong> <span id="total-evaluador1">0</span>
                  </div>
                </div>
              </div>

              <!-- Evaluador 2 -->
              <div class="card mb-4" id="seccion-evaluador2">
                <div class="card-body">
                  <h5 class="card-title"><i class="bi bi-person-circle"></i> Evaluador 2: <span id="nombre_evaluador2"></span></h5>
                  <p><strong>Fecha de calificación:</strong> <span id="fecha-evaluador2">No disponible</span></p>

                  <div>
                    <label class="form-label">Clear Objectives(0-10):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion2_1" min="0" max="10" step="1" value="0" />
                      <span class="slider-value" id="valor2-1">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Appropriate Methodology(0-30):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion2_2" min="0" max="30" step="1" value="0" />
                      <span class="slider-value" id="valor2-2">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Clear Description of Results(0-20):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion2_3" min="0" max="20" step="1" value="0" />
                      <span class="slider-value" id="valor2-3">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Innovation(0-10):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion2_4" min="0" max="10" step="1" value="0" />
                      <span class="slider-value" id="valor2-4">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Applicability(0-10):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion2_5" min="0" max="10" step="1" value="0" />
                      <span class="slider-value" id="valor2-5">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Relevance & Usefulness(0-20):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion2_6" min="0" max="20" step="1" value="0" />
                      <span class="slider-value" id="valor2-6">0</span>
                    </div>
                  </div>

                  <!-- Total -->
                  <div class="mt-3">
                    <strong>Total:</strong> <span id="total-evaluador2">0</span>
                  </div>
                </div>
              </div>

              <!-- Evaluador 3 -->
              <div class="card mb-4" id="seccion-evaluador3">
                <div class="card-body">
                  <h5 class="card-title"><i class="bi bi-person-circle"></i> Evaluador 3: <span id="nombre_evaluador3"></span></h5>
                  <p><strong>Fecha de calificación:</strong> <span id="fecha-evaluador3">No disponible</span></p>

                  <div>
                    <label class="form-label">Clear Objectives(0-10):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion3_1" min="0" max="10" step="1" value="0" />
                      <span class="slider-value" id="valor3-1">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Appropriate Methodology(0-30):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion3_2" min="0" max="30" step="1" value="0" />
                      <span class="slider-value" id="valor3-2">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Clear Description of Results(0-20):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion3_3" min="0" max="20" step="1" value="0" />
                      <span class="slider-value" id="valor3-3">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Innovation(0-10):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion3_4" min="0" max="10" step="1" value="0" />
                      <span class="slider-value" id="valor3-4">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Applicability(0-10):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion3_5" min="0" max="10" step="1" value="0" />
                      <span class="slider-value" id="valor3-5">0</span>
                    </div>
                  </div>

                  <div>
                    <label class="form-label">Relevance & Usefulness(0-20):</label>
                    <div class="slider-container">
                      <input type="range" class="form-range" id="calificacion3_6" min="0" max="20" step="1" value="0" />
                      <span class="slider-value" id="valor3-6">0</span>
                    </div>
                  </div>

                  <!-- Total -->
                  <div class="mt-3">
                    <strong>Total:</strong> <span id="total-evaluador3">0</span>
                  </div>
                </div>
              </div>

            </div>
          </div>

          <!-- Botón de envío -->
          <button type="submit" class="btn btn-primary">Guardar Calificaciones</button>
        </form>
      </div>
    </div>
  </div>
</div>
