コード例 #1
0
ファイル: Cardx6.php プロジェクト: brian-nelson/ianseo
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/LabelPDF.inc.php';
require_once 'CommonCard.php';
$Rs = safe_r_sql($MyQuery);
if (!safe_num_rows($Rs)) {
    include 'Common/Templates/head-popup.php';
    echo '<table height="' . ($_SESSION['WINHEIGHT'] - 50) . '" width="100%"><tr><td>';
    echo '<div align="center">' . get_text('BadgeNoData', 'Tournament') . '';
    echo '<br/><br/><input type="button" onclick="window.close();" value="' . get_text('Close') . '">';
    echo '</td></tr></table>';
    include 'Common/Templates/tail-popup.php';
    die;
}
$pdf = new LabelPDF();
$pdf->SetAutoPageBreak(false);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$cntPass = 0;
$ImgSxSize = NULL;
$ImgDxSize = NULL;
$ImgLowSize = NULL;
if (!empty($pdf->ToPaths['ToLeft'])) {
    $ImgSxSize = getimagesize($pdf->ToPaths['ToLeft']);
}
if (!empty($pdf->ToPaths['ToRight'])) {
    $ImgDxSize = getimagesize($pdf->ToPaths['ToRight']);
}
if (!empty($pdf->ToPaths['ToBottom'])) {
    $ImgLowSize = getimagesize($pdf->ToPaths['ToBottom']);
コード例 #2
0
ファイル: index.php プロジェクト: brian-nelson/ianseo
$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"]) . " ";
}
if ($TmpWhere != "") {
    $MyQuery .= "AND (" . $TmpWhere . ")";
}
$MyQuery .= "ORDER BY QuSession, FirstName, Name, TargetNo ";
//print $MyQuery;exit;
//print '<br><br>'.$MyQuery;exit;
$PosX = array(6, 111, 6, 111);
$PosY = array(6, 6, 155, 155);
//echo $MyQuery;
$Rs = safe_r_sql($MyQuery);
if (safe_num_rows($Rs) > 0) {
    $pdf = new LabelPDF();
    // 'P','mm','A4');
    $pdf->AliasNbPages();
    $pdf->setPrintHeader(false);
    $pdf->setPrintFooter(false);
    $pdf->SetMargins(6, 6, 6);
    $pdf->SetAutoPageBreak(false, 15);
    $pdf->SetTextColor(0x0, 0x0, 0x0);
    $i = 0;
    while ($MyRow = safe_fetch($Rs)) {
        $pdf->SetFont($pdf->FontStd, 'B', 18);
        if ($i % 4 == 0) {
            $pdf->AddPage();
            //Crop Mark
            $pdf->Line(2, 148.5, 5, 148.5);
            $pdf->Line(103, 148.5, 107, 148.5);
コード例 #3
0
ファイル: PrnLabels.php プロジェクト: brian-nelson/ianseo
---Label Width 	* 	2.5935
---Label Height 	Detail – Height 	1
Top Margin 	Report – Top Margin 	0.5
Right Margin 	Report – Right Margin 	0.5
Bottom Margin 	Report – Bottom Margin 	0.1875
Left Margin 	Report – Left Margin 	0.1875
Columns 	Report – Column Count 	3
Horizontal Spacing 	Report – Column Spacing 	0.15625
*
*/
$OpDetails = "Accreditation";
if (isset($_REQUEST["OperationType"])) {
    $OpDetails = $_REQUEST["OperationType"];
}
if (CheckTourSession()) {
    $pdf = new LabelPDF();
    //Predefinita per etichette A4
    $lblW = $pdf->GetPageWidth() / 3;
    $lblH = $pdf->GetPageHeight() / 8;
    $lblMarginH = 2;
    $lblMarginV = 2;
    $lblSpaceV = 0;
    $lblSpaceH = 0;
    $pageMarginT = 0;
    $pageMarginL = 0;
    $Label4Column = 3;
    $Label4Page = 24;
    $printBarcode = true;
    if (intval($pdf->GetPageWidth()) == 210 && intval($pdf->GetPageHeight()) == 297) {
        $lblMarginH = 4;
        $lblMarginV = 4;
コード例 #4
0
if (isset($_REQUEST["OperationType"])) {
    $OpDetails = $_REQUEST["OperationType"];
}
if ($_POST) {
    require_once 'Common/pdf/LabelPDF.inc.php';
    $IncludeBarCode = true;
    $MarLeftRight = 0;
    $MarTop = 0;
    $MarBottom = 0;
    $StickXRows = 0;
    $StickXCols = 0;
    $ColIntMargin = 0;
    $RowIntMargin = 0;
    $PaperHeight = 0;
    $PaperWidth = 0;
    $pdf = new LabelPDF();
    $lblW = $pdf->GetPageWidth() / 3;
    $lblH = $pdf->GetPageHeight() / 8;
    $lblSp = $lblH * 0.05;
    $MyQuery = "SELECT EnId, EnName AS Name, upper(EnFirstName) AS 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, EnStatus as Status, EnIndClEvent AS `IC`, EnTeamClEvent AS `TC`, EnIndFEvent AS `IF`, EnTeamFEvent as `TF`, if(AEId IS NULL, 0, 1) as OpDone ";
    $MyQuery .= "FROM AvailableTarget at ";
    $MyQuery .= "INNER JOIN Qualifications AS q ON at.AtTargetNo=q.QuTargetNo ";
    $MyQuery .= "INNER JOIN Entries AS e ON q.QuId=e.EnId AND e.EnTournament=at.AtTournament AND EnAthlete=1 ";
    $MyQuery .= "INNER JOIN Countries AS c ON e.EnCountry=c.CoId AND e.EnTournament=c.CoTournament ";
    $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 AtTournament = " . StrSafe_DB($_SESSION['TourId']) . " ";
    if (isset($_REQUEST["Session"]) && is_numeric($_REQUEST["Session"])) {
        $MyQuery .= "AND SUBSTRING(AtTargetNo,1,1) = " . StrSafe_DB($_REQUEST["Session"]) . " ";
    }
    //$MyQuery .= "AND AtTargetNo IN ('145B','145D','146D','149D','151C','152A') ";
コード例 #5
0
ファイル: PrnLabels.php プロジェクト: brian-nelson/ianseo
---Label Width 	* 	2.5935
---Label Height 	Detail – Height 	1
Top Margin 	Report – Top Margin 	0.5
Right Margin 	Report – Right Margin 	0.5
Bottom Margin 	Report – Bottom Margin 	0.1875
Left Margin 	Report – Left Margin 	0.1875
Columns 	Report – Column Count 	3
Horizontal Spacing 	Report – Column Spacing 	0.15625
*
*/
$OpDetails = "Accreditation";
if (isset($_REQUEST["OperationType"])) {
    $OpDetails = $_REQUEST["OperationType"];
}
if (CheckTourSession()) {
    $pdf = new LabelPDF();
    //Predefinita per etichette A4
    $lblW = $pdf->GetPageWidth() / 3;
    $lblH = $pdf->GetPageHeight() / 8;
    $lblMarginH = 2;
    $lblMarginV = 2;
    $lblSpaceV = 0;
    $lblSpaceH = 0;
    $pageMarginT = 0;
    $pageMarginL = 0;
    $Label4Column = 3;
    $Label4Page = 24;
    $printBarcode = true;
    if (intval($pdf->GetPageWidth()) == 210 && intval($pdf->GetPageHeight()) == 297) {
        $lblMarginH = 4;
        $lblMarginV = 4;
コード例 #6
0
ファイル: PrnGetScore.php プロジェクト: brian-nelson/ianseo
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/LabelPDF.inc.php';
require_once 'Common/Fun_Sessions.inc.php';
$Indices = array('bis', 'ter', 'quat', 'quin', 'sex', 'sept', 'oct');
if (CheckTourSession()) {
    $pdf = new LabelPDF();
    $ath4target = 0;
    $ses = GetSessions('Q');
    foreach ($ses as $s) {
        $ath4target = max($ath4target, $s->SesAth4Target);
    }
    $MyQuery = "SELECT EnName AS Name, EnFirstName AS FirstName, SUBSTRING(ElTargetNo,1,1) AS Session, SUBSTRING(ElTargetNo,2,2) AS TargetNo,  SUBSTRING(ElTargetNo,-1,1) AS BackNo " . " FROM Eliminations AS q  " . " INNER JOIN Entries AS e ON q.ElId=e.EnId AND EnAthlete=1 " . " INNER JOIN Countries AS c ON e.EnCountry=c.CoId AND e.EnTournament=c.CoTournament " . " LEFT JOIN Session ON ElSession=SesOrder AND ElTournament=SesTournament AND SesType='E' " . " WHERE EnTournament =  " . StrSafe_DB($_SESSION['TourId']) . ' ' . (!(empty($_REQUEST['x_From']) && empty($_REQUEST['x_To'])) ? " AND ElTargetNo>='" . str_pad($_REQUEST['x_From'], '3', '0', STR_PAD_LEFT) . "A' AND ElTargetNo<='" . str_pad($_REQUEST['x_To'], '3', '0', STR_PAD_LEFT) . "Z' AND ElElimPhase= " . $_REQUEST['x_Session'] . " " : "") . (!empty($_REQUEST['x_ElimSession']) ? " AND ElSession=" . $_REQUEST['x_ElimSession'] . " " : "") . ' ORDER BY ElSession, SesOrder, ElElimPhase, ElTargetNo ASC, EnFirstName, EnName, CoCode';
    //echo $MyQuery;exit;
    $Rs = safe_r_sql($MyQuery);
    if ($Rs) {
        $Etichetta = -1;
        $CurrentTarget = 0;
        $NewTarget = true;
        $CurHeight = 0;
        $BlockHeight = ($pdf->getPageHeight() - 30) / 4;
        $CellHeight = $BlockHeight / ($ath4target + 1);
        while ($MyRow = safe_fetch($Rs)) {
            $NumEnd = $MyRow->Session == 0 ? 12 : 8;
            $TargetToPrint = $MyRow->TargetNo;
            $NumTarget = intval($MyRow->TargetNo);
            if ($NumTarget > $NumEnd) {
                $NumTarget = ($NumTarget - 1) % $NumEnd + 1;
            }
            if ($MyRow->TargetNo and $NumTarget != intval($MyRow->TargetNo)) {
コード例 #7
0
ファイル: PrnLabels.php プロジェクト: brian-nelson/ianseo
*
* Page / Label Dimensions  	Report Builder Fields  	Avery 5160 (inches)
---Page Width 	Report – Page Width 	8.5
---Page Height 	Report – Page Height 	11
---Label Width 	* 	2.5935
---Label Height 	Detail – Height 	1
Top Margin 	Report – Top Margin 	0.5
Right Margin 	Report – Right Margin 	0.5
Bottom Margin 	Report – Bottom Margin 	0.1875
Left Margin 	Report – Left Margin 	0.1875
Columns 	Report – Column Count 	3
Horizontal Spacing 	Report – Column Spacing 	0.15625
*
*/
if (CheckTourSession()) {
    $pdf = new LabelPDF();
    //Predefinita per etichette A4
    $lblW = $pdf->GetPageWidth() / 3;
    $lblH = $pdf->GetPageHeight() / 8;
    $lblMarginH = 2;
    $lblMarginV = 2;
    $lblSpaceV = 0;
    $lblSpaceH = 0;
    $pageMarginT = 0;
    $pageMarginL = 0;
    $Label4Column = 3;
    $Label4Page = 24;
    $printBarcode = true;
    if (intval($pdf->GetPageWidth()) == 210 && intval($pdf->GetPageHeight()) == 297) {
        $lblMarginH = 4;
        $lblMarginV = 4;
コード例 #8
0
ファイル: CardCustom.php プロジェクト: brian-nelson/ianseo
$AcMeal = getimagesize($CFG->DOCUMENT_PATH . 'Common/Images/AcMeal.png');
$AcAccomodation = getimagesize($CFG->DOCUMENT_PATH . 'Common/Images/AcAccomodation.png');
$AcHeight = $AcAccomodation[1];
$OffsetX = explode(';', $_REQUEST['IdCardsSettings']['OffsetX']);
$OffsetY = explode(';', $_REQUEST['IdCardsSettings']['OffsetY']);
$PageWidth = $_REQUEST['IdCardsSettings']['PaperWidth'];
$PageHeight = $_REQUEST['IdCardsSettings']['PaperHeight'];
foreach ($OffsetY as $y) {
    foreach ($OffsetX as $x) {
        $Badges[] = array($x, $y);
    }
}
$BadgePerPage = count($Badges);
$Just = array('L', 'C', 'R');
$cntPass = 0;
$pdf = new LabelPDF($PageWidth, $PageHeight);
// get the background of the card
$q = safe_r_SQL("select * from IdCards where IcTournament={$_SESSION['TourId']}");
$BackGround = safe_fetch($q) or debug_svela('Error in Accreditation!');
$BackGround->Options = unserialize($BackGround->IcSettings);
$Elements = array();
$q = safe_r_SQL("select * from IdCardElements where IceTournament={$_SESSION['TourId']} order by IceOrder");
while ($r = safe_fetch($q)) {
    $r->Options = unserialize($r->IceOptions);
    if (!empty($r->Options['Font'])) {
        $r->Options['FontFamily'] = $pdf->addTTFfont(K_PATH_FONTS . $r->Options['Font'] . '.ttf');
        $r->Options['FontStyle'] = (substr($r->Options['Font'], -2, 1) == 'b' ? 'B' : '') . (substr($r->Options['Font'], -1, 1) == 'i' ? 'I' : '');
    }
    if ($r->IceType == 'Accomodation') {
        // calculate the final dimentions regard the space we have....
        $OrgAcScaleFactor = ($r->Options['H'] - 4) / $AcHeight;
コード例 #9
0
ファイル: Cardx6-bis.php プロジェクト: brian-nelson/ianseo
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/LabelPDF.inc.php';
require_once 'CommonCard.php';
$Rs = safe_r_sql($MyQuery);
if (!safe_num_rows($Rs)) {
    include 'Common/Templates/head-popup.php';
    echo '<table height="' . ($_SESSION['WINHEIGHT'] - 50) . '" width="100%"><tr><td>';
    echo '<div align="center">' . get_text('BadgeNoData', 'Tournament') . '';
    echo '<br/><br/><input type="button" onclick="window.close();" value="' . get_text('Close') . '">';
    echo '</td></tr></table>';
    include 'Common/Templates/tail-popup.php';
    die;
}
$pdf = new LabelPDF();
$pdf->SetAutoPageBreak(false);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$AccW = ($pdf->getPageWidth() - 13) / 2 - 10;
$AccH = ($pdf->getPageHeight() - 50) / 3 - 10;
$XOffset = array(0, $AccW + 10);
$YOffset = array(0, 0, $AccH + 10, $AccH + 10, $AccH * 2 + 20, $AccH * 2 + 20);
$CardsPerWidth = 2;
$CardsPerPage = 6;
$FlagHeight = 12;
$cntPass = 0;
$ImgSxSize = NULL;
$ImgDxSize = NULL;
$ImgLowSize = NULL;
$ImgLWidth = 0;
コード例 #10
0
ファイル: PrnLabels-bis.php プロジェクト: brian-nelson/ianseo
}
if ($_POST) {
    require_once 'Common/pdf/LabelPDF.inc.php';
    $IncludePicture = !empty($_REQUEST['sticker_Picture']);
    $IncludeBarCode = !empty($_REQUEST['sticker_BarCode']);
    $Unit = $_REQUEST['sticker_Unit'];
    $MarTop = $_REQUEST['sticker_Top'];
    $MarLeftRight = $_REQUEST['sticker_Side'];
    $MarBottom = $_REQUEST['sticker_Bot'];
    $StickRows = $_REQUEST['sticker_Y'];
    $StickCols = $_REQUEST['sticker_X'];
    $ColIntMargin = $_REQUEST['sticker_InterCols'];
    $RowIntMargin = $_REQUEST['sticker_InterRows'];
    $PaperHeight = $_REQUEST['sticker_PageHeight'];
    $PaperWidth = $_REQUEST['sticker_PageWidth'];
    $pdf = new LabelPDF();
    if ($IncludePicture) {
        include_once 'Common/CheckPictures.php';
        CheckPictures('', true, false, true);
        // cancella le foto più vecchie di 1 giorno
        // prints all the pictures in the size specified...
        $MySQL = "select" . " PhEnId, concat(CoCode, ' (', EnCode, '-', EnFirstName, ')') code  " . "from" . " Photos" . " inner join Entries on EnId=PhEnId " . " inner join Countries on EnCountry=CoId " . " left join Qualifications on EnId=QuId " . "where" . " EnTournament={$_SESSION['TourId']} " . (isset($_REQUEST["Session"]) && is_numeric($_REQUEST["Session"]) ? " AND SUBSTRING(QuTargetNo,1,1) = " . StrSafe_DB($_REQUEST["Session"]) . " " : '') . " and PhPhoto>'' order by code";
        $q = safe_r_sql($MySQL);
        $pdf->addpage();
        $NumCols = floor(($PaperWidth - 2 * $MarLeftRight) / max(1, $StickCols));
        $HGap = ($PaperWidth - 2 * $MarLeftRight - $NumCols * $StickCols) / ($NumCols - 1);
        $NumRows = floor(($PaperHeight - $MarTop - $MarTop) / max(1, $StickRows + 3));
        $VGap = ($PaperHeight - $MarTop - $MarTop - $NumRows * ($StickRows + 3)) / ($NumRows - 1);
        $X = $MarLeftRight;
        $Y = $MarTop;
        $pdf->SetFontSize(7);