예제 #1
0
     $am->access(PERMS_OPERATOR);
     $result = $clubes->insert();
     break;
 case "update":
     $am->access(PERMS_OPERATOR);
     $result = $clubes->update($idclub);
     break;
 case "delete":
     $am->access(PERMS_OPERATOR);
     $result = $clubes->delete($idclub);
     break;
 case "select":
     $result = $clubes->select();
     break;
 case "selectbyid":
     $result = $clubes->selectByID($idclub);
     break;
 case "enumerate":
     $result = $clubes->enumerate();
     break;
 case "countries":
     $c = new Country();
     $result = $c->enumerate();
     break;
 case "getlogo":
     // not a json function; just return an image
     $result = $clubes->getLogo($idclub);
     return;
 case "setlogo":
     $am->access(PERMS_OPERATOR);
     // this call provides an image in base64 encoded format. Needs special handling
 function printClub($id)
 {
     $y = $this->GetY();
     // retrieve club data
     $cmgr = new Clubes('printCatalogo', $this->prueba->RSCE);
     $club = $cmgr->selectByID($id);
     $fedName = $this->federation->get('Name');
     // evaluate logo
     $icon = getIconPath($fedName, "agilitycontest.png");
     if ($club['Logo'] === "") {
         $this->myLogger->error("inscritosByPrueba::printClub() club:{$id} {$club['Nombre']} no logo declared");
         $icon = getIconPath($fedName, $this->federation->get('Logo'));
         // default is federation logo
     } else {
         $icon = $icon = getIconPath($fedName, $club['Logo']);
     }
     $this->myLogger->trace("ID:" . $id . " Club: " . $club['Nombre']);
     $this->ac_SetFillColor($this->config->getEnv('pdf_hdrbg1'));
     // azul
     $this->ac_SetTextColor($this->config->getEnv('pdf_hdrfg1'));
     // blanco
     $this->ac_SetDrawColor($this->config->getEnv('pdf_linecolor'));
     // line color
     $this->SetLineWidth(0.3);
     // ancho de linea
     // pintamos logo
     $this->SetXY(10, $y);
     $this->Cell(22, 22, '', 'LTB', 0, 'C', false);
     $this->Image($icon, 12, 2 + $y, 18, 18);
     // pintamos info del club
     $this->SetFont($this->getFontName(), 'B', 9);
     $this->SetXY(32, $y);
     $this->Cell(50, 5, $club['Direccion1'], 'LT', 0, 'L', true);
     // pintamos direccion1
     $this->SetXY(32, 5 + $y);
     $this->Cell(50, 5, $club['Direccion2'], 'L', 0, 'L', true);
     // pintamos direccion2
     $this->SetXY(32, 10 + $y);
     $prov = $club['Provincia'];
     if ($prov === "-- Sin asignar --") {
         $prov = "";
     }
     $this->Cell(50, 5, $prov, 'L', 0, 'L', true);
     // pintamos provincia
     $this->SetFont($this->getFontName(), 'IB', 24);
     $this->SetXY(82, $y);
     $this->Cell(110, 15, $club['Nombre'], 'T', 0, 'R', true);
     // pintamos Nombre
     $this->Cell(10, 15, '', 'TR', 0, 'R', true);
     // caja vacia de relleno
     // pintamos cabeceras de la tabla
     $this->ac_SetFillColor($this->config->getEnv('pdf_hdrbg2'));
     // gris
     $this->ac_SetTextColor($this->config->getEnv('pdf_hdrfg2'));
     // negro
     $this->SetFont($this->getFontName(), 'B', 9);
     $this->SetXY(32, 15 + $y);
     $this->Cell($this->width[0], 7, _('Name'), 'LTB', 0, 'C', true);
     $this->Cell($this->width[1], 7, _('Breed'), 'LTB', 0, 'C', true);
     if ($this->width[2] != 0) {
         // skip license on international contests
         $this->Cell($this->width[2], 7, _('License'), 'LTB', 0, 'C', true);
     }
     $this->Cell($this->width[3], 7, _('Cat') . '/' . _('Grade'), 'LTB', 0, 'C', true);
     $this->Cell($this->width[4], 7, _('Handler'), 'LTBR', 0, 'C', true);
     // print names of each declared journeys
     for ($i = 5; $i < count($this->width); $i++) {
         // en la cabecera texto siempre centrado
         if ($this->width[$i] == 0) {
             continue;
         }
         $this->Cell($this->width[$i], 7, $this->cellHeader[$i - 5], 1, 0, 'C', true);
     }
     $this->Ln();
 }
예제 #3
0
 /**
  * Anyade una pagina con informacion de la prueba y de las jornadas
  * @param $prueba
  * @param $jornadas
  */
 function createPruebaInfoPage($prueba, $jornadas)
 {
     // Create page
     $ppage = $this->myWriter->addNewSheetAndMakeItCurrent();
     $name = $this->normalizeSheetName($prueba['Nombre']);
     $ppage->setName($name);
     // cabecera de la tabla
     $prbHdr = array("", _utf('Name'), _utf('Club'), _utf('Federation'), _utf('Selective'), _utf('Comments'));
     $this->myWriter->addRowWithStyle($prbHdr, $this->rowHeaderStyle);
     // componemos informacion de la prueba
     $row = array();
     $row[] = _utf('Contest') . ':';
     $row[] = $prueba['Nombre'];
     // extract club info
     $clbObj = new Clubes("common_writer");
     $club = $clbObj->selectByID($prueba['Club']);
     $row[] = $club['Nombre'];
     // extract federation info
     $row[] = $this->federation->get('Name');
     // add extra parameters
     $row[] = $prueba['Selectiva'];
     $row[] = $prueba['Observaciones'];
     // and print Prueba data
     $this->myWriter->addRow($row);
     // anyadimos ahora informacion de las jornadas
     $this->myWriter->addRow(array(""));
     $jrdHdr = array("", _utf('Name'), _utf('Date'), _utf('Hour'), _utf('Closed'), "");
     $this->myWriter->addRowWithStyle($jrdHdr, $this->rowHeaderStyle);
     foreach ($jornadas as $jornada) {
         if ($jornada['Nombre'] === '-- Sin asignar --') {
             continue;
         }
         // skip empty journeys
         $row = array();
         $row[] = _utf('Journey') . ": " . $jornada['Numero'];
         $row[] = $jornada['Nombre'];
         $row[] = $jornada['Fecha'];
         $row[] = $jornada['Hora'];
         $row[] = $jornada['Cerrada'];
         if ($jornada['Observaciones'] != null && $jornada['Observaciones'] !== "(sin especificar)") {
             $row[] = $jornada['Observaciones'];
             // add name for special rounds
         }
         $this->myWriter->addRow($row);
     }
 }