Exemplo n.º 1
0
require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/BackNoPDF.php';
require_once 'Common/Fun_FormatText.inc.php';
require_once 'IdCardEmpty.php';
require_once 'Common/Lib/Fun_DateTime.inc.php';
if (!CheckTourSession()) {
    // spedisci una immagine vuota
    $img = createimagetruecolor(100, 100);
    // Content type
    header('Content-type: image/png');
    imagepng($img);
    die;
}
$Select = "SELECT IdCards.*, LENGTH(IcBackground) as ImgSize " . "FROM IdCards  " . "WHERE IcTournament=" . StrSafe_DB($_SESSION['TourId']);
$Rs = safe_r_sql($Select);
$RowBn = emptyIdCard($OrgRow = safe_fetch($Rs));
// debug_svela($OrgRow);
$img = imagecreatetruecolor($RowBn->Settings["Width"] * 2, $RowBn->Settings["Height"] * 2);
$ColWhi = imagecolorallocate($img, 255, 255, 255);
// bianco
$ColBlk = imagecolorallocate($img, 192, 192, 192);
// black e sfondo
imagefilledrectangle($img, 0, 0, $RowBn->Settings["Width"] * 2 - 1, $RowBn->Settings["Height"] * 2 - 1, $ColWhi);
//Immagine di Sfondo
if (strlen($RowBn->Background) > 0) {
    // inserisci immagine di sfondo
    $sf = imagecreatefromstring($RowBn->Background);
    imagecopyresampled($img, $sf, $RowBn->Settings["IdBgX"] * 2, $RowBn->Settings["IdBgY"] * 2, 0, 0, $RowBn->Settings["IdBgW"] * 2, $RowBn->Settings["IdBgH"] * 2, imagesx($sf), imagesy($sf));
} else {
    // filetto grigino di contorno
    imagerectangle($img, 0, 0, $RowBn->Settings["Width"] * 2 - 1, $RowBn->Settings["Height"] * 2 - 1, $ColBlk);
Exemplo n.º 2
0
echo '<table class="Tabella">' . "\n";
echo '<tr><th class="Title" colspan="2">' . get_text('BadgeSetup', 'BackNumbers') . '</th></tr>' . "\n";
//Parametri
echo '<tr>';
//Tipo di Score
echo '<td width="50%"><br>';
echo '<input name="BadgeDraw" type="radio" value="Complete" checked>&nbsp;' . get_text('BadgeComplete', 'BackNumbers') . '<br>';
echo '<input name="BadgeDraw" type="radio" value="Test">&nbsp;' . get_text('BadgeTest', 'BackNumbers') . '<br><br>';
// tipo di badge
echo '<div style="margin-bottom:1em"><b>' . get_text('BadgeType', 'Tournament') . '</b>' . "\n";
foreach ($Badges as $BadgePage => $Badge) {
    echo '<br/><input type="radio" name="BadgeType" onclick="this.form.action=\'' . $BadgePage . '\'; document.getElementById(\'print_button\').style.display=\'inline\';document.getElementById(\'confirm_button\').style.display=\'none\'">' . $Badge . "\n";
    if ($BadgePage == 'Card.php') {
        echo '<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select name="BadgePerPage">' . '<option value="4">' . get_text('Badge4PerPage', 'Tournament') . '</option>' . '<option value="2">' . get_text('Badge2PerPage', 'Tournament') . '</option>' . '<option value="1">' . get_text('Badge1PerPage', 'Tournament') . '</option>' . '</select>';
    } elseif ($BadgePage == 'CardCustom.php') {
        $RowBn = emptyIdCard(safe_fetch($t));
        echo '<table align="center">
				<tr align="center">
					<th colspan="2">&nbsp;</th>
					<th>' . get_text('IdCardOffsets', 'BackNumbers') . '</th>
					<th>' . get_text('PaperDimention', 'BackNumbers') . '</th>
				</tr>
				<tr align="center">
					<th>' . get_text('Width', 'BackNumbers') . '</th>
					<td><input type="text" name="IdCardsSettings[Width]" id="IdWidth" size="3" value="' . $RowBn->Settings["Width"] . '"></td>
					<td><input type="text" name="IdCardsSettings[OffsetX]" id="IdRepX" size="10" value="' . $RowBn->Settings["OffsetX"] . '"></td>
					<td><input type="text" name="IdCardsSettings[PaperWidth]" id="IdPaperWidth" size="10" value="' . $RowBn->Settings["PaperWidth"] . '"></td>
				</tr>
				<tr align="center">
					<th>' . get_text('Heigh', 'BackNumbers') . '</th>
					<td><input type="text" name="IdCardsSettings[Height]" id="IdHeight" size="3" value="' . $RowBn->Settings["Height"] . '"></td>