fhiiqm/ma_tel_pdf.php
changeset 34 fc60ef80a7ad
parent 33 f1a8785434e4
equal deleted inserted replaced
33:f1a8785434e4 34:fc60ef80a7ad
    74     }
    74     }
    75     else
    75     else
    76     {
    76     {
    77         $sql = "SELECT persknr, name, vorname, titel, abt_name, telefon_nr, telefon_typ, public, geb_ID, raum_nr, email, abt_tel+0 FROM v_tel_list_ma_raum "; 
    77         $sql = "SELECT persknr, name, vorname, titel, abt_name, telefon_nr, telefon_typ, public, geb_ID, raum_nr, email, abt_tel+0 FROM v_tel_list_ma_raum "; 
    78     
    78     
    79         if ($sortp == '2') $sortp = "name COLLATE latin1_general_ci,3,12,5,6"; // Name
    79         if ($sortp == '2') $sortp = "name COLLATE latin1_general_ci,3,12,5,IFNULL(sort,99),6"; // Name
    80         elseif ($sortp == '12') $sortp = "12,5,name COLLATE latin1_general_ci,3,6"; // abt_ID
    80         elseif ($sortp == '12') $sortp = "12,5,name COLLATE latin1_general_ci,3,IFNULL(sort,99),6"; // abt_ID
    81         else $sortp = "name COLLATE latin1_general_ci,3,12,5,6";
    81         else $sortp = "name COLLATE latin1_general_ci,3,12,5,IFNULL(sort,99),6";
    82         
    82         
    83         if ($abt > '-1') $wher = " WHERE abt_tel = $abt "; else $wher = "";
    83         if ($abt > '-1') $wher = " WHERE abt_tel = $abt "; else $wher = "";
    84         
    84         
    85         $sql .= $wher . " ORDER BY $sortp";
    85         $sql .= $wher . " ORDER BY $sortp";
    86         if ($result = $dbc ->queryObjectArray($sql))
    86         if ($result = $dbc ->queryObjectArray($sql))
    87         { 
    87         { 
    88             $header=array('Name','Abteilung','Tel/Fax','Raum','E-Mail');
    88             $header=array('Name','Abteilung','Tel/Fax','Raum','E-Mail');
    89             $pdf = new PDF();
    89             $pdf = new PDF();
    90             $pdf->SetLeftMargin(25);
    90             $pdf->SetLeftMargin(25);
    91             $pdf->AddPage();
    91             $pdf->AddPage();
    92             $pdf->AliasNbPages();
    92             $pdf->AliasNbPages();   // Anzahl Seiten
    93             $pdf->SetFont('helvetica','',9);
    93             $pdf->SetFont('helvetica','',9);
       
    94 //            $pdf->SetFont('times','',8);
    94         
    95         
    95             $pdf->FancyTable($header,$result);
    96             $pdf->FancyTable($header,$result);
    96             $pdf->SetDisplayMode('real');
    97             $pdf->SetDisplayMode('real');
    97             $pdf->Output();
    98             $pdf->Output();
    98             // als Download
    99             // als Download