} } } if (isset($_REQUEST["ScoreDraw"]) && $_REQUEST['ScoreDraw'] == "Draw") { $pdf->AddPage(); $Data = array(); foreach (range(1, $Ath4Target) as $k) { $Data[] = ''; } foreach ($XScorePos as $k => $Xpos) { $pdf->DrawCollector($Xpos, $YScorePos[$k], $ScoreW, $ScoreH, $k + 1, IANSEO_ARROWS, $Data); } $oldline = $pdf->GetLineStyle(); $pdf->SetLineStyle(array('width' => 0.25, 'dash' => '2,5')); foreach (range(1, $NumW - 1) as $X) { $pdf->Line($x = $Margin * 0.5 + $X * ($ScoreW + $Margin), 0, $x, $pdf->getPageHeight()); } foreach (range(1, $NumH - 1) as $Y) { $pdf->Line(0, $y = $Margin * 0.5 + $Y * ($ScoreH + $Margin), $pdf->getPageWidth(), $y); } $pdf->SetLineStyle($oldline); } else { $MyQuery = 'SELECT SUBSTRING(at.AtTargetNo,2) as tNo, CoCode, CoName, Ath, Noc, Cat, Td1, Td2, Td3, Td4, Td5, Td6, Td7, Td8, ' . 'QuD1Arrowstring, QuD2Arrowstring, QuD3Arrowstring, QuD4Arrowstring, QuD5Arrowstring, QuD6Arrowstring, QuD7Arrowstring, QuD8Arrowstring, ' . 'QuD1Score, QuD2Score, QuD3Score, QuD4Score, QuD5Score, QuD6Score, QuD7Score, QuD8Score, ' . 'printD1gx, printD2gx, printD3gx, printD4gx, printD5gx, printD6gx, printD7gx, printD8gx ' . ' FROM AvailableTarget as at '; if (isset($_REQUEST["noEmpty"]) && $_REQUEST["noEmpty"] == 1) { $MyQuery .= "INNER JOIN\n\t\t\t\t(SELECT DISTINCT EnTournament, SUBSTRING(QuTargetNo,1,4) as TgtNo\n\t\t\t\tFROM Qualifications\n\t\t\t\tINNER JOIN Entries On QuId=EnId\n\t\t\t\tWHERE EnTournament = " . StrSafe_DB($_SESSION['TourId']) . " AND EnAthlete=1 AND QuTargetNo>='" . $_REQUEST['x_Session'] . str_pad($_REQUEST['x_From'], TargetNoPadding, "0", STR_PAD_LEFT) . "A' AND QuTargetNo<='" . $_REQUEST['x_Session'] . str_pad($_REQUEST['x_To'], TargetNoPadding, "0", STR_PAD_LEFT) . "Z'\n\t\t\t\t) as Tgt ON at.AtTournament=Tgt.EnTournament AND SUBSTRING(at.AtTargetNo,1,4)=Tgt.TgtNo\t"; } $MyQuery .= " LEFT JOIN " . ' (SELECT CoCode, CoName, QuTargetNo, CONCAT(EnFirstName,\' \', EnName) AS Ath, CONCAT(CoCode, \' - \', CoName) as Noc, CONCAT(EnDivision, \' \', EnClass) AS Cat, ' . ' Td1, Td2, Td3, Td4, Td5, Td6, Td7, Td8, ' . ' QuD1Arrowstring, QuD2Arrowstring, QuD3Arrowstring, QuD4Arrowstring, QuD5Arrowstring, QuD6Arrowstring, QuD7Arrowstring, QuD8Arrowstring, ' . ' QuD1Score, QuD2Score, QuD3Score, QuD4Score, QuD5Score, QuD6Score, QuD7Score, QuD8Score, ' . ' QuD1Gold+QuD1XNine as printD1gx, QuD2Gold+QuD2XNine as printD2gx, QuD3Gold+QuD3XNine as printD3gx, QuD4Gold+QuD4XNine as printD4gx, ' . ' QuD5Gold+QuD5XNine as printD5gx, QuD6Gold+QuD6XNine as printD6gx, QuD7Gold+QuD7XNine as printD7gx ,QuD8Gold+QuD8XNine as printD8gx ' . ' FROM Entries ' . ' INNER JOIN Qualifications ON EnId = QuId ' . ' INNER JOIN Countries ON EnCountry=CoId AND EnTournament=CoTournament ' . ' INNER JOIN Tournament ON EnTournament=ToId ' . ' LEFT JOIN TournamentDistances ON ToType=TdType and TdTournament=ToId AND CONCAT(TRIM(EnDivision),TRIM(EnClass)) LIKE TdClasses ' . ' WHERE EnTournament = ' . StrSafe_DB($_SESSION['TourId']) . " AND QuTargetNo>='" . $_REQUEST['x_Session'] . str_pad($_REQUEST['x_From'], TargetNoPadding, "0", STR_PAD_LEFT) . "A' AND QuTargetNo<='" . $_REQUEST['x_Session'] . str_pad($_REQUEST['x_To'], TargetNoPadding, "0", STR_PAD_LEFT) . "Z' " . ') as Sqy ON at.AtTargetNo = Sqy.QuTargetNo ' . " WHERE at.AtTournament = " . StrSafe_DB($_SESSION['TourId']) . ' ' . " AND at.AtTargetNo>='" . $_REQUEST['x_Session'] . str_pad($_REQUEST['x_From'], TargetNoPadding, "0", STR_PAD_LEFT) . "A' AND at.AtTargetNo<='" . $_REQUEST['x_Session'] . str_pad($_REQUEST['x_To'], TargetNoPadding, "0", STR_PAD_LEFT) . "Z' " . ' ORDER BY at.AtTargetNo ASC, Ath, Noc '; //print $MyQuery;Exit; $Rs = safe_r_sql($MyQuery); if (safe_num_rows($Rs) > 0) { $TmpTarget = '-----';