} if (isset($_REQUEST['Phase']) && preg_match("/^[0-9]{1,2}\$/i", $_REQUEST["Phase"])) { $MyQuery .= ' AND (TfEvent, TfTeam, TfSubTeam) IN (SELECT DISTINCT TfEvent,TfTeam, TfSubTeam FROM TeamFinals INNER JOIN Grids ON TfMatchNo=GrMatchNo WHERE TfTournament=' . $_SESSION['TourId'] . ' and grPhase=' . $_REQUEST['Phase'] . (!empty($_REQUEST['Event']) ? CleanEvents($_REQUEST['Event'], 'TfEvent') : '') . ')'; } $MyQuery .= ' Group By EvCode, GrPhase, TfMatchNo '; $MyQuery .= ' ORDER BY EvCode, GrPhase DESC, TfMatchNo ASC, TfcOrder'; // debug_svela($MyQuery, true); } //*DEBUG*/echo $MyQuery;exit(); $Rs = safe_r_sql($MyQuery); // Se il Recordset � valido e contiene almeno una riga if (safe_num_rows($Rs) > 0) { if (!empty($_REQUEST['BigNames'])) { require_once 'Common/Fun_FormatText.inc.php'; require_once 'Common/pdf/BigNamesPDF.inc.php'; $pdf = new BigNamesPDF(get_text('Sign/guide-board', 'Tournament'), false); if (!empty($_REQUEST['TestCountries'])) { $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); } $pdf->init($Rs); $pdf->TargetAssignment = !empty($_REQUEST['TargetAssign']); $pdf->IncludeLogo = (!empty($_REQUEST['IncludeLogo']) or !empty($_REQUEST['TestCountries']) or $TeamLeaf); $pdf->TeamLeaf = $TeamLeaf; $pdf->Local = !empty($_REQUEST['local']); if ($TeamLeaf) { $pdf->setPrintHeader(false); } $pdf->Make(); exit; } else {
if (isset($_REQUEST['Phase']) && preg_match("/^[0-9]{1,2}\$/i", $_REQUEST["Phase"])) { $p = $_REQUEST['Phase']; // print $p;exit; if ($p == 24) { $p = 32; } elseif ($p == 48) { $p = 64; } $MyQuery .= 'AND EnId IN (SELECT DISTINCT FinAthlete FROM Finals INNER JOIN Grids ON FinMatchNo=GrMatchNo WHERE FinTournament=' . $_SESSION['TourId'] . ' and grPhase=' . $p . (!empty($_REQUEST['Event']) ? CleanEvents($_REQUEST['Event'], 'EvCode') : '') . ')'; } $MyQuery .= ' ORDER BY EvCode, GrPhase DESC, FinMatchNo ASC'; //*DEBUG*/echo $MyQuery;exit(); $Rs = safe_r_sql($MyQuery); // Se il Recordset è valido e contiene almeno una riga if (safe_num_rows($Rs) > 0) { // debug_svela($MyQuery); if (!empty($_REQUEST['BigNames'])) { require_once 'Common/Fun_FormatText.inc.php'; require_once 'Common/pdf/BigNamesPDF.inc.php'; $pdf = new BigNamesPDF(get_text('Sign/guide-board', 'Tournament'), false); $pdf->init($Rs); $pdf->TargetAssignment = !empty($_REQUEST['TargetAssign']); $pdf->IncludeLogo = !empty($_REQUEST['IncludeLogo']); $pdf->Make(); exit; } else { require_once 'Common/pdf/IanseoPdf.php'; include_once 'Final/PDFNames.php'; exit; } }