Skip to content

Commit

Permalink
Add order number to 10-Assistant sheet page
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsito committed Dec 9, 2015
1 parent 6f33e20 commit 1f02c76
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions agility/server/pdf/print_entradaDeDatos.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ function Footer() {
/**
* @param {number} $rowcount
* @param {array} $row
* @param {integer} $orden . Starting order in their category
*/
function writeTableCell_compacto($row) {
function writeTableCell_compacto($row,$orden) {
$wide=$this->federation->get('WideLicense'); // if required use long cell for license
$logo=$this->getLogoName($row['Perro']);
$this->ac_header(1,20);
Expand All @@ -110,7 +111,11 @@ function writeTableCell_compacto($row) {
$this->Cell(15,19,'','LTBR',0,'L',false);
$this->SetXY($x+1,$y+2); // restore cursor position
$this->Image($logo,$this->getX()+0.5,$this->getY(),12);
$this->SetX($this->GetX()+12);
// pintamos numero de orden
$this->ac_header(2,12);
$this->SetXY($x+1,$y+13);
$this->Cell(14,5,$orden,'',0,'R',true);
$this->SetX($x+12,$y);

// bordes cabecera de celda
$this->ac_SetFillColor($this->config->getEnv('pdf_hdrbg1')); // color de fondo 2
Expand Down Expand Up @@ -179,8 +184,9 @@ function writeTableCell_compacto($row) {
* @param {number} $rowcount Row index
* @param {number} $row Row data
* @param {number} $f width factor (to be reused on extended print)
* @param {integer} $orden . Starting order in their category
*/
function writeTableCell_normal($row,$f=1) {
function writeTableCell_normal($row,$orden) {
// remember that this method is called iteratively ... so make sure first time license goes to zero
if ($this->federation->get('WideLicense')) {
$this->pos[1]+=$this->pos[2]; $this->pos[2]=0; // on wide license ID skip license info
Expand Down Expand Up @@ -253,8 +259,9 @@ function writeTableCell_normal($row,$f=1) {
/**
* @param {number} $rowcount
* @param {array} $row
* @param {integer} $orden . Startin order in their category
*/
function writeTableCell_extendido($row) {
function writeTableCell_extendido($row,$orden) {
$logo=$this->getLogoName($row['Perro']);
// cada celda tiene una cabecera con los datos del participante
$this->ac_SetFillColor($this->config->getEnv('pdf_hdrbg1')); // azul
Expand Down Expand Up @@ -389,6 +396,7 @@ function composeTable() {
$this->ac_SetDrawColor($this->config->getEnv('pdf_linecolor'));
$this->SetLineWidth(.3);
// Datos
$orden=1;
$rowcount=0;
foreach($this->orden as $row) {
// if change in categoria, reset orden counter and force page change
Expand All @@ -397,6 +405,7 @@ function composeTable() {
$this->categoria = $row['Categoria'];
// $this->Cell(array_sum($this->pos),0,'','T'); // linea de cierre de categoria
$rowcount=0;
$orden=1;
}
// REMINDER: $this->cell( width, height, data, borders, where, align, fill)
if( ($rowcount % $this->numrows) == 0 ) { // assume $numrows entries per page
Expand All @@ -411,11 +420,12 @@ function composeTable() {
}
}
switch($this->numrows) {
case 1: $this->writeTableCell_extendido($row);break;
case 5: $this->writeTableCell_normal($row);break;
case 10: $this->writeTableCell_compacto($row);break;
case 1: $this->writeTableCell_extendido($row,$orden);break;
case 5: $this->writeTableCell_normal($row,$orden);break;
case 10: $this->writeTableCell_compacto($row,$orden);break;
}
$rowcount++;
$orden++;
}
// Línea de cierre
$this->Cell(array_sum($this->pos),0,'','T');
Expand Down

0 comments on commit 1f02c76

Please sign in to comment.