for ($n = 0; $n < $Ath4Target; $n++) { $tab[0][sprintf('%c', $n + 65)] = ''; // foto $tab[1][sprintf('%c', $n + 65)] = ''; // bib num, divisione e classe $tab[2][sprintf('%c', $n + 65)] = ''; // Nome $tab[3][sprintf('%c', $n + 65)] = ''; // società } } // recupera se si tratta di A, B, eccetera $Num = substr($MyRow->TargetNo, -1); $tab[0][$Num] = '<img class="athletephoto" src="Photos/' . $TourCode . '-En-' . $MyRow->EnId . '.jpg" width="' . $fotow . '" alternate=""/>'; $tab[1][$Num] = $MyRow->TargetNo . ' ' . $MyRow->DivCode . ' ' . $MyRow->ClassCode; $tab[2][$Num] = $MyRow->FirstName . ' ' . ($TVsettings->TVPNameComplete == 0 ? FirstLetters($MyRow->Name) : $MyRow->Name); $tab[3][$Num] = $MyRow->NationCode . ' ' . ($TVsettings->TVPViewNationName == 1 ? $MyRow->Nation : ''); $oldTarget = intval($MyRow->TargetNo); $oldSession = $MyRow->Session; } if ($tab) { // cambio di paglione, scarico le righe $tmpRow = ''; foreach ($tab as $row => $cols) { $tmpRow .= '<tr valign="top">'; foreach ($cols as $col) { if ($col) { $tmpRow .= '<td align="center">' . $col . '</td>'; } else { $tmpRow .= '<td> </td>'; }
if ($Record['gap'] and $item['recordGap'] < $Record['tot'] and ($RecCode == 'WA' or $RecCode == $item['contAssoc'])) { // $RecClass='Rec-'.$RecType; $RecColumns .= '<td class="Rec-Bg-' . $RecType . '"> </td>'; } else { $RecColumns .= '<td> </td>'; } } } } $tmp .= '<tr' . ($key % 2 == 0 ? '' : ' class="Next"') . '>'; $tmp .= '<th class="Title ' . $RecClass . '">' . $item['rank'] . '</th>'; if (!empty($comparedTo)) { $tmp .= '<td class="Center ' . $RecClass . '" style="' . ($item['oldRank'] ? 'background: url(\'' . $CFG->ROOT_DIR . 'Common/Images/' . ($item['rank'] == $item['oldRank'] ? 'Minus' : ($item['rank'] < $item['oldRank'] ? 'Up' : 'Down')) . '.png\'); background-repeat:no-repeat; background-size: contain; background-position:center;' : '') . 'color:#FFFFFF; font-weight:bold; font-size:60%; ">' . ($item['oldRank'] && $item['oldRank'] != $item['rank'] ? $item['oldRank'] : ' ') . '</th>'; } $tmp .= $RecColumns; $tmp .= '<td><span class="piccolo">' . $item['target'] . '</span> ' . $item['familynameUpper'] . ' ' . ($TVsettings->TVPNameComplete == 0 ? FirstLetters($item['givenname']) : $item['givenname']) . '</td>'; if ($ViewTeams) { $tmp .= '<td style="font-size:80%">' . ($TVsettings->TVPViewNationName == 1 ? $item['countryName'] : $item['countryCode']) . '</td>'; } if ($ViewDists) { for ($i = 1; $i <= $rankData['meta']['numDist']; ++$i) { list($rank, $score) = explode('|', $item['dist_' . $i]); $tmp .= '<td class="NumberAlign">' . str_pad($score, 3, " ", STR_PAD_LEFT) . '</td>'; } } $tmp .= '<td class="NumberAlign Grassetto ' . $RecClass . '">' . $item['completeScore'] . '</td>'; if ($View10s) { $tmp .= '<td class="NumberAlign' . $Class10 . '">' . $item[$Field10] . '</td>'; } if ($ViewX9s) { $tmp .= '<td class="NumberAlign">' . $item[$FieldX9] . '</td>';
// $col[]=6; $tmp .= '<th>' . get_text('Session') . '</th>'; $col[] = 25; $tmp .= '</tr>' . "\n"; $ret[$MyRow->Initial]['head'] = $tmp; $SumCol = array_sum($col); $cols = ''; foreach ($col as $w) { $cols .= '<col width="' . round(100 * $w / $SumCol, 0) . '%"></col>'; } $ret[$MyRow->Initial]['cols'] = $cols; $ret[$MyRow->Initial]['fissi'] = ''; $ret[$MyRow->Initial]['basso'] = ''; $ret[$MyRow->Initial]['type'] = 'DB'; $ret[$MyRow->Initial]['style'] = $ST; $ret[$MyRow->Initial]['js'] = $JS; $ret[$MyRow->Initial]['js'] .= 'FreshDBContent[%1$s]=\'GetNewContent.php?Quadro=%1$s&Rule=' . $RULE->TVRId . '&Tour=' . $RULE->TVRTournament . '&Segment=' . $TVsettings->TVPId . '&Session=' . $MyRow->Initial . "';\n"; } $RowCounter++; $tmp = ''; //Dati if ($oldTarget != intval($MyRow->TargetNo)) { if ($oldTarget != 'x') { $tmp .= '<tr style="height:2px;"><th colspan="' . $NumCol . '"></th></tr>'; } $oldTarget = intval($MyRow->TargetNo); $Class = $Class ? '' : ' class="Next"'; } $tmp .= '<tr' . $Class . '>' . '<td class="NumberAlign">' . ltrim($MyRow->TargetNo, '0') . ' </td>' . '<td>' . $MyRow->FirstName . ' ' . ($TVsettings->TVPNameComplete == 0 ? FirstLetters($MyRow->Name) : $MyRow->Name) . '</td>' . '<td>' . $MyRow->NationCode . ' ' . ($TVsettings->TVPViewNationName == 1 ? $MyRow->Nation : '') . '</td>' . '<td class="Center">' . ($MyRow->SesName ? $MyRow->SesName : get_text('Session') . ' ' . $MyRow->Session) . '</td>' . '</tr>' . "\n"; $ret[$MyRow->Initial]['basso'] .= $tmp; }
$SumCol = array_sum($col); $cols = ''; foreach ($col as $w) { $cols .= '<col width="' . round(100 * $w / $SumCol, 0) . '%"></col>'; } $ret[$IdEvent]['cols'] = $cols; $ret[$IdEvent]['fissi'] = ''; $ret[$IdEvent]['basso'] = ''; $ret[$IdEvent]['type'] = 'DB'; $ret[$IdEvent]['style'] = $ST; $ret[$IdEvent]['js'] = $JS; $ret[$IdEvent]['js'] .= 'FreshDBContent[%1$s]=\'GetNewContent.php?Quadro=%1$s&Rule=' . $RULE->TVRId . '&Tour=' . $RULE->TVRTournament . '&Segment=' . $TVsettings->TVPId . '&Event=' . $data['meta']['trueEvent'] . '&SubClass=' . $IdEvent . "';\n"; // Inserisci adesso le singole righe foreach ($data['items'] as $key => $archer) { // al 4° devo interrompere la tabella e aprire il resto in un div separato $tmp = '<tr' . ($key % 2 == 0 ? '' : ' class="Next"') . '>' . '<th class="Title">' . $archer['rank'] . '</th>' . (empty($comparedTo) ? '' : '<td class="Center" style="' . ($archer['oldRank'] ? 'background: url(\'' . $CFG->ROOT_DIR . 'Common/Images/' . ($archer['rank'] == $archer['oldRank'] ? 'Minus' : ($archer['rank'] < $archer['oldRank'] ? 'Up' : 'Down')) . '.png\'); background-repeat:no-repeat; background-size: contain; background-position:center;' : '') . 'color:#FFFFFF; font-weight:bold; font-size:60%; ">' . ($archer['oldRank'] && $archer['oldRank'] != $archer['rank'] ? $archer['oldRank'] : ' ') . '</td>') . '<td><span class="piccolo">' . $archer['target'] . '</span> ' . $archer['familynameUpper'] . ' ' . ($TVsettings->TVPNameComplete == 0 ? FirstLetters($archer['givenname']) : $archer['givenname']) . '</td>'; if ($ViewTeams) { $tmp .= '<td style="font-size:80%">' . $archer['countryCode'] . ' ' . ($TVsettings->TVPViewNationName == 1 ? $archer['countryName'] : '') . '</td>'; } if ($ViewDists) { for ($i = 1; $i <= $rankData['meta']['numDist']; ++$i) { if ($data['meta']['fields']['dist_' . $i] == '-') { continue; } $bits = explode('|', $archer['dist_' . $i]); $tmp .= '<td class="NumberAlign">' . str_pad($bits[1], 3, " ", STR_PAD_LEFT) . '<span class="piccolo">/' . str_pad($TourType != 14 ? $bits[0] : $bits[3], 2, " ", STR_PAD_LEFT) . '</span></td>'; } } $tmp .= '<td class="NumberAlign Grassetto">' . $archer['score'] . '</td>'; if ($View10s) { $tmp .= '<td class="NumberAlign">' . $archer['gold'] . '</td>';
} } if (in_array($MyRow->EnId, $GUYS)) { // lo include nelle schede da ritornare $ret[$MyRow->EnId]['head'] = ''; $ret[$MyRow->EnId]['cols'] = ''; $ret[$MyRow->EnId]['fissi'] = ''; $ret[$MyRow->EnId]['type'] = 'DB'; $ret[$MyRow->EnId]['style'] = $ST; $ret[$MyRow->EnId]['js'] = $JS; $ret[$MyRow->EnId]['js'] .= 'FreshDBContent[%1$s]=\'\';' . "\n"; $tmp = '<table width="100%" height="' . ($_SESSION['WINHEIGHT'] - 35) . '">'; // prima riga, a destra ci va la foto, a sinistra i dati $tmp .= '<tr>'; $tmp .= '<td rowspan="5"><img class="athletephoto" src="Photos/' . $TourCode . '-En-' . $MyRow->EnId . '.jpg" width="' . $fotow . '" alternate=""/></td>'; $tmp .= '<td width="100%" align="center">' . $MyRow->FirstName . ' ' . ($TVsettings->TVPNameComplete == 0 ? FirstLetters($MyRow->Name) : $MyRow->Name) . '</td>'; $tmp .= '</tr>'; $tmp .= '<tr><td align="center" class="piccolo"><span class="piccolo">' . get_text('RankingPosition', 'Tournament') . '</span><br/>' . $MyRank . '<span class="piccolo">'; for ($i = 1; $i <= $MyRow->NumDist; ++$i) { $tmp .= '<br/>' . $MyRow->{'Td' . $i} . ': '; if ($SnapDistance == 0) { $tmp .= str_pad($MyRow->{'QuD' . $i . 'Score'}, 3, " ", STR_PAD_LEFT) . '<span class="piccolo">/' . str_pad($MyRow->ToType != 14 ? $MyRow->{'QuD' . $i . 'Rank'} : $MyRow->{'QuD' . $i . 'Xnine'}, 2, " ", STR_PAD_LEFT) . '</span>'; } else { if ($i < $SnapDistance) { $tmp .= str_pad($MyRow->{'QuD' . $i . 'Score'}, 3, " ", STR_PAD_LEFT); } else { if ($i == $SnapDistance) { $tmp .= str_pad($MyRow->{'EqScore'}, 3, " ", STR_PAD_LEFT); } else { $tmp .= str_pad("0", 3, " ", STR_PAD_LEFT); }
$TeamSx = $item['countryCode']; $TeamDx = $item['oppCountryCode']; } $NameSx = array(); $NameDx = array(); if ($ViewAthls) { for ($n = 0; $n < $colspan; $n++) { if (!empty($section['athletes'][$item['teamId']][0][$n])) { $at = $section['athletes'][$item['teamId']][0][$n]; $NameSx[] = $TVsettings->TVPNameComplete ? $at['athlete'] : $at['familyName'] . ' ' . FirstLetters($at['givenName']); } else { $NameSx[] = ' '; } if (!empty($section['athletes'][$item['oppTeamId']][0][$n])) { $at = $section['athletes'][$item['oppTeamId']][0][$n]; $NameDx[] = $TVsettings->TVPNameComplete ? $at['athlete'] : $at['familyName'] . ' ' . FirstLetters($at['givenName']); } else { $NameDx[] = ' '; } } } if ($item['tie'] == 2) { // it is a bye $tmp .= '<td>' . ltrim($item['target'], '0') . '</td>' . ($ViewFlags ? '<td class="flagphoto">' . $FotoSx . '</td>' : '') . '<td>' . $TeamSx . '</td>' . ($ViewAthls ? '<td class="bottom">' . implode('<br/>', $NameSx) . '</td>' : '') . '<td class="NumberAlign bottom"><span class="piccolo">' . get_text('Bye') . '</span></td>' . "\n"; } elseif ($item['countryCode']) { // archer is there $tmp .= '<td>' . ltrim($item['target'], '0') . '</td>' . ($ViewFlags ? '<td class="flagphoto">' . $FotoSx . '</td>' : '') . '<td>' . $TeamSx . '</td>' . ($ViewAthls ? '<td class="bottom">' . implode('<br/>', $NameSx) . '</td>' : '') . '<td class="NumberAlign bottom">' . $item[$section['meta']['matchMode'] ? 'setScore' : 'score'] . ($item['tie'] == 1 ? '*' : ($item['oppTie'] == 1 ? '<tt> </tt>' : '')) . '</td>' . "\n"; // if($item['tie']==1) debug_svela($item); } else { // it is the bye's opponent? $tmp .= '<td> </td>' . ($ViewFlags ? '<td class="flagphoto"> </td>' : '') . '<td> </td>' . ($ViewAthls ? '<td class="bottom">' . implode('<br/>', $NameSx) . '</td>' : '') . '<td class="NumberAlign bottom"> </td>' . "\n";
$SumCol = array_sum($col); $cols = ''; foreach ($col as $w) { $cols .= '<col width="' . round(100 * $w / $SumCol, 0) . '%"></col>'; } $ret[$IdEvent]['cols'] = $cols; $ret[$IdEvent]['fissi'] = ''; $ret[$IdEvent]['basso'] = ''; $ret[$IdEvent]['type'] = 'DB'; $ret[$IdEvent]['style'] = $ST; $ret[$IdEvent]['js'] = $JS; $ret[$IdEvent]['js'] .= 'FreshDBContent[%1$s]=\'GetNewContent.php?Quadro=%1$s&Rule=' . $RULE->TVRId . '&Tour=' . $RULE->TVRTournament . '&Segment=' . $TVsettings->TVPId . '&Event=' . $IdEvent . "';\n"; foreach ($section['items'] as $key => $item) { // Dati della tabella aperta in (1) // al 4° devo interrompere la tabella e aprire il resto in un div separato $tmp = '<tr' . ($key % 2 == 0 ? '' : ' class="Next"') . '>' . '<th class="Title">' . $item['rank'] . '</th>' . '<td><span class="piccolo">' . $item['target'] . '</span> ' . $item['familynameUpper'] . ' ' . ($TVsettings->TVPNameComplete == 0 ? FirstLetters($item['givenname']) : $item['givenname']) . '</td>'; if ($ViewTeams) { $tmp .= '<td style="font-size:80%">' . $item['countryCode'] . ' ' . ($TVsettings->TVPViewNationName == 1 ? $item['countryName'] : '') . '</td>'; } //NewDistanze if ($ViewDists) { for ($i = 1; $i <= $rankData['meta']['numDist']; ++$i) { list($rank, $score, $gold, $xnine) = explode('|', $item['dist_' . $i]); if ($section['meta']['snapDistance'] == 0) { $tmp .= '<td class="NumberAlign">' . str_pad($score, 3, " ", STR_PAD_LEFT) . '<span class="piccolo">/' . str_pad($TourType != 14 ? $rank : $xnine, 2, " ", STR_PAD_LEFT) . '</span></td>'; } else { if ($i < $section['meta']['snapDistance']) { $tmp .= '<td class="NumberAlign">' . str_pad($score, 3, " ", STR_PAD_LEFT) . '</td>'; } else { if ($i == $section['meta']['snapDistance']) { list($rank, $score) = explode('|', $item['dist_Snap']);
$col[] = 8; $tmp .= '<th>' . get_text('Class') . '</th>'; $col[] = 8; $tmp .= '</tr>' . "\n"; $ret[$MyRow->Session]['head'] = $tmp; $SumCol = array_sum($col); $cols = ''; foreach ($col as $w) { $cols .= '<col width="' . round(100 * $w / $SumCol, 0) . '%"></col>'; } $ret[$MyRow->Session]['cols'] = $cols; $ret[$MyRow->Session]['fissi'] = ''; $ret[$MyRow->Session]['basso'] = ''; $ret[$MyRow->Session]['type'] = 'DB'; $ret[$MyRow->Session]['style'] = $ST; $ret[$MyRow->Session]['js'] = $JS; $ret[$MyRow->Session]['js'] .= 'FreshDBContent[%1$s]=\'GetNewContent.php?Quadro=%1$s&Rule=' . $RULE->TVRId . '&Tour=' . $RULE->TVRTournament . '&Segment=' . $TVsettings->TVPId . '&Session=' . $MyRow->Session . "';\n"; } $RowCounter++; $tmp = ''; //Dati if ($oldTarget != intval($MyRow->TargetNo)) { if ($oldTarget != 'x') { $tmp .= '<tr style="height:2px;"><th colspan="' . $NumCol . '"></th></tr>'; } $oldTarget = intval($MyRow->TargetNo); $Class = $Class ? '' : ' class="Next"'; } $tmp .= '<tr' . $Class . '>' . '<td class="NumberAlign">' . ltrim($MyRow->TargetNo, '0') . ' </td>' . '<td>' . $MyRow->FirstName . ' ' . ($TVsettings->TVPNameComplete == 0 ? FirstLetters($MyRow->Name) : $MyRow->Name) . '</td>' . '<td>' . $MyRow->NationCode . ' ' . ($TVsettings->TVPViewNationName == 1 ? $MyRow->Nation : '') . '</td>' . '<td class="Center">' . (HideCols && $MyRow->DivDescription ? $MyRow->DivDescription : $MyRow->DivCode) . '</td>' . '<td class="Center">' . (HideCols && $MyRow->ClDescription ? $MyRow->ClDescription : $MyRow->ClassCode) . '</td>' . '</tr>' . "\n"; $ret[$MyRow->Session]['basso'] .= $tmp; }
$ret["{$IdEvent} - {$IdPhase}"]['type'] = 'DB'; $ret["{$IdEvent} - {$IdPhase}"]['style'] = $ST; $ret["{$IdEvent} - {$IdPhase}"]['js'] = $JS; $ret["{$IdEvent} - {$IdPhase}"]['js'] .= 'FreshDBContent[%1$s]=\'GetNewContent.php?Quadro=%1$s&Rule=' . $RULE->TVRId . '&Tour=' . $RULE->TVRTournament . '&Segment=' . $TVsettings->TVPId . '&Event=' . $IdEvent . "&Phase={$IdPhase}';\n"; $ii = 0; $Style = ''; foreach ($phase['items'] as $key => $item) { // Dati della tabella aperta in (1) $tmp = '<tr' . $Style . '>'; $NamSx = $item['athlete']; $NamDx = $item['oppAthlete']; $TeamSx = $item['countryCode'] . ' ' . $item['countryName']; $TeamDx = $item['oppCountryCode'] . ' ' . $item['oppCountryName']; if (!$TVsettings->TVPNameComplete) { $NamSx = $item['familyName'] . ' ' . FirstLetters($item['givenName']); $NamDx = $item['oppFamilyName'] . ' ' . FirstLetters($item['oppGivenName']); } if (!$TVsettings->TVPViewNationName) { $TeamSx = $item['countryCode']; $TeamDx = $item['oppCountryCode']; } if ($item['tie'] == 2) { // it is a bye $tmp .= '<td>' . get_text('Bye') . '</td>' . '<td>' . $NamSx . '</td>' . ($ViewTeams ? '<td>' . $TeamSx . '</td>' : '') . '<td class="NumberAlign"> </td>' . "\n"; } elseif ($item['athlete']) { // archer is there $tmp .= '<td>' . ltrim($item['target'], '0') . '</td>' . '<td>' . $NamSx . '</td>' . ($ViewTeams ? '<td>' . $TeamSx . '</td>' : '') . '<td class="NumberAlign" id="match_' . $IdEvent . '_' . $item['matchNo'] . '">' . $item[$section['meta']['matchMode'] ? 'setScore' : 'score'] . ($item['tie'] == 1 ? '*' : ($item['oppTie'] == 1 ? '<tt> </tt>' : '')) . '</td>' . "\n"; } else { // it is the bye's opponent? $tmp .= '<td> </td>' . '<td> </td>' . ($ViewTeams ? '<td> </td>' : '') . '<td class="NumberAlign"> </td>' . "\n"; }