/** * Constructor * @throws Exception */ function __construct($federation) { date_default_timezone_set('Europe/Madrid'); parent::__construct('Portrait', "print_listaPerros", 1, 0); // use default prueba. not really needed $d = new Dogs("print_listaPerros"); $res = $d->select(); if (!is_array($res)) { $this->errormsg = "print_listaPerros: select() failed"; throw new Exception($this->errormsg); } $this->lista = $res['rows']; // rework federation handling as parent got it from senseless prueba ID $this->federation = Federations::getFederation(intval($federation)); $this->strClub = $this->federation->isInternational() ? _('Country') : _('Club'); $this->icon = getIconPath($this->federation->get('Name'), "agilitycontest.png"); $this->icon2 = getIconPath($this->federation->get('Name'), $this->federation->get('Logo')); $this->cols[8] = $this->strClub; // use "country" or "club" according federation if ($this->federation->get('WideLicense') == true) { // on wide license hide loe/rrc $this->pos[3] += $this->pos[4]; $this->pos[4] = 0; $this->pos[3] += 5; // decrease handler name $this->pos[7] -= 5; } }
} ?> <table> <tr> <th>Flag</th> <th>Code</th> <th>Name</th> </tr> <?php foreach ($languageOptions as $lang) { ?> <tr> <td><img src="<?php echo getIconPath($lang["language"]); ?> "></td> <td><?php echo $lang["language"]; ?> </td> <td><?php echo $lang["display"]; ?> </td> </tr> <?php } ?> </table>
} if (!empty($strtmp)) { $db = DB_GetConnection(); $sql = "select * from vw_item where item_name like '%" . $s . "%' order by item_name"; $items = $db->query($sql); $sql = "select * from quest where quest_name like '%" . $s . "%' order by quest_name"; $quests = $db->query($sql); $db->close(); $skin = new skin("search_result.skn"); $box->token("SEARCH_VALUE", $s); $skin->token("SEARCH_BOX", $box->html); $skin->token("NUM_ITEMS", $items->num_rows); $skin->token("NUM_QUESTS", $quests->num_rows); for ($r = 0; $r < $items->num_rows; $r++) { $d = $items->fetch_assoc(); $icon = getIconPath($d["itemdisplay_icon"]); $skin->addRow("items", buildItemLink($d), $d["item_reqLevel"], $icon); } $skin->flushRows("items"); for ($r = 0; $r < $quests->num_rows; $r++) { $d = $quests->fetch_assoc(); $url = sprintf("quest.php?i=%s", $d["quest_id"]); $skin->addRow("quests", $d["quest_name"], $url); } $skin->flushRows("quests"); $skin->dump(); } else { $box->token("SEARCH_VALUE", ""); $skin = new skin("adv_search.skn"); $skin->token("STUFF", $box->html); $skin->dump();
function printTeamInformation($rowcount, $team) { $fed = $this->federation->get('Name'); $nl = getIconPath($fed, 'null.png'); // evaluate logos $logos = array($nl, $nl, $nl, $nl); if ($team['Nombre'] === "-- Sin asignar --") { $logos[0] = getIconPath($fed, 'agilitycontest.png'); } else { $count = 0; foreach ($team['Perros'] as $miembro) { $logo = getIconPath($fed, $miembro['LogoClub']); if (!in_array($logo, $logos) && $count < 4) { $logos[$count++] = $logo; } } } $this->SetXY(10, 45 + 5 * $rowcount); $this->ac_header(1, 17); $this->Image($logos[0], $this->getX(), $this->getY(), 9); $this->Image($logos[1], $this->getX() + 10, $this->getY(), 9); $this->Image($logos[2], $this->getX() + 20, $this->getY(), 9); $this->Image($logos[3], $this->getX() + 30, $this->getY(), 9); $this->SetX($this->GetX() + 40); $this->Cell(140, 9, $team['Nombre'], 'T', 0, 'R', true); $this->Cell(10, 9, '', 'TR', 0, 'R', true); // empty space at right of page $this->Ln(); $this->ac_header(2, 8); for ($i = 0; $i < count($this->cellHeader); $i++) { // en la cabecera texto siempre centrado $this->Cell($this->pos[$i], 6, $this->cellHeader[$i], 1, 0, 'C', true); } $this->ac_row(2, 9); $this->Ln(); $rowcount += 3; return $rowcount; }
function printTeamInformation($teamcount, $numrows, $team) { // evaluate logos $logos = array('null.png', 'null.png', 'null.png', 'null.png'); if ($team['Nombre'] === "-- Sin asignar --") { $logos[0] = getIconPath($this->federation->get('Name'), "agilitycontest.png"); } else { $count = 0; for ($n = 0; $n < count($team['Perros']); $n++) { $miembro = $team['Perros'][$n]['Perro']; $logo = $this->getLogoName(intval($miembro)); if (!in_array($logo, $logos) && $count < 4) { $logos[$count++] = $logo; } } } $offset = $this->PageNo() == 1 ? 60 : 40; $this->SetXY(10, $offset + 33 * ($teamcount % $numrows)); $this->ac_header(1, 18); $this->Cell(15, 8, strval(1 + $teamcount) . " -", 'LT', 0, 'C', true); // imprime puesto del equipo $x = $this->getX(); $y = $this->getY(); for ($n = 0; $n < $this->getMinDogs(); $n++) { if ($logos[$n] === "null.png") { $this->SetX($x + 10 * $n); $this->Cell(10, 8, "", 'T', 0, 'C', true); } else { $this->Image($logos[$n], $x + 10 * $n, $y, 8); } } $this->SetX($x + 40); $this->Cell(212, 8, $team['Nombre'], 'T', 0, 'R', true); $this->Cell(8, 8, '', 'TR', 0, 'R', true); // empty space at right of page $this->Ln(); }
/** * Checks for an image icon and returns a complete image tag or a text * string with the text icon based on what is found and user prefs. * * @param string $icon_theme_path User's chosen icon set * @param string $icon_name File name of the desired icon * @param string $text_icon Text-based icon to display if desired * @param string $alt_text Text for alt/title attribute of image * @param integer $w Optional. Width of requested image. * @param integer $h Optional. Height of requested image. * * @return string $icon String containing icon that can be echo'ed * * @author Steve Brown * @since 1.5.2 */ function getIcon($icon_theme_path, $icon_name, $text_icon, $alt_text, $w = NULL, $h = NULL) { $icon = ''; if (is_null($icon_theme_path)) { $icon = $text_icon; } else { $icon_path = getIconPath($icon_theme_path, $icon_name); // If we found an icon, build an img tag to display it. If we didn't // find an image, we will revert back to the text icon. if (!is_null($icon_path)) { $icon = create_image($icon_path, $alt_text, $w, $h, '', '', '', '', $alt_text, '', '', '', $text_icon); } else { $icon = $text_icon; } } return $icon; }
function printTeamInfo($rowcount, $index, $team) { // valores por defecto $team['Faltas'] = 0; $team['Tocados'] = 0; $team['Rehuses'] = 0; $team['Eliminados'] = 0; $team['NoPresentados'] = 0; $members = $team['Resultados']; // evaluate logos $logos = array('null.png', 'null.png', 'null.png', 'null.png'); if ($team['Nombre'] === "-- Sin asignar --") { $logos[0] = getIconPath($this->federation->get('Name'), "agilitycontest.png"); } else { $count = 0; foreach ($members as $miembro) { $logo = $this->getLogoName($miembro['Perro']); if (!in_array($logo, $logos) && $count < 4) { $logos[$count++] = $logo; } } } // posicion de la celda $y = 58 + 16 * $rowcount; $this->SetXY(10, $y); // caja de datos de perros $this->ac_header(2, 16); $this->Cell(12, 14, 1 + $index, 'LTB', 0, 'C', true); $this->Cell(48, 14, "", "TBR", 0, 'C', true); $this->SetY($y + 1); $this->ac_header(2, 16); foreach ($members as $id => $perro) { // imprimimos datos del perro $this->SetX(22); $this->ac_row($id, 8); $this->Cell(6, 3, $perro['Dorsal'], 'LTBR', 0, 'L', true); $this->SetFont($this->getFontName(), 'B', 8); $this->Cell(13, 3, $perro['Nombre'], 'LTBR', 0, 'C', true); $this->SetFont($this->getFontName(), '', 7); $this->Cell(28, 3, $perro['NombreGuia'], 'LTBR', 0, 'R', true); $this->Ln(3); // sumamos faltas, tocados y rehuses $team['Faltas'] += $perro['Faltas']; $team['Tocados'] += $perro['Tocados']; $team['Rehuses'] += $perro['Rehuses']; $team['Eliminados'] += $perro['Eliminado']; $team['NoPresentados'] += $perro['NoPresentado']; } for ($n = count($members); $n < $this->mindogs; $n++) { $team['NoPresentados']++; } // caja de datos del equipo $this->SetXY(70, $y); $this->ac_header(1, 14); $this->Cell(128, 14, "", "LTBR", 0, 'C', true); $x = 70; for ($n = 0; $n < 4; $n++) { if ($logos[$n] === "null.png") { $this->SetX($x + 7 * $n); $this->Cell(7, 7, "", 'T', 0, 'C', true); } else { $this->Image($logos[$n], $x + 7 * $n, $y, 7); } } $this->SetX(98); $this->Cell(92, 5, $team['Nombre'], '', 0, 'R', true); $this->Cell(6, 5, '', '', 0, '', true); // empty space at right of page $this->Ln(); // caja de faltas/rehuses/tiempos $this->ac_SetFillColor("#ffffff"); // white background $this->SetXY(71, 7 + $y); $this->Cell(15, 6, "", 'R', 0, 'L', true); $this->Cell(15, 6, "", 'R', 0, 'L', true); $this->Cell(15, 6, "", 'R', 0, 'L', true); $this->Cell(15, 6, "", 'R', 0, 'L', true); $this->Cell(15, 6, "", 'R', 0, 'L', true); $this->Cell(25, 6, "", 'R', 0, 'L', true); $this->Cell(26, 6, "", 'R', 0, 'L', true); $this->ac_SetFillColor("#c0c0c0"); // light gray $this->SetXY(71, 7 + $y + 1); $this->SetFont($this->getFontName(), 'I', 8); // italic 8px $this->Cell(15, 2.5, _("Flt"), 0, 0, 'L', false); $this->Cell(15, 2.5, _("Ref"), 0, 0, 'L', false); $this->Cell(15, 2.5, _("Tch"), 0, 'L', false); $this->Cell(15, 2.5, _("Elim"), 0, 'L', false); $this->Cell(15, 2.5, _("N.P."), 0, 'L', false); $this->Cell(25, 2.5, _("Time"), 0, 0, 'L', false); $this->Cell(26, 2.5, _("Penaliz"), 0, 0, 'L', false); $this->SetXY(71, 6 + $y + 1); $this->SetFont($this->getFontName(), 'B', 10); // italic 8px $this->Cell(15, 7, $team['Faltas'], 0, 0, 'R', false); $this->Cell(15, 7, $team['Rehuses'], 0, 0, 'R', false); $this->Cell(15, 7, $team['Tocados'], 0, 0, 'R', false); $this->Cell(15, 7, $team['Eliminados'], 0, 0, 'R', false); $this->Cell(15, 7, $team['NoPresentados'], 0, 0, 'R', false); $this->Cell(25, 7, number_format($team['Tiempo'], $this->timeResolution), 0, 0, 'R', false); $this->Cell(26, 7, number_format($team['Penalizacion'], $this->timeResolution), 0, 0, 'R', false); }
function printTeamInfo($rowcount, $index, $team, $members) { // evaluate logos $logos = array('null.png', 'null.png', 'null.png', 'null.png'); if ($team['Nombre'] === "-- Sin asignar --") { $logos[0] = getIconPath($this->federation->get('Name'), "agilitycontest.png"); } else { $count = 0; foreach ($members as $miembro) { $logo = $this->getLogoName($miembro['Perro']); if (!in_array($logo, $logos) && $count < 4) { $logos[$count++] = $logo; } } } // posicion de la celda $y = 45 + 22 * $rowcount; $this->SetXY(10, $y); // caja de datos de perros $this->ac_header(1, 16); $this->Cell(12, 18, 1 + $index, 'LTBR', 0, 'C', true); $this->ac_header(2, 16); $this->Cell(103, 18, "", "TB", 0, 'C', true); $this->SetY($y + 1); foreach ($members as $id => $perro) { $this->SetX(23); $this->ac_row($id, 8); $this->Cell(6, 4, $perro['Dorsal'], 'LTBR', 0, 'L', true); $this->SetFont($this->getFontName(), 'B', 8); $this->Cell(13, 4, $perro['Nombre'], 'LTBR', 0, 'C', true); $this->SetFont($this->getFontName(), '', 7); $this->Cell(20, 4, $perro['Raza'], 'LTBR', 0, 'R', true); $this->SetFont($this->getFontName(), '', 7); $this->Cell(15, 4, $this->getCatString($perro['Categoria']), 'LTBR', 0, 'C', true); $this->SetFont($this->getFontName(), '', 7); $this->Cell(27, 4, $perro['NombreGuia'], 'LTBR', 0, 'R', true); $this->SetFont($this->getFontName(), '', 7); $this->Cell(20, 4, $perro['NombreClub'], 'LTBR', 0, 'R', true); $this->Ln(4); } // caja de datos del equipo $this->SetXY(125, $y); $this->ac_header(2, 14); $this->Cell(65, 7, $team['Nombre'], 'TB', 0, 'R', true); $this->Cell(10, 7, '', 'TRB', 0, '', true); // empty space at right of page $this->SetXY(125, 7 + $y); $this->Image($logos[0], $this->getX(), $this->getY(), 11); $this->Image($logos[1], $this->getX() + 11, $this->getY(), 11); $this->Image($logos[2], $this->getX() + 22, $this->getY(), 11); $this->Image($logos[3], $this->getX() + 33, $this->getY(), 11); $this->Ln(11); }
getLogo.php Copyright 2013-2016 by Juan Antonio Martinez ( juansgaviota at gmail dot com ) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /** * tool to retrieve an image from server by providing federation and canonical name */ require_once __DIR__ . "/../../server/tools.php"; require_once __DIR__ . "/../../modules/Federations.php"; $fed = http_request("Fed", "i", http_request("Federation", "i", 0)); $logo = http_request("Logo", "s", "null.png"); $fedname = Federations::getFederation(intval($fed))->get('Name'); $iconpath = getIconPath($fedname, $logo); $image = imagecreatefromstring(file_get_contents($iconpath)); imagealphablending($image, false); // preserve transparency imagesavealpha($image, true); header('Content-Type: image/png'); imagepng($image); imagedestroy($image);
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(); }
<?php include "includes/common.php"; if (!empty($_REQUEST["i"])) { $id = $_REQUEST["i"]; } else { die("No spell specified!"); } //get item data $spell = DB_GetSpell($id); $d = $spell->fetch_assoc(); $skin = new skin("spell.skn"); $skin->token("SPELL_NAME", $d["spell_name"]); $skin->token("FINAL_TEXT", $d["spell_final_text"]); $p = strrpos($d["spellicon_icon"], "\\"); $icon = substr($d["spellicon_icon"], $p + 1); $skin->token("ICON_SRC", getIconPath($icon)); $skin->addRow("props", "Mana Cost", $d["spell_manacost"]); $skin->addRow("props", "Max Stack", $d["spell_stackamount"]); $skin->flushRows("props"); $skin->dump();
function printTeamInfo($rowcount, $index, $team, $members) { // evaluate logos $nullpng = getIconPath($this->federation->get('Name'), 'null.png'); $logos = array($nullpng, $nullpng, $nullpng, $nullpng); if ($team['Nombre'] === "-- Sin asignar --") { $logos[0] = getIconPath($this->federation->get('Name'), 'agilitycontest.png'); } else { $count = 0; foreach ($members as $miembro) { $logo = $this->getLogoName($miembro['Perro']); if (!in_array($logo, $logos) && $count < 4) { $logos[$count++] = $logo; } } } // posicion de la celda $y = 60 + 22 * $rowcount; $this->SetXY(10, $y); // caja de datos de perros $this->ac_header(2, 16); $this->Cell(12, 18, 1 + $index, 'LTB', 0, 'C', true); $this->Cell(48, 18, "", "TBR", 0, 'C', true); $this->SetY($y + 1); $this->ac_header(2, 16); foreach ($members as $id => $perro) { $this->SetX(22); $this->ac_row($id, 8); $this->Cell(6, 4, $perro['Dorsal'], 'LTBR', 0, 'L', true); $this->SetFont($this->getFontName(), 'B', 8); $this->Cell(13, 4, $perro['Nombre'], 'LTBR', 0, 'C', true); $this->SetFont($this->getFontName(), '', 7); $this->Cell(28, 4, $perro['NombreGuia'], 'LTBR', 0, 'R', true); $this->Ln(4); } // caja de datos del equipo $this->SetXY(70, $y); $this->ac_header(1, 14); $this->Cell(130, 18, "", "LTBR", 0, 'C', true); $this->SetXY(71, $y + 1); $this->Image($logos[0], $this->getX(), $this->getY(), 5); $this->Image($logos[1], $this->getX() + 5, $this->getY(), 5); $this->Image($logos[2], $this->getX() + 10, $this->getY(), 5); $this->Image($logos[3], $this->getX() + 15, $this->getY(), 5); $this->SetX($this->GetX() + 20); $this->Cell(100, 5, $team['Nombre'], '', 0, 'R', true); $this->Cell(8, 5, '', '', 0, '', true); // empty space at right of page $this->Ln(); // caja de faltas/rehuses/tiempos $this->ac_SetFillColor("#ffffff"); // white background $this->SetXY(71, 7 + $y); $this->Cell(49, 10, "", 'R', 0, 'L', true); $this->Cell(20, 10, "", 'R', 0, 'L', true); $this->Cell(15, 10, "", 'R', 0, 'L', true); $this->Cell(15, 10, "", 'R', 0, 'L', true); $this->Cell(29, 10, "", '', 0, 'L', true); $this->SetXY(71, 7 + $y + 1); $this->SetFont($this->getFontName(), 'I', 8); // italic 8px $this->Cell(49, 2.5, _("Faults"), 0, 0, 'L', false); $this->Cell(20, 2.5, _("Refusals"), 0, 0, 'L', false); $this->Cell(15, 2.5, _("Touchs"), 0, 'L', false); $this->Cell(15, 2.5, _("Eliminated"), 0, 'L', false); $this->Cell(29, 2.5, _("Time"), 0, 0, 'L', false); }
function printDataForm() { $this->myLogger->enter(); // tocamos la cabecera, eliminando datos de prueba y club $this->prueba->Nombre = ""; $this->club->Nombre = ""; $this->icon = getIconPath($this->federation->get('Name'), "agilitycontest.png"); // ahora empezamos a pintar $this->AddPage(); $this->ac_SetDrawColor($this->config->getEnv('pdf_linecolor')); $this->SetLineWidth(0.3); // indicamos nombre del operador que rellena la hoja $this->ac_header(2, 12); $this->Cell(90, 7, _('Record by') . ':', 'LTBR', 0, 'L', true); $this->Cell(10, 7, '', 0, 'L', false); $this->Cell(90, 7, _('Review by') . ':', 'LTBR', 0, 'L', true); $this->Ln(15); $wide = $this->federation->get('WideLicense'); // use long cell for license when required for ($rowcount = 0; $rowcount < 10; $rowcount++) { $this->ac_header(1, 20); // save cursor position $x = $this->getX(); $y = $this->GetY(); // fase 1: contenido de cada celda de la cabecera // Cell( width,height,message,border,cursor,align,fill) // pintamos logo $this->Cell(15, 19, '', 'LTBR', 0, 'L', false); $this->SetXY($x + 1, $y + 2); // restore cursor position $this->Image($this->icon, $this->getX() + 0.5, $this->getY(), 12); $this->SetX($this->GetX() + 12); // bordes cabecera de celda $this->ac_SetFillColor($this->config->getEnv('pdf_hdrbg1')); // color de fondo 2 $this->SetXY($x + 15, $y); // restore cursor position $this->SetFont($this->getFontName(), 'B', 10); // bold 10px $this->Cell(15, 6, '', 'LTR', 0, 'L', true); // dorsal $this->Cell(10, 6, '', 'TR', 0, 'L', true); // celo if ($wide) { $this->Cell(50, 6, '', 'TR', 0, 'L', true); // perro } else { $this->Cell(20, 6, '', 'TR', 0, 'L', true); // licencia $this->Cell(30, 6, '', 'TR', 0, 'L', true); // perro } $this->Cell(60, 6, '', 'TR', 0, 'L', true); // guia $this->Cell(40, 6, '', 'TR', 0, 'L', true); // club // titulos cabecera de celda ( no hay datos para pintar ) $this->SetXY($x + 15, $y); // restore cursor position $this->SetTextColor(0, 0, 0); // negro $this->SetFont($this->getFontName(), 'I', 8); // italic 8px $this->Cell(15, 4, _('Dorsal'), '', 0, 'L', false); // display order $this->Cell(10, 4, _('Heat'), '', 0, 'L', false); if ($wide) { $this->Cell(50, 4, _('Name'), '', 0, 'L', false); } else { $this->Cell(20, 4, _('Lic'), '', 0, 'L', false); $this->Cell(30, 4, _('Name'), '', 0, 'L', false); } $this->Cell(60, 4, _('Handler'), '', 0, 'L', false); $this->Cell(40, 4, $this->strClub, '', 0, 'L', false); // ahora pintamos zona de escritura de palotes $this->SetXY($x + 15, $y + 6); $this->Cell(60, 13, '', 'TRB', 0, '', false); // palotes faltas $this->Cell(40, 13, '', 'TRB', 0, '', false); // palotes rehuses $this->Cell(25, 13, '', 'TRB', 0, '', false); // palotes tocados $this->Cell(7, 13, '', 'TRB', 0, '', false); // total faltas $this->Cell(7, 13, '', 'TRB', 0, '', false); // total rehuses $this->Cell(7, 13, '', 'TRB', 0, '', false); // total tocados $this->Cell(29, 13, '', 'TRB', 0, '', false); // tiempo $this->SetXY($x + 15, $y + 6); $this->Cell(60, 5, _('Faults'), '', 0, 'L', false); $this->Cell(40, 5, _('Refusals'), '', 0, 'L', false); $this->Cell(25, 5, _('Touchs'), '', 0, 'L', false); $this->Cell(7, 5, _('Flt'), '', 0, 'C', false); $this->Cell(7, 5, _('Ref'), '', 0, 'C', false); $this->Cell(7, 5, _('Tch'), '', 0, 'C', false); $this->Cell(29, 5, _('Time'), '', 0, 'L', false); $this->Ln(15); } // LĂnea de cierre // $this->Cell(array_sum($this->pos),0,'','T'); $this->myLogger->leave(); }
/** * Gets the club logo based on Dog ID * @param {integer} $id Dog ID * @return {string} name of desired logo */ function getLogoName($id) { $row = $this->myDBObject->__selectObject("Logo", "Perros,Guias,Clubes", "(Perros.Guia=Guias.ID ) AND (Guias.Club=Clubes.ID) AND (Perros.ID={$id})"); if (!$row) { $this->myLogger->error("getLogoName(): no associated guia/club for Dog ID: {$id}"); return getIconPath($this->federation->get('Name'), $this->icon); } return getIconPath($this->federation->get('Name'), $row->Logo); }
function printTeamInformation($teamcount, $team) { // evaluate logos $logos = array('null.png', 'null.png', 'null.png', 'null.png'); if ($team['Nombre'] === "-- Sin asignar --") { $logos[0] = getIconPath($this->federation->get('Name'), "agilitycontest.png"); } else { $miembros = $this->eqmgr->getPerrosByTeam($team['ID']); $count = 0; for ($n = 0; $n < count($miembros); $n++) { $logo = getIconPath($this->federation->get('Name'), $miembros[$n]['LogoClub']); if (!in_array($logo, $logos) && $count < 4) { $logos[$count++] = $logo; } } } $offset = $this->PageNo() == 1 ? 57 : 45; $this->SetXY(10, $offset + 38 * ($teamcount % 6)); $this->ac_header(1, 18); $this->Cell(15, 10, strval(1 + $teamcount) . " -", 'LT', 0, 'C', true); // imprime puesto del equipo $x = $this->getX(); $y = $this->getY(); for ($n = 0; $n < 4; $n++) { if ($logos[$n] === "null.png") { $this->SetX($x + 10 * $n); $this->Cell(10, 10, "", 'T', 0, 'C', true); } else { $this->Image($logos[$n], $x + 10 * $n, $y, 10); } } $this->SetX($x + 40); $this->Cell(125, 10, $team['Nombre'], 'T', 0, 'R', true); $this->Cell(8, 10, '', 'TR', 0, 'R', true); // empty space at right of page $this->Ln(); $this->ac_header(2, 8); for ($i = 0; $i < count($this->cellHeader); $i++) { // en la cabecera texto siempre centrado. Si caza skip licencia if ($this->pos[$i] != 0) { $this->Cell($this->pos[$i], 5, $this->cellHeader[$i], 1, 0, 'C', true); } } $this->ac_row(2, 9); $this->Ln(); }
* User: jantonio * Date: 25/02/16 * Time: 11:25 */ require_once __DIR__ . "/../server/tools.php"; require_once __DIR__ . "/../server/pdf/print_common.php"; class PDFRotationText extends PrintCommon { function RotatedText($x, $y, $txt, $angle) { //Text rotated around its origin $this->Rotate($angle, $x, $y); $this->Text($x, $y, $txt); $this->Rotate(0); } function RotatedImage($file, $x, $y, $w, $h, $angle) { //Image rotated around its upper-left corner $this->Rotate($angle, $x, $y); $this->Image($file, $x, $y, $w, $h); $this->Rotate(0); } } $pdf = new PDFRotationText('Portrait', "prueba_rotacion", 0, 0); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Arial', '', 20); $pdf->RotatedImage(getIconPath(0, 'unregistered.png'), 85, 60, 40, 16, 45); $pdf->RotatedText(100, 60, 'Hello!', 45); $pdf->Output("pruebarotacion.pdf", "D"); // "D" means open download dialog
if (!empty($_REQUEST["i"])) { $id = $_REQUEST["i"]; } else { die("No item specified!"); } //get item data $item = DB_GetItem($id); $d = $item->fetch_assoc(); /* $thread_id = $d["item_thread_id"]; if($thread_id == 0) { $thread_id = saveThread(0, "User Comments"); $sql = sprintf("UPDATE item SET item_thread_id = %s WHERE item_id = %s", $thread_id, $id); $db = DB_GetConnection(); $db->query($sql); $db->close(); } */ $item = buildItemBox($d); $skin = new skin("item2.skn"); $skin->token("ITEM_NAME", $d["item_name"]); $skin->token("ITEM_BOX", $item); $skin->token("ICON_SRC", getIconPath($d["itemdisplay_icon"])); $skin->addRow("props", "Item ID", $id); $skin->addRow("props", "Item Level", $d["item_level"]); $skin->flushRows("props"); //User comments section //$skin->token("USER_COMMENTS", getThreadHtml($thread_id)); //$skin->token("ADD_COMMENT", getQuickReplyHtml($thread_id)); $skin->dump();
/** * Retorna el logo del club asociado al guia de id indicado * NOTA: esto no retorna una respuesta json, sino una imagen * @param {integer} $id perro id * @return "" on success; else error string */ function getLogoByGuia($id) { $this->myLogger->enter(); if ($id == 0) { $id = 1; } // on insert, select default logo $row = $this->__selectObject("Logo", "Guias,Clubes", "(Guias.Club=Clubes.ID) AND (Guias.ID={$id})"); if (!$row) { return $this->error($this->conn->error); } $name = $row->Logo; $fname = getIconPath($this->curFederation->get('Name'), $name); if (!file_exists($fname)) { $this->myLogger->notice("Logo file {$fname} does not exists"); $fname = getIconPath($this->curFederation->get('Name'), $this->curFederation->get('Logo')); // use default name } $size = getimagesize($fname); header('Content-Type: ' . $size['mime']); readfile($fname); return ""; }