Exemple #1
0
 function stammdaten_weg($objekt_id, $export = null)
 {
     $o = new objekt();
     $o->objekt_informationen($objekt_id);
     $arr = $this->einheiten_weg_tabelle_arr($objekt_id);
     $csv = $this->einheiten_weg_tabelle_arr($objekt_id);
     if (!is_array($arr)) {
         fehlermeldung_ausgeben("Keine Einheiten im Objekt");
     } else {
         $anz_e = count($arr);
         for ($a = 0; $a < $anz_e; $a++) {
             $einheit_id = $arr[$a]['EINHEIT_ID'];
             $csv[$a]['EINHEIT_ID'] = $einheit_id;
             /* Einheitdetails */
             $det = new details();
             $arr[$a]['E_DETAILS_ARR'] = $det->get_details('EINHEIT', $einheit_id);
             $det1 = new detail();
             $arr[$a]['EINHEIT_MEA'] = $det1->finde_detail_inhalt('Einheit', $einheit_id, 'WEG-Anteile');
             $csv[$a]['EINHEIT_MEA'] = $arr[$a]['EINHEIT_MEA'];
             $anz_e_det = count($arr[$a]['E_DETAILS_ARR']);
             $det_string = "";
             for ($dd = 0; $dd < $anz_e_det; $dd++) {
                 $det_name = $arr[$a]['E_DETAILS_ARR'][$dd]['DETAIL_NAME'];
                 $det_inhalt = bereinige_string($arr[$a]['E_DETAILS_ARR'][$dd]['DETAIL_INHALT']);
                 $det_string .= "{$det_name}: {$det_inhalt}\n";
             }
             $arr[$a]['E_DETAILS'] = $det_string;
             $csv[$a]['E_DETAILS'] = $det_string;
             unset($arr[$a]['E_DETAILS_ARR']);
             $w = new weg();
             $w->get_last_eigentuemer_id($einheit_id);
             $arr[$a]['ET_ID'] = $w->eigentuemer_id;
             /* Geldkonto infos */
             $gk = new geldkonto_info();
             $gk_arr = $gk->geldkonten_arr('Eigentuemer', $w->eigentuemer_id);
             // $arr[$a]['GK'] = $gk->geldkonten_arr('Eigentuemer', $w->eigentuemer_id);
             $anz_gk = count($gk_arr);
             $gk_string = "";
             for ($g = 0; $g < $anz_gk; $g++) {
                 $gk_id = $gk_arr[$g]['KONTO_ID'];
                 $sep = new sepa();
                 $sep->get_sepa_konto_infos($gk_id);
                 $gk_string .= "<b>{$sep->beguenstigter}</b>\n{$sep->IBAN1}\n{$sep->BIC}\n";
             }
             $arr[$a]['GK'] = $gk_string;
             $csv[$a]['GK'] = $gk_string;
             // print_r($arr[$a]['GK']);
             // die();
             $w->get_eigentumer_id_infos3($w->eigentuemer_id);
             $arr[$a]['EINHEIT_QM_ET'] = $w->einheit_qm_weg;
             $csv[$a]['EINHEIT_QM_ET'] = $w->einheit_qm_weg;
             // print_r($w);
             $arr[$a]['ET_NAMEN'] = $w->empf_namen_u;
             $csv[$a]['ET_NAMEN'] = $w->empf_namen_u;
             $arr[$a]['P_INFO_ARR'] = $w->personen_id_arr1;
             $arr[$a]['ET_ANZ'] = count($arr[$a]['P_INFO_ARR']);
             if ($arr[$a]['ET_ANZ'] > 0) {
                 for ($p = 0; $p < $arr[$a]['ET_ANZ']; $p++) {
                     $det = new details();
                     $p_id = $arr[$a]['P_INFO_ARR'][$p]['PERSON_ID'];
                     $arr[$a]['P_DETAILS'][] = $det->get_details('PERSON', $p_id);
                 }
                 // print_r($arr[$a]['P_DETAILS']);
                 // die();
                 $det_string = "";
                 $anz_det_et = count($arr[$a]['P_DETAILS']);
                 for ($dd = 0; $dd < $anz_det_et; $dd++) {
                     $anz_det_et1 = count($arr[$a]['P_DETAILS'][$dd]);
                     for ($dd1 = 0; $dd1 < $anz_det_et1; $dd1++) {
                         $det_name = $arr[$a]['P_DETAILS'][$dd][$dd1]['DETAIL_NAME'];
                         $det_inhalt = bereinige_string($arr[$a]['P_DETAILS'][$dd][$dd1]['DETAIL_INHALT']);
                         $det_string .= "{$det_name}: {$det_inhalt}\n";
                     }
                 }
                 $arr[$a]['ET_DETAILS'] = $det_string;
                 $csv[$a]['ET_DETAILS'] = $det_string;
             }
             echo "<br>";
         }
     }
     if ($export != null) {
         ob_clean();
         $ueberschrift = array_keys($csv[0]);
         $anz_k = count($ueberschrift);
         $csv_string = '';
         for ($k = 0; $k < $anz_k; $k++) {
             $csv_string .= $ueberschrift[$k] . ";";
         }
         $csv_string .= "\n";
         foreach ($csv as $key => $zeile) {
             foreach ($zeile as $ue => $wert) {
                 $wert_a = str_replace('<br>', ' ', bereinige_string($wert));
                 $csv_string .= "\"{$wert_a}\";";
             }
             $csv_string .= "\n";
         }
         return $csv_string;
         break;
     }
     if (isset($_REQUEST['csv'])) {
         ob_clean();
         header("Content-Disposition: attachment; filename='ET.CSV");
         $ueberschrift = array_keys($csv[0]);
         $anz_k = count($ueberschrift);
         for ($k = 0; $k < $anz_k; $k++) {
             echo $ueberschrift[$k] . ";";
         }
         echo "\n";
         foreach ($csv as $key => $zeile) {
             foreach ($zeile as $ue => $wert) {
                 $wert_a = str_replace('<br>', ' ', bereinige_string($wert));
                 echo "\"{$wert_a}\";";
             }
             echo "\n";
         }
         die;
     }
     $pdf = new Cezpdf('a4', 'landscape');
     $bpdf = new b_pdf();
     $bpdf->b_header($pdf, 'Partner', $_SESSION['partner_id'], 'landscape', 'Helvetica.afm', 5);
     $pdf->ezStopPageNumbers();
     // seitennummerirung beenden
     $p = new partners();
     $p->get_partner_info($_SESSION['partner_id']);
     $datum = date("d.m.Y");
     if (isset($_REQUEST['lang']) && $_REQUEST['lang'] == 'en') {
         $cols = array('EINHEIT_KURZNAME' => "AP", 'HAUS_STRASSE' => "STREET", 'HAUS_NUMMER' => "NO.", 'TYP' => "TYP", 'EINHEIT_LAGE' => "LOCATION", 'ET_NAMEN' => "OWNER", 'ET_DETAILS' => "DETAILS", 'GK' => "BANC ACCOUNT", 'EINHEIT_QM' => "Tm²", 'EINHEIT_QM_ET' => "Om²", 'EINHEIT_MEA' => "MEA");
     } else {
         $cols = array('EINHEIT_KURZNAME' => "AP", 'HAUS_STRASSE' => "STREET", 'HAUS_NUMMER' => "NO.", 'TYP' => "TYP", 'EINHEIT_LAGE' => "LOCATION", 'ET_NAMEN' => "OWNER", 'ET_DETAILS' => "DETAILS", 'GK' => "BANC ACCOUNT", 'EINHEIT_QM' => "Tm²", 'EINHEIT_QM_ET' => "Om²", 'EINHEIT_MEA' => "MEA");
     }
     $pdf->ezTable($arr, $cols, "{$o->objekt_name}", array('showHeadings' => 1, 'shaded' => 1, 'shadeCol' => array(0.9, 0.9, 0.9), 'titleFontSize' => 14, 'fontSize' => 9, 'xPos' => 25, 'xOrientation' => 'right', 'width' => 800));
     ob_clean();
     // ausgabepuffer leeren
     $pdf->ezStream();
 }
Exemple #2
0
 function get_etid_from_vzweck($vzweck)
 {
     $vzweck = str_replace(',', ' ', $vzweck);
     $vzweck = str_replace('.', ' ', $vzweck);
     $vzweck = str_replace(' -', ' ', $vzweck);
     // echo $vzweck;
     $pos_svwz = strpos(strtoupper($vzweck), 'SVWZ+');
     if ($pos_svwz == true) {
         $vzweck_kurz = str_replace(')', ' ', str_replace('(', ' ', substr($vzweck, $pos_svwz + 5)));
     } else {
         $vzweck_kurz = $vzweck;
     }
     $vzweck_arr = explode(' ', strtoupper($vzweck_kurz));
     $ein = new einheit();
     $einheiten_arr = $ein->liste_aller_einheiten();
     for ($ei = 0; $ei < count($einheiten_arr); $ei++) {
         $einheit_kurzname = str_replace(' ', '', ltrim(rtrim($einheiten_arr[$ei]['EINHEIT_KURZNAME'])));
         $ein_arr[] = $einheit_kurzname;
         $pos_leer = strpos($einheiten_arr[$ei]['EINHEIT_KURZNAME'], ' ');
         if ($pos_leer == true) {
             $erstteil = substr(strtoupper($einheiten_arr[$ei]['EINHEIT_KURZNAME']), 0, $pos_leer);
             $ein_arr[] = $erstteil;
         }
     }
     unset($einheiten_arr);
     $new_arr = array_intersect($vzweck_arr, $ein_arr);
     $arr_keys = array_keys($new_arr);
     $anz_keys = count($arr_keys);
     for ($tt = 0; $tt < $anz_keys; $tt++) {
         $key1 = $arr_keys[$tt];
         $new_arr1[] = $new_arr[$key1];
     }
     /*
      * echo '<pre>';
      * print_r($vzweck_arr);
      * print_r($new_arr);
      * print_r($new_arr1);
      */
     if (isset($new_arr1[0])) {
         $anfang = $new_arr1[0];
         $einheit_id_n = $ein->finde_einheit_id_by_kurz($anfang);
         $weg = new weg();
         $weg->get_last_eigentuemer_id($einheit_id_n);
         if (isset($weg->eigentuemer_id)) {
             return $weg->eigentuemer_id;
         }
     }
 }