/* * preparo il vettore con i file che non sono pdf * Mentre lo faccio inizializzo il vettore per ciclare tra i pdf */ $pdfFiles = array($ToCode . '_report.pdf' => dirname(__FILE__) . '/FinalReport/PDFReport.php', $ToCode . '.pdf' => dirname(dirname(__FILE__)) . '/Qualification/PrnIndividual.php', $ToCode . '_team.pdf' => dirname(dirname(__FILE__)) . '/Qualification/PrnTeam.php'); $Tour = array(); $Tour[$ToCode . '.ianseo'] = gzcompress(serialize(export_tournament($_SESSION['TourId'], false))); $Tour[$ToCode . '.asc'] = $asc; $Tour[$ToCode . '.lst'] = ExportLSTInd(); $Tour[$ToCode . '_team.lst'] = ExportLSTTeam(); if ($ElimEvent[1] > 0 || $ElimEvent[2] > 0) { //$Tour[$ToCode . '_elim.pdf'] = URLWrapper($CFG->ROOT_DIR .'Elimination/PrnIndividual.php?Lang=' . SelectLanguage(). '&TourId=' . $_SESSION['TourId'] . '&ToFitarco=ignored&Dest=S'); $pdfFiles[$ToCode . '_elim.pdf'] = dirname(dirname(__FILE__)) . '/Elimination/PrnIndividual.php'; } if ($FinEventInd > 0) { $Tour[$ToCode . '_rank.lst'] = ExportLSTFinInd(); //$Tour[$ToCode . '_rank.pdf'] = URLWrapper( $CFG->ROOT_DIR . 'Final/Individual/PrnRanking.php?Lang=' . SelectLanguage(). '&TourId=' . $_SESSION['TourId'] . '&ToFitarco=ignored&Dest=S'); //$Tour[$ToCode . '_grid.pdf'] = URLWrapper( $CFG->ROOT_DIR . 'Final/Individual/PrnBracket.php?Lang=' . SelectLanguage(). '&TourId=' . $_SESSION['TourId'] . '&ToFitarco=ignored&Dest=S'); $pdfFiles[$ToCode . '_abs.pdf'] = dirname(dirname(__FILE__)) . '/Qualification/PrnIndividualAbs.php'; $pdfFiles[$ToCode . '_rank.pdf'] = dirname(dirname(__FILE__)) . '/Final/Individual/PrnRanking.php'; $pdfFiles[$ToCode . '_grid.pdf'] = dirname(dirname(__FILE__)) . '/Final/Individual/PrnBracket.php'; } if ($FinEventTeam > 0) { $Tour[$ToCode . '_rank_team.lst'] = ExportLSTFinTeam(); //$Tour[$ToCode . '_rank_team.pdf'] = URLWrapper( $CFG->ROOT_DIR . 'Final/Team/PrnRanking.php?Lang=' . SelectLanguage(). '&TourId=' . $_SESSION['TourId'] . '&ToFitarco=ignored&Dest=S'); //$Tour[$ToCode . '_grid_team.pdf'] = URLWrapper( $CFG->ROOT_DIR . 'Final/Team/PrnBracket.php?Lang=' . SelectLanguage(). '&TourId=' . $_SESSION['TourId'] . '&ToFitarco=ignored&Dest=S'); $pdfFiles[$ToCode . '_abs_team.pdf'] = dirname(dirname(__FILE__)) . '/Qualification/PrnTeamAbs.php'; $pdfFiles[$ToCode . '_rank_team.pdf'] = dirname(dirname(__FILE__)) . '/Final/Team/PrnRanking.php'; $pdfFiles[$ToCode . '_grid_team.pdf'] = dirname(dirname(__FILE__)) . '/Final/Team/PrnBracket.php'; } // ora genero le stringhe dei pdf e accodo a $Tour
<?php require_once dirname(dirname(dirname(__FILE__))) . '/config.php'; require_once 'Common/Fun_FormatText.inc.php'; require_once '../Fun_Final.local.inc.php'; if (!CheckTourSession()) { print get_text('CrackError'); exit; } $Code = ''; // Tiro fuori il codice gara $Select = "SELECT ToCode FROM Tournament WHERE ToId=" . StrSafe_DB($_SESSION['TourId']) . " "; $Rs = safe_r_sql($Select); if (safe_num_rows($Rs) == 1) { $MyRow = safe_fetch($Rs); $Code = $MyRow->ToCode; } $StrData = ExportLSTFinInd(isset($_REQUEST['Event']) ? $_REQUEST['Event'] : null); if ($Code != '') { if (!isset($_REQUEST['ToFitarco'])) { header('Cache-Control: no-store, no-cache, must-revalidate'); header('Content-Disposition: attachment; filename=' . $Code . '_rank.lst'); header('Content-type: text/tab-separated-values'); print $StrData; } else { $fp = fopen($_REQUEST['ToFitarco'], 'w'); fputs($fp, $StrData); fclose($fp); } }