function tiparire($fromDate, $toDate) { $this->load->model('cerere_model'); $filtru = array('fromDate' => $fromDate, 'toDate' => $toDate); $cereri = $this->cerere_model->getCereriAll($filtru); $this->load->library('Pdf'); $pdf = new Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetTitle('Cereri'); $pdf->SetTopMargin(5); $pdf->setFooterMargin(5); $pdf->SetAutoPageBreak(true); $pdf->SetAuthor('poartacerului.ro'); $pdf->SetDisplayMode('real', 'default'); $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); $output = "<strong>Cereri rugaciune din data {$fromDate} in data {$toDate}</strong>"; foreach ($cereri as $cerere) { $output .= "<br /><br />Nume: " . $cerere['nume'] . ", Localitate: " . $cerere['localitate'] . ", Data: " . $cerere['data']; $output .= "<br />Continut: " . $cerere['continut']; } $pdf->PrintChapter($output, true); $pdf->Output('cereri-rugaciune.pdf', 'I'); }