<commit_before><?php
use view\View;
use dao\MieterDAO;
use domain\Mieter;
require_once("config/Autoloader.php");
require('fpdf/fpdf.php');

class PDF extends FPDF
{
// Load data
    function LoadData()
    {
        // Read file lines
        global $mieter;
        $data = array("Cedi", "Cedi", "Cedi", "Cedi");
        /*
        foreach($mieter as $mietertabelle) {
            $data[] = $mietertabelle->getVorname();
        }
        */
        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
        for($i = 0; i < $data.count(); $i++)
        {
            $this->Cell($w[0],6,$data[0],'LR');
            $this->Cell($w[1],6,$data[1],'LR');
            $this->Cell($w[2],6,$data[2],'LR',0,'R');
            $this->Cell($w[3],6,$data[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,0,0);
        $this->SetTextColor(255);
        $this->SetDrawColor(128,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[$row],6,$data[$row],'LR',0,'L',$fill);

            $this->Ln();
            $fill = !$fill;
        }
        // Closing line
        $this->Cell(array_sum($w),0,'','T');
    }
}

$pdf = new PDF();
// Column headings
$header = array('Vornamen', 'Namen', 'Adresse', 'Ort');
// Data loading
$data = $pdf->LoadData();
$pdf->SetFont('Arial','',14);
$pdf->AddPage();
$pdf->BasicTable($header,$data);
$pdf->AddPage();
$pdf->ImprovedTable($header,$data);
$pdf->AddPage();
$pdf->FancyTable($header,$data);
$pdf->Output();
?>

?>
<commit_msg>div<commit_after><?php
use view\View;
use dao\MieterDAO;
use domain\Mieter;
require_once("config/Autoloader.php");
require('fpdf/fpdf.php');

class PDF extends FPDF
{
// Load data
    function LoadData()
    {
        // Read file lines
        global $mieter;
        $data = array("Cedi", "Cedi", "Cedi", "Cedi");
        /*
        foreach($mieter as $mietertabelle) {
            $data[] = $mietertabelle->getVorname();
        }
        */
        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
        for($i = 0; i < $data.count(); $i++)
        {
            $this->Cell($w[0],6,$data[0],'LR');
            $this->Cell($w[1],6,$data[1],'LR');
            $this->Cell($w[2],6,$data[2],'LR',0,'R');
            $this->Cell($w[3],6,$data[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,0,0);
        $this->SetTextColor(255);
        $this->SetDrawColor(128,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,$data[0],'LR',0,'L',$fill);
            $this->Cell($w[1],6,$data[1],'LR',0,'L',$fill);
            $this->Cell($w[2],6,$data[2],'LR',0,'R',$fill);
            $this->Cell($w[3],6,$data[3],'LR',0,'R',$fill);
            $this->Ln();
            $fill = !$fill;
        }
        // Closing line
        $this->Cell(array_sum($w),0,'','T');
    }
}

$pdf = new PDF();
// Column headings
$header = array('Vornamen', 'Namen', 'Adresse', 'Ort');
// Data loading
$data = $pdf->LoadData();
$pdf->SetFont('Arial','',14);
$pdf->AddPage();
$pdf->BasicTable($header,$data);
$pdf->AddPage();
$pdf->ImprovedTable($header,$data);
$pdf->AddPage();
$pdf->FancyTable($header,$data);
$pdf->Output();
?>

?>

{'fraction_non_alphanumeric': 0.2298582451103535, 'fraction_numerical': 0.030145343621029965, 'mean_word_length': 2.0293478260869566, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 80, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1742856', 'n_tokens_mistral': 2080, 'n_tokens_neox': 1991, 'n_words': 305}