} if ($TmpWhere != "") { $MyQuery .= "AND (" . $TmpWhere . ")"; } $MyQuery .= "ORDER BY CoCode, Name, CoName, FirstName, TargetNo "; //echo $MyQuery;exit; $Rs = safe_r_sql($MyQuery); if ($Rs) { $ShowStatusLegend = false; $OldTeam = '#@#@#'; $isFirstTime = true; $TotalPrice = 0; while ($MyRow = safe_fetch($Rs)) { if ($OldTeam != $MyRow->NationCode) { if (!$isFirstTime) { $pdf->SetFont($pdf->FontStd, '', 8); $pdf->Cell(165, 15, get_text('Cash', 'Tournament') . ":", 0, 0, 'R', 0); $pdf->SetFont($pdf->FontStd, 'B', 12); $pdf->Cell(25, 15, NumFormat($TotalPrice, 2) . " " . $pdf->writeCurrency(), 0, 1, 'R', 0); $pdf->AddPage(); } $isFirstTime = false; $pdf->SetXY(10, $pdf->GetY() + 5); $pdf->SetFont($pdf->FontStd, '', 8); $pdf->Cell($pdf->GetStringWidth(get_text('Country')) + 5, 10, get_text('Country'), 0, 0, 'L', 0); $pdf->SetFont($pdf->FontStd, 'B', 12); $pdf->Cell(15, 10, $MyRow->NationCode, 0, 0, 'C', 0); $pdf->Cell(50, 10, $MyRow->Nation, 0, 1, 'L', 0); $pdf->SetFont($pdf->FontStd, '', 8); $pdf->Cell(19, 10, get_text('Partecipants'), 0, 1, 'L', 0); $pdf->SetFont($pdf->FontStd, 'B', 7);
$Rs = safe_r_sql($MyQuery); if ($Rs) { $ShowStatusLegend = false; $CurSession = -1; $OldTarget = ''; while ($MyRow = safe_fetch($Rs)) { if ($CurSession != $MyRow->Session || !$pdf->SamePage(4) || $MyRow->TargetLetter == 'A' && !$pdf->SamePage(16)) { $TmpSegue = !$pdf->SamePage(4); if ($MyRow->TargetLetter == 'A' && !$pdf->SamePage(16)) { $TmpSegue = true; $pdf->AddPage(); } elseif ($CurSession != -1) { $pdf->SetXY(10, $pdf->GetY() + 5); } $CurSession = $MyRow->Session; $pdf->SetFont($pdf->FontStd, 'B', 10); $pdf->Cell(190, 6, get_text('Session') . " " . $CurSession . " - " . get_text('Distance', 'HTT') . " " . $_REQUEST["Distance"], 1, 1, 'C', 1); if ($TmpSegue) { $pdf->SetXY(170, $pdf->GetY() - 6); $pdf->SetFont($pdf->FontStd, 'I', 6); $pdf->Cell(30, 6, get_text('Continue'), 0, 1, 'R', 0); } $pdf->SetFont($pdf->FontStd, 'B', 7); $pdf->Cell(11, 4, get_text('Target'), 1, 0, 'C', 1); $pdf->Cell(10, 4, get_text('Code', 'Tournament'), 1, 0, 'C', 1); $pdf->Cell(44, 4, get_text('Athlete'), 1, 0, 'L', 1); $pdf->Cell(16, 4, get_text('Country'), 1, 0, 'L', 1); if (!HideCols) { $pdf->Cell(12, 4, get_text('AgeCl'), 1, 0, 'C', 1); $pdf->Cell(9, 4, get_text('SubCl', 'Tournament'), 1, 0, 'C', 1); }
require_once 'Common/Fun_Various.inc.php'; $RowTournament = NULL; /*$MySql = "SELECT ToCode, ToName, ToCommitee, ToComDescr, ToWhere, UNIX_TIMESTAMP(ToWhenFrom) AS DtFrom, UNIX_TIMESTAMP(ToWhenTo) AS DtTo, TtName " . "FROM Tournament " . "INNER JOIN Tournament*Type ON ToType=TtId " . "WHERE ToId=" . StrSafe_DB($_SESSION['TourId']);*/ $MySql = "SELECT" . " ToCode," . " ToName," . " ToCommitee," . " ToComDescr," . " ToWhere," . " date_format(ToWhenFrom, '" . get_text('DateFmtDB') . "') AS DtFrom," . " date_format(ToWhenTo, '" . get_text('DateFmtDB') . "') AS DtTo," . " ToTypeName AS TtName " . "FROM Tournament " . "WHERE ToId=" . StrSafe_DB($_SESSION['TourId']); $Rs = safe_r_sql($MySql); if (safe_num_rows($Rs) == 1) { $RowTournament = safe_fetch($Rs); safe_free_result($Rs); } $AllQuestions = isset($_REQUEST["All"]); $pdf = new ResultPDF(get_text('FinalReportTitle', 'Tournament')); //Intestazione $pdf->SetFont($pdf->FontStd, 'B', 10); $pdf->Cell(190, 7, get_text('FinalReportTitle', 'Tournament'), 1, 1, 'C', 1); //Codice Gara & Tipo $pdf->SetFont($pdf->FontStd, '', 10); $pdf->Cell(40, 7, get_text('TourCode', 'Tournament') . ": ", 'LT', 0, 'L', 0); $pdf->SetFont($pdf->FontStd, 'B', 10); $pdf->Cell(50, 7, $RowTournament->ToCode, 'T', 0, 'L', 0); $pdf->SetFont($pdf->FontStd, '', 10); $pdf->Cell(30, 7, get_text('TourType', 'Tournament') . ": ", 'T', 0, 'R', 0); $pdf->SetFont($pdf->FontStd, 'B', 10); $pdf->Cell(70, 7, get_text($RowTournament->TtName, 'Tournament'), 'TR', 1, 'L', 0); //Denominazione $pdf->SetFont($pdf->FontStd, '', 10); $pdf->Cell(40, 7, get_text('TourName', 'Tournament') . ": ", 'L', 0, 'L', 0); $pdf->SetFont($pdf->FontStd, 'B', 10); $pdf->Cell(150, 7, $RowTournament->ToName, 'R', 1, 'L', 0);
<?php require_once dirname(dirname(__FILE__)) . '/config.php'; require_once 'Common/pdf/ResultPDF.inc.php'; require_once 'Common/Fun_FormatText.inc.php'; if (!isset($isCompleteResultBook)) { $pdf = new ResultPDF(get_text('Birthdays', 'Tournament')); } $Select = "SELECT\r\n\tCONCAT(upper(EnFirstName), ' ', EnName) as Athlete, DATE_FORMAT(EnDob,'" . get_text('DateFmtDB') . "') as DoB, CoCode, CoName, SesName, DATE_FORMAT(EnDob,'%d') as Day, DATE_FORMAT(EnDob,'%m') as Month, \r\n\tSUBSTRING(QuTargetNo,1,1) AS Session, SUBSTRING(QuTargetNo,2) AS TargetNo\r\n\tFROM Entries\r\n\tINNER JOIN Qualifications ON EnId=QuId\r\n\tINNER JOIN Countries on EnCountry=CoId\r\n\tINNER JOIN Session ON SesTournament=EnTournament AND QuSession=SesOrder AND SesType='Q'\r\n\tWHERE EnTournament=" . StrSafe_DB($_SESSION['TourId']) . "\r\n\tAND DATE_FORMAT(EnDob,'%m%d') BETWEEN DATE_FORMAT(" . StrSafe_DB($_SESSION['TourRealWhenFrom']) . ",'%m%d') AND DATE_FORMAT(" . StrSafe_DB($_SESSION['TourRealWhenTo']) . ",'%m%d')\r\n\tORDER BY DATE_FORMAT(EnDob,'%m%d') ASC, EnName, EnFirstName"; $Rs = safe_r_sql($Select); $CurDate = ''; if ($Rs && safe_num_rows($Rs) > 0) { $pdf->SetFont($pdf->FontStd, 'B', 16); $pdf->Cell(190, 15, get_text('Birthdays', 'Tournament'), 0, 1, 'C'); while ($MyRow = safe_fetch($Rs)) { if ($CurDate != $MyRow->Month . $MyRow->Day) { if ($CurDate != '') { $pdf->Cell(190, 3, '', 0, 1); } $pdf->SetFont($pdf->FontStd, 'B', 16); $pdf->Cell(190, 8, get_text($MyRow->Month . '_Short', 'DateTime') . " " . $MyRow->Day, 0, 1, 'L'); } $pdf->SetFont($pdf->FontStd, '', 10); $pdf->Cell(10, 8, '', 0, 0); $pdf->Cell(70, 6, $MyRow->Athlete . ' (' . $MyRow->DoB . ')', 0, 0); $pdf->Cell(50, 6, $MyRow->CoCode . ' - ' . $MyRow->CoName, 0, 0); $pdf->Cell(60, 6, $MyRow->Session . ' - ' . $MyRow->TargetNo . ($MyRow->SesName ? ' (' . $MyRow->SesName . ')' : ''), 0, 1); $CurDate = $MyRow->Month . $MyRow->Day; } } if (!isset($isCompleteResultBook)) {
while ($SesRow = safe_fetch($SesSql)) { // set the target dimention $DimTarget = min(10, ($pdf->GetPageWidth() - 20 - ColName) / ($SesRow->TargetMax - $SesRow->TargetMin + 1)); // checks if there is enough space for at least 1 distance if (!$pdf->SamePage(RowH + 25)) { $pdf->AddPage(); //Al cambio di data aggiungo una pagina $TopPos = 35; } else { $TopPos += RowH; } // prints the session $pdf->SetFillColor(0); $pdf->SetTextColor(255); $pdf->SetXY(10, $TopPos); $pdf->SetFont($pdf->FontStd, 'B', 14); $pdf->Cell($pdf->GetPageWidth() - 20, 8, get_text('Session') . ": " . $SesRow->QuSession, 0, 0, "C", 1); $TopPos += 8; $pdf->SetFillColor(240); $pdf->SetTextColor(0); for ($n = 1; $n <= $SesRow->ToNumDist; $n++) { // gets the different distances for each Event and target type $Sql = "select distinct cast(substr(QuTargetNo,2) as unsigned) TargetNo, IFNULL(Td{$n},'.{$n}.') as Distance, TarDescr, TarDim from\r\nEntries\r\ninner join Qualifications on EnId=QuId\r\nleft join TournamentDistances on concat(trim(EnDivision),trim(EnClass)) like TdClasses and EnTournament=TdTournament\r\nleft join (select TfId, TarDescr, TfW{$n} as TarDim, TfTournament from TargetFaces inner join Targets on TfT{$n}=TarId) tf on TfTournament=EnTournament and TfId=EnTargetFace\r\nwhere EnTournament={$_SESSION['TourId']} and QuSession={$SesRow->QuSession}\r\norder by Distance desc, TargetNo, TarDescr, TarDim"; $Rows = array(); $OldDist = 0; $OldTarg = 0; $OldDim = 0; $q = safe_r_sql($Sql); while ($r = safe_fetch($q)) { if ($r->Distance == '-') { continue;