Пример #1
0
 public function Footer()
 {
     parent::Footer();
     $this->SetXY(IanseoPdf::sideMargin, $this->h - $this->savedBottomMargin);
     $this->MultiCell(70, 5, $this->copy2, 0, "L", 0);
     //$this->Line(195, $this->tMargin, 195, $this->tMargin+50);
     //$this->Line(195, $this->tMargin+60, 195, $this->tMargin+110);
     $this->StartTransform();
     $this->setXY(195, $this->tMargin + 50);
     $this->Rotate(90);
     $this->Cell(45, 5, get_text('OrgResponsible', 'Tournament'), 'T', 0, 'C');
     $this->setXY(195, $this->tMargin + 100);
     $this->Rotate(90);
     $this->Cell(45, 5, get_text('Judge', 'Tournament'), 'T', 0, 'C');
     $this->setXY(185, $this->tMargin + 175);
     $this->Rotate(90);
     $this->SetFont('barcode', '', 40);
     $this->Cell(65, 15, IsBlocked(BIT_BLOCK_REPORT) ? '*' . str_replace(".", "", $this->validationCode) . '*' : '', 0, 0, 'C');
     $this->setXY(185, $this->tMargin + 235);
     $this->Rotate(90);
     $this->SetFont($this->FontFix, 'B', 20);
     $this->Cell(50, 15, IsBlocked(BIT_BLOCK_REPORT) ? $this->validationCode : get_text('TourNoBlock', 'Tournament'), 0, 0, 'C');
     $this->StopTransform();
     if (!IsBlocked(BIT_BLOCK_REPORT)) {
         $this->WaterMark(get_text('TourNoBlock', 'Tournament'));
     }
 }
Пример #2
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
require_once 'Common/Lib/ArrTargets.inc.php';
require_once 'Common/Lib/Fun_PrintOuts.php';
$pdf = new ResultPDF(get_text('IndFinal'), false);
$pdf->setBarcodeHeader(70);
$CellH = 12;
$GoldW = ($pdf->GetPageWidth() - 3 * $pdf->getSideMargin()) / 2 * (1 / 18);
$ArrowTotW = ($pdf->GetPageWidth() - 3 * $pdf->getSideMargin()) / 2 * (9 / 18);
$TotalW = ($pdf->GetPageWidth() - 3 * $pdf->getSideMargin()) / 2 * (3 / 18);
$GridTotH = $pdf->GetPageheight() * 0.25;
$FillWithArrows = false;
if (isset($_REQUEST["ScoreFilled"]) && $_REQUEST["ScoreFilled"] == 1) {
    $FillWithArrows = true;
}
$pdf->PrintFlags = !empty($_REQUEST["ScoreFlags"]);
$NumColStd = 6;
$NumColField = 3;
$StdCols = 1;
$NumRow = 0;
$Fita3D = false;
/*$Select
		= "SELECT (TtElabTeam=0) as StdTournament, (TtCategory=8) as 3DTournament "
		. "FROM Tournament INNER JOIN Tournament*Type ON ToType=TtId "
		. "WHERE ToId=" . StrSafe_DB($_SESSION['TourId']) . " ";*/
$Select = "SELECT (ToElabTeam=0) as StdTournament, (ToCategory=8) as 3DTournament " . "FROM Tournament " . "WHERE ToId=" . StrSafe_DB($_SESSION['TourId']) . " ";
$RsTour = safe_r_sql($Select);
if (safe_num_rows($RsTour) == 1) {
Пример #3
0
include_once 'Common/Lib/ArrTargets.inc.php';
require_once 'Common/Fun_Phases.inc.php';
require_once 'Common/Lib/Fun_PrintOuts.php';
require_once 'Common/OrisFunctions.php';
require_once 'Common/pdf/PdfChunkLoader.php';
if (empty($_SESSION['TourId']) && !empty($_REQUEST['TourId'])) {
    CreateTourSession($_REQUEST['TourId']);
}
$Events = '';
if (isset($_REQUEST["Event"]) && $_REQUEST["Event"][0] != ".") {
    $Events = $_REQUEST["Event"];
}
$PdfData = getBracketsTeams($Events, false, isset($_REQUEST["ShowTargetNo"]), isset($_REQUEST["ShowSchedule"]), isset($_REQUEST["ShowSetArrows"]));
//debug_svela($PdfData);
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF($PdfData->Description);
}
//$pdf->SetAutoPageBreak(false);
require_once PdfChunkLoader('BracketTeam.inc.php');
if (!empty($_REQUEST['TourId'])) {
    EraseTourSession();
}
if (isset($__ExportPDF)) {
    $__ExportPDF = $pdf->Output('', 'S');
} elseif (!isset($isCompleteResultBook)) {
    if (isset($_REQUEST['ToFitarco'])) {
        $Dest = 'D';
        if (isset($_REQUEST['Dest'])) {
            $Dest = $_REQUEST['Dest'];
        }
        if ($Dest == 'S') {
Пример #4
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
define("HideCols", GetParameter("IntEvent"));
if (!isset($_REQUEST["Session"]) || !is_numeric($_REQUEST["Session"]) || !isset($_REQUEST["Distance"]) || !is_numeric($_REQUEST["Distance"])) {
    exit;
}
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text('StartlistSession', 'Tournament'));
}
/*$MyQuery = "SELECT EnCode as Bib, EnName AS Name, EnFirstName AS FirstName, SUBSTRING(QuTargetNo,1,1) AS Session, SUBSTRING(QuTargetNo,2," . (TargetNoPadding+1) . ") AS TargetNo, CoCode AS NationCode, CoName AS Nation, EnClass AS ClassCode, EnDivision AS DivCode,EnAgeClass as AgeClass,  EnSubClass as SubClass, ClDescription, DivDescription, EnStatus as Status, EnIndClEvent AS `IC`, EnTeamClEvent AS `TC`, EnIndFEvent AS `IF`, EnTeamFEvent as `TF`, EnTeamMixEvent as `TM`, ";
$MyQuery.= "QuD" . $_REQUEST["Distance"]. "Score AS Score, QuD" . $_REQUEST["Distance"]. "Gold as Gold, QuD" . $_REQUEST["Distance"]. "Xnine as Xnine,";
$MyQuery.= "QuD5Score, QuD5Rank, QuD6Score, QuD6Rank, QuD7Score, QuD7Rank, QuD8Score, QuD8Rank, ";
$MyQuery.= "ToType, TtGolds, TtXNine ";
$MyQuery.= "FROM Tournament AS t ";
$MyQuery.= "INNER JOIN Tournament*Type AS tt ON t.ToType=tt.TtId ";
$MyQuery.= "INNER JOIN Entries AS e ON t.ToId=e.EnTournament ";
$MyQuery.= "INNER JOIN Countries AS c ON e.EnCountry=c.CoId AND e.EnTournament=c.CoTournament ";
$MyQuery.= "INNER JOIN Qualifications AS q ON e.EnId=q.QuId ";
$MyQuery.= "INNER JOIN Classes AS cl ON e.EnClass=cl.ClId AND ClTournament=" . StrSafe_DB($_SESSION['TourId']) . " ";
$MyQuery.= "INNER JOIN Divisions AS d ON e.EnDivision=d.DivId AND DivTournament=" . StrSafe_DB($_SESSION['TourId']) . " ";
$MyQuery.= "WHERE EnAthlete=1 AND ToId = " . StrSafe_DB($_SESSION['TourId']) . " ";
$MyQuery.= "AND QuSession = " . StrSafe_DB($_REQUEST["Session"]) . " ";
$MyQuery.= "ORDER BY QuTargetNo, CoCode, Name, CoName, FirstName ";*/
$MyQuery = "SELECT EnCode as Bib, EnName AS Name, upper(EnFirstName) AS FirstName, SUBSTRING(QuTargetNo,1,1) AS Session, SUBSTRING(QuTargetNo,2," . (TargetNoPadding + 1) . ") AS TargetNo, CoCode AS NationCode, CoName AS Nation, EnClass AS ClassCode, EnDivision AS DivCode,EnAgeClass as AgeClass,  EnSubClass as SubClass, ClDescription, DivDescription, EnStatus as Status, EnIndClEvent AS `IC`, EnTeamClEvent AS `TC`, EnIndFEvent AS `IF`, EnTeamFEvent as `TF`, EnTeamMixEvent as `TM`, ";
$MyQuery .= "upper(right(QuTargetNo,1)) TargetLetter, QuD" . $_REQUEST["Distance"] . "Score AS Score, QuD" . $_REQUEST["Distance"] . "Gold as Gold, QuD" . $_REQUEST["Distance"] . "Xnine as Xnine,";
$MyQuery .= "QuD5Score, QuD5Rank, QuD6Score, QuD6Rank, QuD7Score, QuD7Rank, QuD8Score, QuD8Rank, ";
$MyQuery .= "ToType, ToGolds AS TtGolds, ToXNine AS TtXNine ";
$MyQuery .= "FROM Tournament AS t ";
Пример #5
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
$isCompleteResultBook = true;
$pdf = new ResultPDF(get_text('ResultClass', 'Tournament'));
include 'PrnIndividual.php';
$pdf->SetXY(10, $pdf->GetY() + 5);
include 'PrnTeam.php';
$pdf->Output();
Пример #6
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_once 'Common/Fun_FormatText.inc.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_Phases.inc.php';
$pdf = new ResultPDF(get_text('IndFinal'));
$pdf->setlinewidth(0.1);
//	$pdf->SetAutoPageBreak(false, 10);
$Score3D = false;
//$MyQuery = "SELECT (TtElabTeam=2) as is3D FROM Tournament INNER JOIN Tournament*Type AS tt ON ToType=TtId WHERE ToId=" . StrSafe_DB($_SESSION['TourId']);
$MyQuery = "SELECT (ToElabTeam=2) as is3D FROM Tournament WHERE ToId=" . StrSafe_DB($_SESSION['TourId']);
$Rs = safe_r_sql($MyQuery);
if (safe_num_rows($Rs) == 1) {
    $r = safe_fetch($Rs);
    $Score3D = $r->is3D;
}
//(1+1+1 gold)+(2+2+2 arrow)+(1+1 totalw)
$Fasi = array(get_text('64_Phase'), get_text('32_Phase'), get_text('16_Phase'), get_text('8_Phase'), get_text('4_Phase'), get_text('2_Phase'), get_text('0_Phase'));
$TgtNoFasi = array('s64', 's32', 's16', 's8', 's4', 's2', 'sGo');
//$NumFasi = array(64,48, 32,24, 16, 8, 4, 1);
$NumFasi = array(64, 32, 16, 8, 4, 2, 1);
$Start2FirstPhase = array(64 => 0, 48 => 0, 32 => 1, 24 => 1, 16 => 2, 8 => 3, 4 => 4, 2 => 5, 1 => 6, 0 => 6);
$MyQuery = "";
if (isset($_REQUEST['Blank'])) {
    $model = empty($_REQUEST['Model']) ? '' : $_REQUEST['Model'];
    $MyQuery = "SELECT '' AS EvCode, '' AS EvEventName, EvFinalFirstPhase, EvMatchMode, EvMatchArrowsNo, " . " '' AS GrPosition, '' AS Athlete, '' AS CoCode, '' AS CoName, 0 as isBye, " . " '' AS s64,'' AS s32, '' AS s16, '' AS s8, '' AS s4, '' AS s2, '' AS sBr, '' AS sGo, " . " EvElimEnds, EvElimArrows, EvElimSO, EvFinEnds, EvFinArrows, EvFinSO" . " from Events where " . ($model ? "EvCode='{$model}' and" : '') . " EvTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND EvTeamEvent=0 limit 1";
} else {
    $Events = array();
    if (!empty($_REQUEST['Event'])) {
        if (!is_array($_REQUEST['Event'])) {
Пример #7
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
$isCompleteResultBook = true;
$pdf = new ResultPDF(get_text('ResultClass', 'Tournament'));
include 'PrnIndividualAbs.php';
$pdf->SetXY(10, $pdf->GetY() + 5);
include 'PrnTeamAbs.php';
$pdf->DrawShootOffLegend();
$pdf->Output();
Пример #8
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_once 'Common/Fun_FormatText.inc.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Lib/ArrTargets.inc.php';
require_once 'Common/Fun_Phases.inc.php';
require_once 'Common/Lib/Fun_PrintOuts.php';
$pdf = new ResultPDF(get_text('IndFinal'), false);
$pdf->setBarcodeHeader(70);
$Score3D = false;
//$MyQuery = "SELECT (TtElabTeam=2) as is3D FROM Tournament INNER JOIN Tournament*Type AS tt ON ToType=TtId WHERE ToId=" . StrSafe_DB($_SESSION['TourId']);
$MyQuery = "SELECT (ToElabTeam=2) as is3D FROM Tournament WHERE ToId=" . StrSafe_DB($_SESSION['TourId']);
$Rs = safe_r_sql($MyQuery);
if (safe_num_rows($Rs) == 1) {
    $r = safe_fetch($Rs);
    $Score3D = $r->is3D;
}
if (!$Score3D) {
    define("CellH", 9);
} else {
    define("CellH", 6);
}
error_reporting(E_ALL);
$FillWithArrows = false;
if (isset($_REQUEST["ScoreFilled"]) && $_REQUEST["ScoreFilled"] == 1) {
    $FillWithArrows = true;
}
$pdf->PrintFlags = !empty($_REQUEST["ScoreFlags"]);
$MyQuery = "";
if (isset($_REQUEST['Blank'])) {
Пример #9
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
define("HideCols", GetParameter("IntEvent"));
$pdf = new ResultPDF(get_text('StartlistAlpha', 'Tournament'));
$MyQuery = "SELECT EnCode as Bib, EnName AS Name, upper(EnFirstName) AS FirstName, QuSession AS Session, SUBSTRING(QuTargetNo,2) AS TargetNo, CoCode AS NationCode, CoName AS Nation, EnClass AS ClassCode, EnDivision AS DivCode, EnAgeClass as AgeClass, EnSubClass as SubClass, EnStatus as Status, EnIndClEvent AS `IC`, EnTeamClEvent AS `TC`, EnIndFEvent AS `IF`, EnTeamFEvent as `TF`, EnTeamMixEvent as `TM`, ";
$MyQuery .= "ISNULL(DivId) as invalidDivision, (ISNULL(c1.ClId) OR  LOCATE(c2.ClId, c1.ClValidClass)=0) as invalidAgeClass, (ISNULL(c2.ClId) OR  LOCATE(c2.ClId, c1.ClValidClass)=0) as invalidClass ";
$MyQuery .= "FROM Entries AS e ";
$MyQuery .= "LEFT JOIN Countries AS c ON e.EnCountry=c.CoId AND e.EnTournament=c.CoTournament ";
$MyQuery .= "LEFT JOIN Qualifications AS q ON e.EnId=q.QuId ";
$MyQuery .= "LEFT JOIN Divisions ON e.EnTournament=DivTournament AND e.EnDivision=DivId ";
$MyQuery .= "LEFT JOIN Classes as c1 ON e.EnTournament=c1.ClTournament AND e.EnAgeClass=c1.ClId ";
$MyQuery .= "LEFT JOIN Classes as c2 ON e.EnTournament=c2.ClTournament AND e.EnClass=c2.ClId ";
$MyQuery .= "WHERE EnAthlete=1 AND EnTournament = " . StrSafe_DB($_SESSION['TourId']) . " ";
$MyQuery .= "AND (EnStatus!=0 OR (EnIndClEvent=0 AND EnTeamClEvent=0 AND EnIndFEvent=0 AND EnIndFEvent=0) OR EnCountry=0 OR DivId is null OR c1.ClId is null OR c2.ClId is null OR LOCATE(c2.ClId, c1.ClValidClass)=0) ";
if (isset($_REQUEST["Session"]) && is_numeric($_REQUEST["Session"])) {
    $MyQuery .= "AND QuSession = " . StrSafe_DB($_REQUEST["Session"]) . " ";
}
$MyQuery .= "ORDER BY Name, FirstName, TargetNo ";
$Rs = safe_r_sql($MyQuery);
if ($Rs) {
    $ShowStatusLegend = false;
    $FirstTime = true;
    while ($MyRow = safe_fetch($Rs)) {
        if ($FirstTime || !$pdf->SamePage(4)) {
            $TmpSegue = !$pdf->SamePage(4);
            $StartLetter = substr($MyRow->Name, 0, 1);
            $pdf->SetFont($pdf->FontStd, 'B', 10);
            $pdf->Cell(190, 6, get_text('PartecipantListError', 'Tournament'), 1, 1, 'C', 1);
            if ($TmpSegue) {
Пример #10
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Qualification/Fun_Qualification.local.inc.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_Phases.inc.php';
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text('StatEvents', 'Tournament'), true);
}
$listClDiv = array();
$DivArray = array();
$MyQuery = "SELECT DivId, ClId\r\n\tFROM Classes INNER JOIN Divisions ON DivTournament=ClTournament\r\n\tWHERE ClTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND (DivAthlete=1 and ClAthlete=1)\r\n\tORDER BY ClViewOrder, ClId, DivViewOrder, DivId ";
$Rs = safe_r_sql($MyQuery);
if (safe_num_rows($Rs) > 0) {
    while ($MyRow = safe_fetch($Rs)) {
        if (!array_key_exists($MyRow->ClId, $listClDiv)) {
            $listClDiv[$MyRow->ClId] = array();
        }
        if (!array_key_exists($MyRow->DivId, $listClDiv[$MyRow->ClId])) {
            $listClDiv[$MyRow->ClId][$MyRow->DivId] = array("I" => '', "S" => '');
        }
        if (!in_array($MyRow->DivId, $DivArray)) {
            $DivArray[] = $MyRow->DivId;
        }
    }
    safe_free_result($Rs);
}
//Parte per le premiazioni
$Sql = "SELECT EnDivision as Divisione, EnClass as Classe, SUM(EnIndClEvent) as QuantiInd, IFNULL(numTeam,0) AS QuantiSq\r\n\tFROM Entries\r\n\tinner join Divisions on EnDivision=DivId and DivAthlete=1 and DivTournament=" . StrSafe_DB($_SESSION['TourId']) . "\r\n\tinner join Classes on EnClass=ClId and ClAthlete=1 and ClTournament=" . StrSafe_DB($_SESSION['TourId']) . "\r\n\tLEFT JOIN (\r\n\t  SELECT sqDiv, sqCl, COUNT(sqQuanti) as numTeam\r\n\t  FROM\r\n\t    (SELECT EnDivision as sqDiv, EnClass as sqCl, COUNT(EnId) as sqQuanti\r\n\t    FROM Entries\r\n\t    WHERE EnTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND EnTeamClEvent=1\r\n\t    GROUP BY EnDivision, EnClass, IF(EnCountry2=0,EnCountry,EnCountry2), EnSubTeam\r\n\t    HAVING sqQuanti>=3) as sq\r\n\t  GROUP BY sqDiv, sqCl\r\n\t) AS sqy ON EnDivision=sqDiv AND EnClass=sqCl\r\n\tWHERE EnTournament=" . StrSafe_DB($_SESSION['TourId']) . "\r\n\tGROUP BY EnDivision, EnClass, numTeam";
$Rs = safe_r_sql($Sql);
if (safe_num_rows($Rs) > 0) {
Пример #11
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
$OpDetails = "Accreditation";
if (isset($_REQUEST["OperationType"])) {
    $OpDetails = $_REQUEST["OperationType"];
}
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text($OpDetails, 'Tournament'));
}
$TmpWhere = "";
if (isset($_REQUEST["ArcherName"]) && preg_match("/^[-,0-9A-Z]*\$/i", str_replace(" ", "", $_REQUEST["ArcherName"]))) {
    foreach (explode(",", $_REQUEST["ArcherName"]) as $Value) {
        $Tmp = NULL;
        if (preg_match("/^([0-9A-Z]*)\\-([0-9A-Z]*)\$/i", str_replace(" ", "", $Value), $Tmp)) {
            $TmpWhere .= "(EnFirstName >= " . StrSafe_DB(strtoupper($Tmp[1])) . " AND EnFirstName <= " . StrSafe_DB(strtoupper($Tmp[2] . chr(255))) . ") OR ";
        } else {
            $TmpWhere .= "EnFirstName LIKE " . StrSafe_DB(strtoupper(trim($Value)) . "%") . " OR ";
        }
    }
    $TmpWhere = substr($TmpWhere, 0, -3);
}
$MyQuery = "SELECT EnCode as Bib, EnName AS Name, left(EnFirstName,1) AS Initial, upper(EnFirstName) AS FirstName, QuSession AS Session, SUBSTRING(QuTargetNo,2) AS TargetNo, CoCode AS NationCode, CoName AS Nation, EnClass AS ClassCode, EnDivision AS DivCode, EnAgeClass as AgeClass, EnSubClass as SubClass, EnStatus as Status, EnIndClEvent AS `IC`, EnTeamClEvent AS `TC`, EnIndFEvent AS `IF`, EnTeamFEvent as `TF`, EnTeamMixEvent as `TM`, IF(AEId IS NULL, 0, 1) as OpDone ";
$MyQuery .= "FROM Entries AS e ";
$MyQuery .= "LEFT JOIN Countries AS c ON e.EnCountry=c.CoId AND e.EnTournament=c.CoTournament ";
$MyQuery .= "LEFT JOIN Qualifications AS q ON e.EnId=q.QuId ";
$MyQuery .= "LEFT JOIN AccEntries AS ae ON e.EnId=ae.AEId AND e.EnTournament=ae.AETournament ";
$MyQuery .= "AND ae.AEOperation=(SELECT AOTId FROM AccOperationType WHERE AOTDescr=" . StrSafe_DB($OpDetails) . ") ";
$MyQuery .= "WHERE EnAthlete=1 AND EnTournament = " . StrSafe_DB($_SESSION['TourId']) . " ";
Пример #12
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Lib/Obj_RankFactory.php';
require_once 'Common/Fun_FormatText.inc.php';
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text('MedalIndClass', 'Tournament'));
}
$rank = Obj_RankFactory::create('DivClass', array('dist' => 0, 'cutRank' => 3));
$rank->read();
$rankData = $rank->getData();
if (count($rankData['sections'])) {
    $DistSize = 12;
    $AddSize = 0;
    $pdf->setDocUpdate($rankData['meta']['lastUpdate']);
    foreach ($rankData['sections'] as $section) {
        //Calcolo Le Misure per i Campi
        if ($rankData['meta']['numDist'] >= 4 && !$rankData['meta']['double']) {
            $DistSize = 48 / $rankData['meta']['numDist'];
        } elseif ($rankData['meta']['numDist'] >= 4 && $rankData['meta']['double']) {
            $DistSize = 48 / ($rankData['meta']['numDist'] / 2 + 1);
        } else {
            $AddSize = (48 - $rankData['meta']['numDist'] * 12) / 2;
        }
        //Verifico se l'header e qualche riga ci stanno nella stessa pagina altrimenti salto alla prosisma
        if (!$pdf->SamePage(28)) {
            $pdf->AddPage();
        }
        writeGroupHeader($pdf, $section['meta'], $DistSize, $AddSize, $rankData['meta']['numDist'], $rankData['meta']['double'], false);
        foreach ($section['items'] as $item) {
Пример #13
0
        }
        if ($r->B) {
            $DayLastTargets[$r->FSScheduledDate] = max($r->B, $DayLastTargets[$r->FSScheduledDate]);
        }
    }
    $FirstTarget = min($DayFirstTargets);
    $LastTarget = max($DayLastTargets);
}
if (!$FirstTarget and !$LastTarget) {
    exit;
}
list($a, $FirstTarget) = each($DayFirstTargets);
list($a, $LastTarget) = each($DayLastTargets);
// $FirstTarget=1; // che senso ha???
// debug_svela($DayFirstTargets);
$pdf = new ResultPDF(get_text('FopSetup'), $LastTarget - $FirstTarget < 21);
error_reporting(E_ALL);
$pdf->SetCellPadding(0.25);
$DimTarget = min(10, ($pdf->getpagewidth() - 20 - ColName) / ($LastTarget - $FirstTarget + 1));
$MyQuery = "(SELECT '' as Warmup, FSEvent," . " FSTeamEvent," . " GrPhase," . " FsMatchNo," . " FsTarget," . " '' as TargetTo," . " EvMatchArrowsNo, EvMatchMode, EvMixedTeam, EvTeamEvent, " . " UNIX_TIMESTAMP(FSScheduledDate) as SchDate," . " DATE_FORMAT(FSScheduledTime,'" . get_text('TimeFmt') . "') as SchTime, " . " EvFinalFirstPhase," . " @bit:=pow(2, ceil(log2(GrPhase))+1) & EvMatchArrowsNo," . " IF(@bit=0,EvFinEnds,EvElimEnds) AS `ends`," . " IF(@bit=0,EvFinArrows,EvElimArrows) AS `arrows`," . " IF(@bit=0,EvFinSO,EvElimSO) AS `so`," . " EvMaxTeamPerson," . " FSScheduledDate," . " FSScheduledTime, EvDistance " . " FROM FinSchedule" . " INNER JOIN Grids ON FSMatchNo=GrMatchNo" . " INNER JOIN Events ON FSEvent=EvCode AND FSTeamEvent=EvTeamEvent AND FSTournament=EvTournament " . " WHERE FSTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND (FSScheduledDate!='0000-00-00' && (FSTarget*1)>0) AND GrPhase<=if(EvFinalFirstPhase=24, 32, if(EvFinalFirstPhase=48, 64, EvFinalFirstPhase)) " . ") UNION (" . "SELECT '1' as Warmup, '" . get_text('WarmUp', 'Tournament') . "'," . " ''," . " FwEvent ," . " ''," . " FwTargets, " . " FwOptions," . " '--' as EvMatchArrowsNo, 0 as EvMatchMode, 0, 0, " . " UNIX_TIMESTAMP(FwDay) as SchDate," . " DATE_FORMAT(FwTime,'" . get_text('TimeFmt') . "') as SchTime," . " 0," . " 0," . " 0 AS `ends`," . " 0 AS `arrows`," . " 0 AS `so`," . " 0," . " FwDay," . " FwTime, EvDistance " . " FROM FinWarmup" . " INNER JOIN Events ON FwEvent=EvCode AND FwTeamEvent=EvTeamEvent AND FwTournament=EvTournament " . " WHERE FwTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND FwDay>0 and FwTargets>''" . " )" . " ORDER BY FSScheduledDate ASC, FSScheduledTime ASC, Warmup ASC, FSTarget ASC, FSMatchNo ASC";
// 	debug_svela($MyQuery);
$Rs = safe_r_sql($MyQuery);
if (safe_num_rows($Rs) > 0) {
    $OldSched = '';
    $OldDate = '';
    $OldEvent = '';
    $OldTarget = '';
    $TmpColor = array(255, 255, 255);
    $PrintEvent = true;
    $TgText = '';
    $TgFirst = 0;
Пример #14
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('StartlistCountry', 'Tournament'));
}
$TmpWhere = "";
if (isset($_REQUEST["CountryName"]) && preg_match("/^[-,0-9A-Z]*\$/i", str_replace(" ", "", $_REQUEST["CountryName"]))) {
    foreach (explode(",", $_REQUEST["CountryName"]) as $Value) {
        $Tmp = NULL;
        if (preg_match("/^([A-Z0-9]*)\\-([A-Z0-9]*)\$/i", str_replace(" ", "", $Value), $Tmp)) {
            $TmpWhere .= "(CoCode >= " . StrSafe_DB(strtoupper($Tmp[1])) . " AND CoCode <= " . StrSafe_DB(strtoupper($Tmp[2] . chr(255))) . ") OR ";
        } else {
            $TmpWhere .= "CoCode LIKE " . StrSafe_DB(strtoupper(trim($Value)) . "%") . " OR ";
        }
    }
    $TmpWhere = substr($TmpWhere, 0, -3);
}
$MyQuery = "SELECT EnCode as Bib, EnName AS Name, upper(EnFirstName) AS FirstName, " . "QuSession AS Session, SUBSTRING(QuTargetNo,2) AS TargetNo, " . "CoCode AS NationCode, CoName AS Nation, EnClass AS ClassCode, " . "ClDescription, EnDivision AS DivCode, DivDescription, EnAgeClass as AgeClass, " . "EnSubClass as SubClass, EnStatus as Status, " . "EnIndClEvent AS `IC`, EnTeamClEvent AS `TC`, EnIndFEvent AS `IF`, EnTeamFEvent as `TF`, " . "PhPhoto ";
$MyQuery .= "FROM Entries AS e ";
$MyQuery .= "LEFT JOIN Photos AS ph ON e.EnId=ph.PhEnId ";
$MyQuery .= "LEFT JOIN Countries AS c ON e.EnCountry=c.CoId AND e.EnTournament=c.CoTournament ";
$MyQuery .= "LEFT JOIN Qualifications AS q ON e.EnId=q.QuId ";
$MyQuery .= "LEFT JOIN Divisions ON TRIM(EnDivision)=TRIM(DivId) AND EnTournament=DivTournament ";
$MyQuery .= "INNER JOIN Classes ON TRIM(EnClass)=TRIM(ClId) AND EnTournament=ClTournament ";
$MyQuery .= "WHERE EnAthlete=1 AND EnTournament = " . StrSafe_DB($_SESSION["TourId"]) . " ";
if (isset($_REQUEST["Session"]) && is_numeric($_REQUEST["Session"])) {
    $MyQuery .= "AND QuSession = " . StrSafe_DB($_REQUEST["Session"]) . " ";
}
Пример #15
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_Number.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
$OpDetails = "Accreditation";
if (isset($_REQUEST["OperationType"])) {
    $OpDetails = $_REQUEST["OperationType"];
}
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text($OpDetails, 'Tournament'));
}
/*
$MyQuery = 'SELECT DATE_FORMAT(AEWhen,\''.get_text('DateFmtDB').'\') as Data, QuSession as Turno, COUNT(EnId) as Accreditati, SUM(APPrice) as Totale'
        . ' FROM AccEntries'
        . ' INNER JOIN Entries ON AEId=EnId AND EnPays=1 AND AETournament = EnTournament'
        . ' INNER JOIN Qualifications ON EnId=QuId'
        . ' INNER JOIN AccPrice ON EnTournament=APTournament AND CONCAT(EnDivision,EnClass) LIKE APDivClass'
        . ' WHERE AETournament = ' . StrSafe_DB($_SESSION['TourId'])
		. ' AND AEOperation = (SELECT AOTId FROM AccOperationType WHERE AOTDescr=' . StrSafe_DB($OpDetails) . ')'
        . ' GROUP BY QuSession, DATE_FORMAT(AEWhen,\''.get_text('DateFmtDB').'\')'
        . ' ORDER BY Data ASC, Turno ASC';
*/
$MyQuery = 'SELECT DATE_FORMAT(AEWhen,\'' . get_text('DateFmtDB') . '\') as Data, QuSession as Turno, COUNT(EnId) as Accreditati, IF(EnPays=0,"NoPay",ifnull(APPrice,0)) as Prezzo, SUM(IF(EnPays=1,APPrice,0)) as Totale' . ' FROM AccEntries' . ' INNER JOIN Entries ON AEId=EnId /*AND EnPays=1*/ AND AETournament = EnTournament' . ' INNER JOIN Qualifications ON EnId=QuId' . ' LEFT JOIN AccPrice ON EnTournament=APTournament AND CONCAT(EnDivision,EnClass) LIKE APDivClass' . ' WHERE AETournament = ' . StrSafe_DB($_SESSION['TourId']) . ' AND AEOperation = (SELECT AOTId FROM AccOperationType WHERE AOTDescr=' . StrSafe_DB($OpDetails) . ')' . ' GROUP BY QuSession, EnPays, IF(EnPays=0,"NoPay",ifnull(APPrice,0)), DATE_FORMAT(AEWhen,\'' . get_text('DateFmtDB') . '\')' . ' ORDER BY Data ASC, Turno ASC, EnPays DESC, APPrice DESC';
//echo $MyQuery;exit;
$Rs = safe_r_sql($MyQuery);
if ($Rs) {
    $TotalDay = 0;
    $Total = 0;
    $OldDate = '';
Пример #16
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
include_once 'Common/pdf/ResultPDF.inc.php';
$pdf = new ResultPDF(get_text('FopSetup'), false);
define("ColName", 12);
define("RowH", 18);
$terne = array(array(0, 255, 0), array(255, 153, 255), array(255, 255, 204), array(153, 153, 255), array(255, 153, 0), array(204, 255, 204), array(51, 204, 204));
$ColorArray = $terne;
$ColorArray[] = array(198, 198, 198);
foreach ($terne as $col) {
    $ColorArray[] = array($col[1], $col[2], $col[0]);
}
foreach ($terne as $col) {
    $ColorArray[] = array($col[2], $col[0], $col[1]);
}
$ColorAssignment = array();
$OldSession = '';
$OldDist = '';
$OldTarget = '';
$TmpColor = array(255, 255, 255);
$SecondaryDistance = 0;
$TgText = '';
$TgFirst = 0;
$TgNo = 0;
$TgTop = 0;
$TopPos = 35 - RowH;
// select already assigned number of sessions with min and max target
$SesSql = safe_r_sql("select QuSession, min(cast( substr(QuTargetNo,2) as unsigned)) TargetMin, max(cast( substr(QuTargetNo,2) as unsigned)) TargetMax, ToNumDist from Qualifications inner join Entries on EnId=QuId inner join Tournament on EnTournament=ToId where EnTournament={$_SESSION['TourId']} and cast( substr(QuTargetNo,2) as unsigned)>0 group by QuSession");
while ($SesRow = safe_fetch($SesSql)) {
    // set the target dimention
Пример #17
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
$isCompleteResultBook = true;
$pdf = new ResultPDF(get_text('BrakRank'));
include './Individual/PrnBracket.php';
$pdf->AddPage();
include './Individual/PrnRanking.php';
$pdf->AddPage();
include './Team/PrnBracket.php';
$pdf->AddPage();
include './Team/PrnRanking.php';
$pdf->Output();
Пример #18
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
$OpDetails = "Accreditation";
if (isset($_REQUEST["OperationType"])) {
    $OpDetails = $_REQUEST["OperationType"];
}
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text($OpDetails, 'Tournament'));
}
$MyQuery = "SELECT EnCode as Bib, EnName AS Name, FirstName, SUBSTRING(AtTargetNo,1,1) AS Session, SUBSTRING(AtTargetNo,2," . (TargetNoPadding + 1) . ") AS TargetNo, CoCode AS NationCode, CoName AS Nation, EnClass AS ClassCode, EnDivision AS DivCode, EnAgeClass as AgeClass, EnSubClass as SubClass, EnStatus as Status, EnIndClEvent AS `IC`, EnTeamClEvent AS `TC`, EnIndFEvent AS `IF`, EnTeamFEvent as `TF`, EnTeamMixEvent as `TM`, if(AEId IS NULL, 0, 1) as OpDone ";
$MyQuery .= "FROM AvailableTarget at ";
$MyQuery .= "LEFT JOIN ";
$MyQuery .= "(SELECT QuTargetNo, EnId, EnCode, EnName, upper(EnFirstName) AS FirstName, CoCode, CoName, EnClass, EnDivision, EnAgeClass, EnSubClass, EnStatus, EnIndClEvent, EnTeamClEvent, EnIndFEvent, EnTeamFEvent, EnTeamMixEvent ";
$MyQuery .= "FROM Qualifications AS q  ";
$MyQuery .= "INNER JOIN Entries AS e ON q.QuId=e.EnId AND e.EnTournament= " . StrSafe_DB($_SESSION['TourId']) . " AND EnAthlete=1 ";
$MyQuery .= "INNER JOIN Countries AS c ON e.EnCountry=c.CoId AND e.EnTournament=c.CoTournament) as Sq ON at.AtTargetNo=Sq.QuTargetNo ";
$MyQuery .= "LEFT JOIN AccEntries AS ae ON Sq.EnId=ae.AEId AND at.AtTournament=ae.AETournament ";
$MyQuery .= "AND ae.AEOperation=(SELECT AOTId FROM AccOperationType WHERE AOTDescr=" . StrSafe_DB($OpDetails) . ") ";
$MyQuery .= "WHERE AtTournament = " . StrSafe_DB($_SESSION['TourId']) . " ";
if (isset($_REQUEST["Session"]) && is_numeric($_REQUEST["Session"])) {
    $MyQuery .= "AND SUBSTRING(AtTargetNo,1,1) = " . StrSafe_DB($_REQUEST["Session"]) . " ";
}
$MyQuery .= "ORDER BY AtTargetNo, CoCode, Name, CoName, FirstName ";
//echo $MyQuery;exit;
$Rs = safe_r_sql($MyQuery);
if ($Rs) {
    $ShowStatusLegend = false;
    $CurSession = -1;
Пример #19
0
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
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);
Пример #20
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
require_once 'Common/Lib/Fun_PrintOuts.php';
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text('MedalSqClass', 'Tournament'));
}
$MyQuery = "SELECT CoCode AS NationCode, CoName AS Nation, TeEvent, ClDescription, DivDescription, Quanti, upper(EnFirstName) as FirstName, EnName AS Name,  EnClass AS ClassCode, EnDivision AS DivCode,EnAgeClass as AgeClass,  EnSubClass as SubClass, ";
$MyQuery .= "QuScore, TeScore, TeRank, TeGold, TeXnine, ToGolds AS TtGolds, ToXNine AS TtXNine  ";
$MyQuery .= "FROM Tournament AS t ";
$MyQuery .= "INNER JOIN Teams AS te ON t.ToId=te.TeTournament AND te.TeFinEvent=0 ";
$MyQuery .= "INNER JOIN Countries AS c ON te.TeCoId=c.CoId AND te.TeTournament=c.CoTournament ";
$MyQuery .= "INNER JOIN (SELECT TcCoId, TcEvent, TcTournament, TcFinEvent, COUNT(TcId) as Quanti FROM TeamComponent GROUP BY TcCoId, TcEvent, TcTournament, TcFinEvent) AS sq ON te.TeCoId=sq.TcCoId AND te.TeEvent=sq.TcEvent AND te.TeTournament=sq.TcTournament AND te.TeFinEvent=sq.TcFinEvent ";
$MyQuery .= "INNER JOIN TeamComponent AS tc ON te.TeCoId=tc.TcCoId AND te.TeEvent=tc.TcEvent AND te.TeTournament=tc.TcTournament AND te.TeFinEvent=tc.TcFinEvent ";
$MyQuery .= "INNER JOIN Entries AS en ON tc.TcId=en.EnId ";
$MyQuery .= "INNER JOIN Qualifications AS q ON en.EnId=q.QuId ";
$MyQuery .= "INNER JOIN (select concat(DivId, ClId) DivClass, Divisions.*, Classes.* from Divisions inner join Classes on DivTournament=ClTournament where DivAthlete and ClAthlete) DivClass on te.TeEvent=DivClass and te.TeTournament=DivTournament ";
$MyQuery .= "WHERE ToId = " . StrSafe_DB($_SESSION['TourId']) . " ";
if (isset($_REQUEST["Definition"])) {
    $MyQuery .= "AND te.TeEvent LIKE " . StrSafe_DB($_REQUEST["Definition"]) . " ";
}
if (isset($_REQUEST["Classes"])) {
    $MyQuery .= CleanEvents($_REQUEST["Classes"], 'ClId');
}
if (isset($_REQUEST["Divisions"])) {
    $MyQuery .= CleanEvents($_REQUEST["Classes"], 'DivId');
}
$MyQuery .= "ORDER BY DivViewOrder, ClViewOrder, TeScore DESC, TeGold DESC, TeXnine DESC, NationCode, TcOrder ";
//debug_svela($MyQuery);
Пример #21
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
define("HideCols", GetParameter("IntEvent"));
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text('StartlistCountry', 'Tournament'));
}
$TmpWhere = "";
if (isset($_REQUEST["CountryName"]) && preg_match("/^[-,0-9A-Z]*\$/i", str_replace(" ", "", $_REQUEST["CountryName"]))) {
    foreach (explode(",", $_REQUEST["CountryName"]) as $Value) {
        $Tmp = NULL;
        if (preg_match("/^([A-Z0-9]*)-([A-Z0-9]*)\$/i", str_replace(" ", "", $Value), $Tmp)) {
            $TmpWhere .= "(CoCode >= " . StrSafe_DB(stripslashes($Tmp[1])) . " AND CoCode <= " . StrSafe_DB(stripslashes($Tmp[2] . chr(255))) . ") OR ";
        } else {
            $TmpWhere .= "CoCode LIKE " . StrSafe_DB(stripslashes(trim($Value)) . "%") . " OR ";
        }
    }
    $TmpWhere = substr($TmpWhere, 0, -3);
}
$MyQuery = "(SELECT EnCode as Bib, EnName AS Name, upper(EnFirstName) AS FirstName, QuSession AS Session, QuTargetNo, SUBSTRING(QuTargetNo,2) AS TargetNo, CoCode AS NationCode, CoName AS Nation, EnSubTeam, EnClass AS ClassCode, ClDescription, EnDivision AS DivCode, DivDescription, EnAgeClass as AgeClass, EnSubClass as SubClass, EnStatus as Status, EnIndClEvent AS `IC`, EnTeamClEvent AS `TC`, EnIndFEvent AS `IF`, EnTeamFEvent as `TF`, EnTeamMixEvent as `TM`, IF(EnCountry2=0,0,1) as secTeam ";
$MyQuery .= "FROM Entries AS e ";
$MyQuery .= "LEFT JOIN Countries AS c ON e.EnCountry=c.CoId AND e.EnTournament=c.CoTournament ";
$MyQuery .= "LEFT JOIN Qualifications AS q ON e.EnId=q.QuId ";
$MyQuery .= "LEFT JOIN Divisions ON TRIM(EnDivision)=TRIM(DivId) AND EnTournament=DivTournament ";
$MyQuery .= "LEFT JOIN Classes ON TRIM(EnClass)=TRIM(ClId) AND EnTournament=ClTournament ";
$MyQuery .= "WHERE EnTournament = " . StrSafe_DB($_SESSION['TourId']) . " ";
$MyQuery .= " AND QuSession >0 ";
if (isset($_REQUEST["Session"]) && is_numeric($_REQUEST["Session"])) {
    $MyQuery .= "AND QuSession = " . StrSafe_DB($_REQUEST["Session"]) . " ";
Пример #22
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
require_once 'Common/Fun_Phases.inc.php';
$pdf = new ResultPDF(get_text('TeamFinal'), true);
$pdf->setlinewidth(0.1);
$GoldW = ($pdf->GetPageWidth() - 3 * $pdf->getSideMargin()) / 2 * (1 / 18);
$ArrowTotW = ($pdf->GetPageWidth() - 3 * $pdf->getSideMargin()) / 2 * (9 / 18);
$TotalW = ($pdf->GetPageWidth() - 3 * $pdf->getSideMargin()) / 2 * (3 / 18);
$GridHeight = ($pdf->GetPageHeight() - 90) / 2;
$StdCols = 1;
$NumRow = 4;
$CellH = 7;
/*$Select
		= "SELECT (TtElabTeam=0) as StdTournament, (TtElabTeam=2) as ThreeDTournament "
		. "FROM Tournament INNER JOIN Tournament*Type ON ToType=TtId "
		. "WHERE ToId=" . StrSafe_DB($_SESSION['TourId']) . " ";*/
$Select = "SELECT (ToElabTeam=0) as StdTournament, (ToElabTeam=2) as ThreeDTournament " . "FROM Tournament " . "WHERE ToId=" . StrSafe_DB($_SESSION['TourId']) . " ";
$RsTour = safe_r_sql($Select);
if (safe_num_rows($RsTour) == 1) {
    $r = safe_fetch($RsTour);
    $StdCols = $r->StdTournament;
    $NumRow = $r->ThreeDTournament;
    safe_free_result($RsTour);
}
$NumRow = $NumRow == 1 ? 8 : 4;
$Fasi = array(get_text('8_Phase'), get_text('4_Phase'), get_text('2_Phase'), get_text('0_Phase'));
$TgtNoFasi = array('s8', 's4', 's2', 'sGo');
$Start2FirstPhase = array(8 => 0, 4 => 1, 2 => 2, 1 => 3, 0 => 3);
Пример #23
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
$OpDetails = "Accreditation";
if (isset($_REQUEST["OperationType"])) {
    $OpDetails = $_REQUEST["OperationType"];
}
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text($OpDetails, 'Tournament'));
}
$TmpWhere = "";
if (isset($_REQUEST["CountryName"]) && preg_match("/^[-,0-9A-Z]*\$/i", str_replace(" ", "", $_REQUEST["CountryName"]))) {
    foreach (explode(",", $_REQUEST["CountryName"]) as $Value) {
        $Tmp = NULL;
        if (preg_match("/^([A-Z0-9]*)\\-([A-Z0-9]*)\$/i", str_replace(" ", "", $Value), $Tmp)) {
            $TmpWhere .= "(CoCode >= " . StrSafe_DB(strtoupper($Tmp[1])) . " AND CoCode <= " . StrSafe_DB(strtoupper($Tmp[2] . chr(255))) . ") OR ";
        } else {
            $TmpWhere .= "CoCode LIKE " . StrSafe_DB(strtoupper(trim($Value)) . "%") . " OR ";
        }
    }
    $TmpWhere = substr($TmpWhere, 0, -3);
}
$NoPhoto = !empty($_REQUEST['NoPhoto']);
$MyQuery = "SELECT EnCode as Bib, length(PhPhoto)>1 as HasPhoto, EnName AS Name, upper(EnFirstName) AS FirstName, QuSession AS Session, SUBSTRING(QuTargetNo,2) AS TargetNo, CoCode AS NationCode, CoName AS Nation, EnClass AS ClassCode, EnDivision AS DivCode, EnAgeClass as AgeClass, EnSubClass as SubClass, EnStatus as Status, EnIndClEvent AS `IC`, EnTeamClEvent AS `TC`, EnIndFEvent AS `IF`, EnTeamFEvent as `TF`, EnTeamMixEvent as `TM`, if(AEId IS NULL, 0, 1) as OpDone, IF(NoMember=NoOpDone,1,0) as TeamComplete ";
$MyQuery .= "FROM Entries AS e ";
$MyQuery .= "LEFT JOIN Photos ON e.EnId=PhEnId ";
$MyQuery .= "LEFT JOIN Countries AS c ON e.EnCountry=c.CoId AND e.EnTournament=c.CoTournament ";
$MyQuery .= "LEFT JOIN Qualifications AS q ON e.EnId=q.QuId ";
$MyQuery .= "LEFT JOIN AccEntries AS ae ON e.EnId=ae.AEId AND e.EnTournament=ae.AETournament ";
Пример #24
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text('StatClasses', 'Tournament'), false);
}
$SesArray = array();
$DivArray = array();
$TotArray = array();
$SesFields = array();
$MyQuery = "SELECT DISTINCT QuSession " . "FROM Qualifications INNER JOIN Entries ON QuId = EnId AND EnTournament = " . StrSafe_DB($_SESSION['TourId']) . " " . "ORDER BY QuSession";
$Rs = safe_r_sql($MyQuery);
while ($MyRow = safe_fetch($Rs)) {
    $SesArray[] = $MyRow->QuSession;
}
safe_free_result($Rs);
$Sql = "SELECT ";
$MyQuery = "SELECT DISTINCT EnDivision FROM Entries LEFT JOIN Divisions ON EnDivision=DivId AND DivTournament=" . StrSafe_DB($_SESSION['TourId']) . " " . "WHERE EnTournament = " . StrSafe_DB($_SESSION['TourId']) . " ORDER BY LENGTH(EnDivision) DESC, DivViewOrder";
$Rs = safe_r_sql($MyQuery);
while ($MyRow = safe_fetch($Rs)) {
    $DivArray[] = trim($MyRow->EnDivision) != '' ? $MyRow->EnDivision : '--';
    foreach ($SesArray as $Value) {
        $Sql .= "SUM(IF(TRIM(EnDivision)='" . trim($MyRow->EnDivision) . "' AND QuSession='" . $Value . "',1,0)) as `" . (trim($MyRow->EnDivision) != '' ? $MyRow->EnDivision : '--') . $Value . "`, ";
        $SesFields[] = (trim($MyRow->EnDivision) != '' ? $MyRow->EnDivision : '--') . $Value;
    }
}
safe_free_result($Rs);
$SqlEmpty = $Sql;
$Sql .= "ClId " . "FROM Classes " . "LEFT JOIN Entries ON TRIM(ClId) = TRIM(EnClass) AND ClTournament=EnTournament " . "LEFT JOIN Qualifications ON EnId = QuId " . "WHERE EnTournament = " . StrSafe_DB($_SESSION['TourId']) . " " . "GROUP BY ClId " . "ORDER BY ClViewOrder";
$SqlEmpty .= "'--' AS ClId " . "FROM Entries " . "LEFT JOIN Qualifications ON EnId = QuId " . "WHERE EnTournament = " . StrSafe_DB($_SESSION['TourId']) . " AND EnClass='' " . "GROUP BY EnClass ";
Пример #25
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)) {
Пример #26
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
define("HideCols", GetParameter("IntEvent"));
$CatJudge = isset($_REQUEST['judge']);
$CatDos = isset($_REQUEST['dos']);
$CatJury = isset($_REQUEST['jury']);
$CatOC = isset($_REQUEST['oc']);
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text('StaffOnField', 'Tournament'), true, '', false);
}
$Ses = StrSafe_DB($_SESSION['TourId']);
$Filter = array();
if ($CatJudge) {
    $Filter[] = " ItJudge<>0 ";
}
if ($CatDos) {
    $Filter[] = " ItDoS<>0 ";
}
if ($CatJury) {
    $Filter[] = " ItJury<>0 ";
}
if ($CatOC) {
    $Filter[] = " ItOC<>0 ";
}
if (count($Filter) > 0) {
    $Filter = "AND (" . implode(" OR ", $Filter) . ") ";
} else {
    $Filter = "";
Пример #27
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
require_once 'Common/OrisFunctions.php';
require_once 'Common/pdf/PdfChunkLoader.php';
// ATTENTION!
// MUST BE called $PdfData
$PdfData = getStatEntriesByCountries();
//debug_svela($PdfData);
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF($PdfData->Description, false);
}
require_once PdfChunkLoader('StatByCountry.inc.php');
if (!isset($isCompleteResultBook)) {
    if (isset($_REQUEST['ToFitarco'])) {
        $Dest = 'D';
        if (isset($_REQUEST['Dest'])) {
            $Dest = $_REQUEST['Dest'];
        }
        $pdf->Output($_REQUEST['ToFitarco'], $Dest);
    } else {
        $pdf->Output();
    }
}
Пример #28
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
require_once 'Common/OrisFunctions.php';
require_once 'Common/pdf/PdfChunkLoader.php';
// ATTENTION!
// MUST BE called $PdfData
$PdfData = getStartList(false, '', true);
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text('StartlistSession', 'Tournament') . ' - ' . get_text('Elimination'));
}
require_once PdfChunkLoader('ElimStartList.inc.php');
if (!isset($isCompleteResultBook)) {
    $pdf->Output();
}
Пример #29
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_Number.inc.php';
$OpDetails = "Accreditation";
if (isset($_REQUEST["OperationType"])) {
    $OpDetails = $_REQUEST["OperationType"];
}
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text('StartlistCountry', 'Tournament'));
}
$TmpWhere = "";
if (isset($_REQUEST["CountryName"]) && preg_match("/^[-,0-9A-Z]*\$/i", str_replace(" ", "", $_REQUEST["CountryName"]))) {
    foreach (explode(",", $_REQUEST["CountryName"]) as $Value) {
        $Tmp = NULL;
        if (preg_match("/^([A-Z0-9]*)\\-([A-Z0-9]*)\$/i", str_replace(" ", "", $Value), $Tmp)) {
            $TmpWhere .= "(CoCode >= " . StrSafe_DB(strtoupper($Tmp[1])) . " AND CoCode <= " . StrSafe_DB(strtoupper($Tmp[2] . chr(255))) . ") OR ";
        } else {
            $TmpWhere .= "CoCode LIKE " . StrSafe_DB(strtoupper(trim($Value)) . "%") . " OR CONCAT(EnFirstName, ' ', EnName) LIKE " . StrSafe_DB(strtoupper(trim($Value)) . "%") . " OR ";
        }
    }
    $TmpWhere = substr($TmpWhere, 0, -3);
}
$MyQuery = "SELECT EnCode as Bib, EnPays,EnName AS Name, upper(EnFirstName) AS FirstName, QuSession AS Session, SUBSTRING(QuTargetNo,2) AS TargetNo, CoCode AS NationCode, CoName AS Nation, EnClass AS ClassCode, EnDivision AS DivCode, EnAgeClass as AgeClass, EnSubClass as SubClass, EnStatus as Status, EnIndClEvent AS `IC`, EnTeamClEvent AS `TC`, EnIndFEvent AS `IF`, EnTeamFEvent as `TF`, EnTeamMixEvent as `TM`, APPrice ";
$MyQuery .= "FROM Entries AS e ";
$MyQuery .= "INNER JOIN Countries AS c ON e.EnCountry=c.CoId AND e.EnTournament=c.CoTournament ";
$MyQuery .= "INNER JOIN Qualifications AS q ON e.EnId=q.QuId ";
$MyQuery .= "INNER JOIN AccEntries AS ae ON e.EnId=ae.AEId AND e.EnTournament=ae.AETournament ";
$MyQuery .= "AND ae.AEOperation=(SELECT AOTId FROM AccOperationType WHERE AOTDescr=" . StrSafe_DB($OpDetails) . ") ";
$MyQuery .= "INNER JOIN AccPrice AS ap ON CONCAT(EnDivision,EnClass) LIKE ap.APDivClass AND e.EnTournament=ap.APTournament ";
Пример #30
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
include_once 'Common/pdf/ResultPDF.inc.php';
$pdf = new ResultPDF(get_text('FopSetup'), false);
define("ColName", 22);
define("RowH", 18);
$terne = array(array(0, 255, 0), array(255, 153, 255), array(255, 255, 204), array(153, 153, 255), array(255, 153, 0), array(204, 255, 204), array(51, 204, 204));
$ColorArray = $terne;
$ColorArray[] = array(198, 198, 198);
foreach ($terne as $col) {
    $ColorArray[] = array($col[1], $col[2], $col[0]);
}
foreach ($terne as $col) {
    $ColorArray[] = array($col[2], $col[0], $col[1]);
}
$ColorAssignment = array();
$FirstTarget = 1;
$LastTarget = 99;
$NumDistances = 1;
$MyQuery = "SELECT MIN(SUBSTRING(AtTargetNo,2," . TargetNoPadding . ")*1) AS A, MAX(SUBSTRING(AtTargetNo,2," . TargetNoPadding . ")*1) AS B, MAX(ToNumDist) as NumDistanze" . " FROM Tournament" . " INNER JOIN AvailableTarget On ToId = AtTournament" . " WHERE ToId=" . StrSafe_DB($_SESSION['TourId']);
//echo $MyQuery;exit();
$Rs = safe_r_sql($MyQuery);
if (safe_num_rows($Rs) == 1) {
    $r = safe_fetch($Rs);
    $FirstTarget = $r->A;
    $LastTarget = $r->B;
    $NumDistances = $r->NumDistanze;
    //safe_free_result($Rs);
}
$DimTarget = ($pdf->GetPageWidth() - 42) / ($LastTarget - $FirstTarget + 1);