예제 #1
0
 /**
  * Constructor
  * @param {int} $prueba Prueba ID
  * @throws Exception
  */
 function __construct($prueba)
 {
     parent::__construct("clasifications.xlsx");
     setcookie('fileDownload', 'true', time() + 30, "/");
     // tell browser to hide "downloading" message box
     $p = new Pruebas("excel_Clasificaciones");
     $res = $p->selectByID($prueba);
     if (!is_array($res)) {
         $this->errormsg = "excel_Clasificaciones: getPruebaByID({$prueba}) failed";
         throw new Exception($this->errormsg);
     }
     $this->prueba = $res;
     $j = new Jornadas("excel_Clasificaciones", $prueba);
     $res = $j->selectByPrueba();
     if (!is_array($res)) {
         $this->errormsg = "excel_Clasificaciones: getJornadasByPrueba({$prueba}) failed";
         throw new Exception($this->errormsg);
     }
     $this->jornadas = $res['rows'];
     // to get mode in trs evaluation
     $this->federation = Federations::getFederation($this->prueba['RSCE']);
     $this->jdbObject = new Jueces("excelClasification");
 }
        }
        // Línea de cierre
        $this->Cell(array_sum($this->pos), 0, '', 'T');
        $this->myLogger->leave();
    }
}
// Consultamos la base de datos
try {
    $pruebaid = http_request("Prueba", "i", 0);
    $jornadaid = http_request("Jornada", "i", 0);
    $mode = http_request("Mode", "i", 0);
    $pdf = null;
    $name = "";
    // Datos de inscripciones
    $jmgr = new Jornadas("printInscritosByPrueba", $pruebaid);
    $jornadas = $jmgr->selectByPrueba();
    $inscripciones = new Inscripciones("printInscritosByPrueba", $pruebaid);
    $inscritos = $inscripciones->enumerate();
    // Creamos generador de documento
    switch ($mode) {
        case 0:
            $pdf = new PrintInscritos($pruebaid, $inscritos, $jornadas);
            break;
        case 1:
            $pdf = new PrintCatalogo($pruebaid, $inscritos, $jornadas);
            break;
        case 2:
            $pdf = new PrintEstadisticas($pruebaid, $inscritos, $jornadas);
            break;
        case 3:
            $pdf = new PrintInscritosByJornada($pruebaid, $inscritos, $jornadas, $jornadaid);
예제 #3
0
 switch ($operation) {
     // there is no need of "insert" method: every prueba has 8 "hard-linked" jornadas
     case "delete":
         $am->access(PERMS_OPERATOR);
         $result = $jornadas->delete($jornadaid);
         break;
     case "close":
         $am->access(PERMS_OPERATOR);
         $result = $jornadas->close($jornadaid);
         break;
     case "update":
         $am->access(PERMS_OPERATOR);
         $result = $jornadas->update($jornadaid);
         break;
     case "select":
         $result = $jornadas->selectByPrueba();
         break;
     case "getbyid":
         $result = $jornadas->selectByID($jornadaid);
         break;
     case "enumerate":
         $result = $jornadas->searchByPrueba($allowClosed, $hideUnassigned);
         break;
     case "rounds":
         $result = $jornadas->roundsByJornada($jornadaid);
         break;
     case "enumerateMangasByJornada":
         $result = Jornadas::enumerateMangasByJornada($jornadaid);
         break;
     case "enumerateRondasByJornada":
         $result = Jornadas::enumerateRondasByJornada($jornadaid);