示例#1
0
        $form->fieldset_ende();
        break;
    case "test":
        ob_clean();
        // ausgabepuffer leeren
        //include_once ('pdfclass/class.ezpdf.php');
        $pdf = new Cezpdf('a4', 'portrait');
        $pdf->ezSetCmMargins(4.5, 2.5, 2.5, 2.5);
        $berlus_schrift = 'pdfclass/fonts/Times-Roman.afm';
        $text_schrift = 'pdfclass/fonts/Arial.afm';
        $pdf->addJpegFromFile('includes/logos/hv_logo198_80.jpg', 450, 780, 100, 42);
        $pdf->setLineStyle(0.5);
        $pdf->selectFont($berlus_schrift);
        $pdf->addText(42, 743, 6, "BERLUS HAUSVERWALTUNG - Fontanestr. 1 - 14193 Berlin");
        $pdf->line(42, 750, 550, 750);
        $seite = $pdf->ezGetCurrentPageNumber();
        $alle_seiten = $pdf->ezPageCount;
        $data55 = array(array('num' => 1, 'name' => 'gandalf', 'type' => 'wizard'), array('num' => 2, 'name' => 'bilbo', 'type' => 'hobbit', 'url' => 'http://www.ros.co.
nz/pdf/'), array('num' => 3, 'name' => 'frodo', 'type' => 'hobbit'), array('num' => 4, 'name' => 'saruman', 'type' => 'bad
dude', 'url' => 'http://sourceforge.net/projects/pdf-php'), array('num' => 5, 'name' => 'sauron', 'type' => 'really bad dude'));
        $pdf->ezTable($data55);
        // header('Content-type: application/pdf');
        // header('Content-Disposition: attachment; filename="downloaded.pdf"');
        // $output = $pdf->Output();
        // $len = strlen($output);
        // header("Content-type: application/pdf"); // wird von MSIE ignoriert
        // header("content-length: $len");
        // header("Content-Disposition: inline; filename=test.pdf"); //im fenster
        // header("Content-Disposition: attachment; filename=test.pdf");
        // echo $output; // jetzt ausgeben
        $pdf->ezStream();
示例#2
0
 function addTable(Cezpdf &$pdf, &$data, $cols = '', $title = '', $options = '')
 {
     $pdf->transaction('start');
     $pageNumber = $pdf->ezGetCurrentPageNumber();
     $pdf->ezTable($data, $cols, $title, $options);
     if ($pageNumber < $pdf->ezGetCurrentPageNumber()) {
         $pdf->transaction('rewind');
     } else {
         $pdf->transaction('commit');
         return;
     }
     $pdf->ezNewPage();
     $pageNumber = $pdf->ezGetCurrentPageNumber();
     $pdf->ezTable($data, $cols, $title, $options);
     if ($pageNumber < $pdf->ezGetCurrentPageNumber()) {
         $pdf->transaction('rewind');
         $pdf->ezTable($data, $cols, $title, $options);
     }
     $pdf->transaction('commit');
 }
示例#3
0
 function kontobuchungen_pdf($geldkonto_id, $kostenkonto, $jahr, $monat)
 {
     if ($monat == '') {
         $result = mysql_query("SELECT DATUM, BETRAG, VERWENDUNGSZWECK FROM GELD_KONTO_BUCHUNGEN WHERE GELDKONTO_ID='{$geldkonto_id}' && KONTENRAHMEN_KONTO = '{$kostenkonto}' && ( DATE_FORMAT( DATUM, '%Y' ) = '{$jahr}') && AKTUELL='1' ORDER BY GELD_KONTO_BUCHUNGEN_ID DESC");
     } else {
         $result = mysql_query("SELECT DATUM, BETRAG, VERWENDUNGSZWECK FROM GELD_KONTO_BUCHUNGEN WHERE GELDKONTO_ID='{$geldkonto_id}' && KONTENRAHMEN_KONTO = '{$kostenkonto}' && ( DATE_FORMAT( DATUM, '%Y-%m' ) = '{$jahr}-{$monat}') && AKTUELL='1' ORDER BY GELD_KONTO_BUCHUNGEN_ID DESC");
     }
     $numrows = mysql_numrows($result);
     if ($numrows > 0) {
         $k = new kontenrahmen();
         $k->konto_informationen($kostenkonto);
         /* PDF */
         //include_once ('pdfclass/class.ezpdf.php');
         $pdf = new Cezpdf('a4', 'portrait');
         $pdf->ezSetCmMargins(4.5, 2.5, 2.5, 2.5);
         $berlus_schrift = './fonts/Times-Roman.afm';
         $text_schrift = './fonts/Arial.afm';
         $pdf->addJpegFromFile('includes/logos/hv_logo198_80.jpg', 450, 780, 100, 42);
         $pdf->setLineStyle(0.5);
         $pdf->selectFont($berlus_schrift);
         $pdf->addText(42, 743, 6, "BERLUS HAUSVERWALTUNG - Fontanestr. 1 - 14193 Berlin");
         $pdf->line(42, 750, 550, 750);
         $seite = $pdf->ezGetCurrentPageNumber();
         $alle_seiten = $pdf->ezPageCount;
         $pdf->addText(70, 780, 12, "Kostenkonto {$kostenkonto}");
         while ($row = mysql_fetch_assoc($result)) {
             $datum = date_mysql2german($row[DATUM]);
             $betrag = nummer_punkt2komma($row[BETRAG]);
             $vzweck = $this->umlaute_anpassen(ltrim(rtrim($row[VERWENDUNGSZWECK])));
             $this->summe_kontobuchungen_jahr($geldkonto_id, $kostenkonto, $jahr);
             echo "<tr></td><td>{$datum}</td><td>{$erfass_nr}</td><td>{$betrag}</td><td>{$b_id}</td><td>{$vzweck}</td></tr><br>";
             $pdf->ezText("{$datum}", 10, array('left' => '0'));
             if (strlen($vzweck) > '60') {
                 $pdf->ezText("{$vzweck}", 10, array('left' => '60'));
                 // $pdf->ezSetDy(-12); //abstand
             } else {
                 $pdf->ezText("{$vzweck}", 10, array('left' => '60'));
             }
             $pdf->ezText("{$betrag}", 10, array('left' => '430'));
             $pdf->ezSetDy(-12);
             // abstand
         }
         $content = $pdf->output();
         $dateiname_org = 'Kontenbericht';
         $dateiname = $this->save_file($dateiname_org, 'Monatsbericht_Konten', $geldkonto_id, $content, $monat, $jahr);
         // weiterleiten($dateiname);
         $download_link = "<h3><a href=\"{$dateiname}\">Monatsbericht {$geldkonto_id} für {$monat}/{$jahr} HIER</a></h3>";
         echo $download_link;
     } else {
         // echo "Geldkonto $geldkonto_id - Kostenkonto $kostenkonto leer<br>";
     }
 }
示例#4
0
 function hga_uebersicht_pdf(Cezpdf $pdf, $eigentuemer_id)
 {
     $e_konto = 6050;
     // echo "funkt $eigentuemer_id";
     $this->get_eigentumer_id_infos($eigentuemer_id);
     if (isset($_REQUEST['jahr']) && !empty($_REQUEST['jahr'])) {
         $jahr = $_REQUEST['jahr'];
         $akt_jahr = date("Y");
     } else {
         $jahr = $akt_jahr = date("Y");
     }
     $gg = new geldkonto_info();
     $gg->geld_konto_ermitteln('Objekt', $this->objekt_id);
     $geldkonto_id = $gg->geldkonto_id;
     $eigentuemer_ids = $this->get_eigentuemer_arr($this->einheit_id);
     $g_soll = 0;
     $g_ist = 0;
     $anz = count($eigentuemer_ids);
     for ($a = 0; $a < $anz; $a++) {
         $g_ist += $this->get_ergebnis_hga_ist($eigentuemer_ids[$a]['ID'], $jahr, $geldkonto_id, $e_konto);
     }
     $ergebnisse_hga = $this->get_ergebnisse_hga_soll($this->einheit_id, $jahr, $e_konto);
     $anz = count($ergebnisse_hga);
     for ($a = 0; $a < $anz; $a++) {
         $g_soll += $ergebnisse_hga[$a]['SOLL'];
         $ergebnisse_hga[$a]['SOLL'] = nummer_punkt2komma($ergebnisse_hga[$a]['SOLL']);
     }
     $g_saldo = $g_ist - $g_soll;
     if ($a > 0) {
         $ergebnisse_hga[0]['IST'] = nummer_punkt2komma($g_ist);
         $ergebnisse_hga[0]['SALDO'] = nummer_punkt2komma($g_saldo);
     }
     $ergebnisse_hga[$a + 1]['HGA'] = '<b>Summen</b>';
     $ergebnisse_hga[$a + 1]['SOLL'] = '<b>' . nummer_punkt2komma($g_soll) . '</b>';
     $ergebnisse_hga[$a + 1]['IST'] = '<b>' . nummer_punkt2komma($g_ist) . '</b>';
     $ergebnisse_hga[$a + 1]['SALDO'] = '<b>' . nummer_punkt2komma($g_saldo) . '</b>';
     // print_r($soll_ist_arr);
     $cols = array('HGA' => "<b>HGA</b>", 'SOLL' => "<b>SOLL (- ist Guthaben)</b>", 'IST' => "<b>IST</b>", 'SALDO' => "<b>SALDO</b>");
     $page = $pdf->ezGetCurrentPageNumber();
     $pdf->transaction('start');
     $pdf->ezSetDy(-10);
     $pdf->ezText("ERGEBNISSE HAUSGELDABRECHNUNGEN", 11, array('justification' => 'full'));
     $pdf->ezSetDy(-5);
     $pdf->ezTable($ergebnisse_hga, $cols, "", array('showHeadings' => 1, 'shaded' => 0, 'titleFontSize' => 11, 'titleJustification' => 'left', 'fontSize' => 7, 'xPos' => 50, 'xOrientation' => 'right', 'width' => 500, 'rowGap' => 1, 'cols' => array('DATUM' => array('justification' => 'right', 'width' => 70), 'BEMERKUNG' => array('justification' => 'left', 'width' => 300), 'BETRAG' => array('justification' => 'right', 'width' => 75), 'SALDO' => array('justification' => 'right', 'width' => 75))));
     if ($pdf->ezGetCurrentPageNumber() > $page) {
         $pdf->transaction('abort');
         $pdf->ezNewPage();
         $pdf->ezText("ERGEBNISSE HAUSGELDABRECHNUNGEN", 11, array('justification' => 'full'));
         $pdf->ezSetDy(-5);
         $pdf->ezTable($ergebnisse_hga, $cols, "", array('showHeadings' => 1, 'shaded' => 0, 'titleFontSize' => 11, 'titleJustification' => 'left', 'fontSize' => 7, 'xPos' => 50, 'xOrientation' => 'right', 'width' => 500, 'rowGap' => 1, 'cols' => array('DATUM' => array('justification' => 'right', 'width' => 70), 'BEMERKUNG' => array('justification' => 'left', 'width' => 300), 'BETRAG' => array('justification' => 'right', 'width' => 75), 'SALDO' => array('justification' => 'right', 'width' => 75))));
     } else {
         $pdf->transaction('commit');
     }
     return $pdf;
 }