Warning: Cannot modify header information - headers already sent by (output started at /var/www/jonas-eriksen.dk/pic/private/index.php:1) in /var/www/jonas-eriksen.dk/pic/private/index.php on line 215
var/www/jonas-eriksen.dk/fpdf/Class.pdf.php 0000644 00000011531 15233471465 0014605 0 ustar 00 /U', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
foreach ($a as $i => $e) {
if ($i % 2 == 0) {
// Text
if ($this->HREF)
$this->PutLink($this->HREF, $e);
else
$this->Write(5, $e);
} else {
// Tag
if ($e[0] == '/')
$this->CloseTag(strtoupper(substr($e, 1)));
else {
// Extract attributes
$a2 = explode(' ', $e);
$tag = strtoupper(array_shift($a2));
$attr = array();
foreach ($a2 as $v) {
if (preg_match('/([^=]*)=["\']?([^"\']*)/', $v, $a3))
$attr[strtoupper($a3[1])] = $a3[2];
}
$this->OpenTag($tag, $attr);
}
}
}
}
function OpenTag($tag, $attr)
{
// Opening tag
if ($tag == 'B' || $tag == 'I' || $tag == 'U')
$this->SetStyle($tag, true);
if ($tag == 'A')
$this->HREF = $attr['HREF'];
if ($tag == 'BR')
$this->Ln(5);
}
function CloseTag($tag)
{
// Closing tag
if ($tag == 'B' || $tag == 'I' || $tag == 'U')
$this->SetStyle($tag, false);
if ($tag == 'A')
$this->HREF = '';
}
function SetStyle($tag, $enable)
{
// Modify style and select corresponding font
$this->$tag += ($enable ? 1 : -1);
$style = '';
foreach (array('B', 'I', 'U') as $s) {
if ($this->$s > 0)
$style .= $s;
}
$this->SetFont('', $style);
}
function PutLink($URL, $txt)
{
// Put a hyperlink
$this->SetTextColor(0, 0, 255);
$this->SetStyle('U', true);
$this->Write(5, $txt, $URL);
$this->SetStyle('U', false);
$this->SetTextColor(0);
}
function Footer()
{
// Position at 1.5 cm from bottom
$this->SetY(-15);
// Arial italic 8
$this->SetFont('Arial', 'I', 8);
// Page number
$this->Cell(0, 10, "VBF's Skyttelaug Hinnerup", 0, 0, 'C');
}
function LoadData($file)
{
// Read file lines
$lines = file($file);
$data = array();
foreach ($lines as $line)
$data[] = explode(';', trim($line));
return $data;
}
// Simple table
function BasicTable($header, $data)
{
// Header
foreach ($header as $col)
$this->Cell(40, 7, $col, 1);
$this->Ln();
// Data
foreach ($data as $row) {
foreach ($row as $col)
$this->Cell(40, 6, $col, 1);
$this->Ln();
}
}
// Better table
function ImprovedTable($header, $data)
{
// Column widths
$w = array(40, 35, 40, 45);
// Header
for ($i = 0; $i < count($header); $i++)
$this->Cell($w[$i], 7, $header[$i], 1, 0, 'C');
$this->Ln();
// Data
foreach ($data as $row) {
$this->Cell($w[0], 6, $row[0], 'LR');
$this->Cell($w[1], 6, $row[1], 'LR');
$this->Cell($w[2], 6, number_format($row[2]), 'LR', 0, 'R');
$this->Cell($w[3], 6, number_format($row[3]), 'LR', 0, 'R');
$this->Ln();
}
// Closing line
$this->Cell(array_sum($w), 0, '', 'T');
}
// Colored table
function FancyTable($header, $data)
{
// Colors, line width and bold font
$this->SetFillColor(255, 255, 255);
$this->SetTextColor(0, 0, 0);
$this->SetDrawColor(0, 0, 0);
$this->SetLineWidth(.3);
$this->SetFont('', 'B');
// Header
$w = array(40, 35, 40, 45);
for ($i = 0; $i < count($header); $i++)
$this->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);
$this->Ln();
// Color and font restoration
$this->SetFillColor(224, 235, 255);
$this->SetTextColor(0);
$this->SetFont('');
// Data
$fill = false;
foreach ($data as $row) {
$this->Cell($w[0], 6, $row[0], 'LR', 0, 'L', $fill);
$this->Cell($w[1], 6, $row[1], 'LR', 0, 'L', $fill);
$this->Cell($w[2], 6, number_format($row[2]), 'LR', 0, 'R', $fill);
$this->Cell($w[3], 6, number_format($row[3]), 'LR', 0, 'R', $fill);
$this->Ln();
$fill = !$fill;
}
// Closing line
$this->Cell(array_sum($w), 0, '', 'T');
}
}
?>