Example #1
15
 public function Footer()
 {
     $txt = '';
     if ($this->footer_param['form']) {
         $txt = HTML2PDF::textGET('pdf05');
     }
     if ($this->footer_param['date'] && $this->footer_param['heure']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf03');
     }
     if ($this->footer_param['date'] && !$this->footer_param['heure']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf01');
     }
     if (!$this->footer_param['date'] && $this->footer_param['heure']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf02');
     }
     if ($this->footer_param['page']) {
         $txt .= ($txt ? ' - ' : '') . HTML2PDF::textGET('pdf04');
     }
     if (strlen($txt) > 0) {
         $txt = str_replace('[[date_d]]', date('d'), $txt);
         $txt = str_replace('[[date_m]]', date('m'), $txt);
         $txt = str_replace('[[date_y]]', date('Y'), $txt);
         $txt = str_replace('[[date_h]]', date('H'), $txt);
         $txt = str_replace('[[date_i]]', date('i'), $txt);
         $txt = str_replace('[[date_s]]', date('s'), $txt);
         $txt = str_replace('[[current]]', $this->PageNo(), $txt);
         $txt = str_replace('[[nb]]', '{nb}', $txt);
         parent::SetY(-11);
         $this->setOverline(false);
         $this->SetFont('helvetica', 'I', 8);
         $this->Cell(0, 10, $txt, 0, 0, 'R');
     }
 }
Example #2
3
		public function imprimirOrdenCompra($detalle, $anexos, $system, $id_orden){
			require_once(APP_PATH . 'common/plugins/sigma/demos/export_php/html2pdf/html2pdf.class.php');
			template()->buildFromTemplates('report/orden_compra.html');
			page()->setTitle('Orden de compra');
			page()->addEstigma("detalle", array('SQL', $detalle));
        	page()->addEstigma("anexos", array('SQL', $anexos));
        	page()->addEstigma("norden", $id_orden);
        	page()->addEstigma("nombre_empresa", $system->nombre_comercial);
        	page()->addEstigma("direccion_empresa", $system->direccion);
			@template()->parseOutput();
        	@template()->parseExtras();
        	$html2pdf = new HTML2PDF('L', 'lette', 'es');
        	$html2pdf->WriteHTML(page()->getContent());
        	$html2pdf->Output('ticket.pdf');
		}
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function getIndex($order_id)
 {
     $id = $order_id;
     $invoicedata = Invoice::where('Id', $id)->get();
     $html22 = View('viewinvoice')->with(array('invoicedata' => $invoicedata))->render();
     require_once app_path() . '/libs/html2pdf/html2pdf.class.php';
     $html2pdf = new \HTML2PDF('P', 'A4', 'en', true, 'UTF-8', array(0, 0, 0, 0));
     // $html2pdf->pdf->SetDisplayMode('fullpage');
     $html2pdf->WriteHTML($html22);
     $html2pdf->Output('Invoice.pdf');
 }
Example #4
1
 public function generer($html, $nom_fichier = '', $dest = 'I', $sens = self::SENS, $format = self::FORMAT, $margin = array(self::MARGIN, self::MARGIN, self::MARGIN, self::MARGIN))
 {
     try {
         $html2pdf = new HTML2PDF($sens, $format, self::LANG, self::UNICODE, self::ENCODING, $margin);
         $html2pdf->pdf->SetDisplayMode('real');
         $html2pdf->writeHTML($html);
         $html2pdf->Output($nom_fichier, $dest);
     } catch (Exception $e) {
         die("Echec de création du document PDF: {$e}");
     }
 }
Example #5
1
 public function cetak()
 {
     ob_start();
     $data['siswa'] = $this->siswa_model->view();
     $this->load->view('print', $data);
     $html = ob_get_contents();
     ob_end_clean();
     require_once './assets/html2pdf/html2pdf.class.php';
     $pdf = new HTML2PDF('P', 'A4', 'en');
     $pdf->WriteHTML($html);
     $pdf->Output('TOEFL_Exam_Report.pdf', 'D');
 }
 public function generarPDF()
 {
     $sql = "SELECT codigo,nombre,apellido,cedula,edad,semestre from estudiante";
     $resultado = $this->objCon->Ejecutar($sql);
     if ($resultado && pg_numrows($resultado) > 0) {
         require_once '../Recursos/html2pdf/html2pdf.class.php';
         // Se carga la libreria
         ob_start();
         //Habilita el buffer para la salida de datos
         ob_get_clean();
         //Limpia lo que actualmente tenga el buffer
         //En la variable content entre las etiquetas <page></page> va todo el contenido del pdf en formato html
         $content = "<page>";
         $content .= "<h1>ESTE ES EL REPORTE</h1>";
         $content .= '<link href="../Recursos/css/estilosPDF.css" type="text/css" rel="stylesheet">';
         $content .= "<table border='1'>";
         $content .= "<tr>";
         $content .= "<th>Codigo</th>";
         $content .= "<th>Nombre</th>";
         $content .= "<th>Apellido</th>";
         $content .= "<th>Cedula</th>";
         $content .= "<th>Edad</th>";
         $content .= "<th>Semestre</th>";
         $content .= "</tr>";
         for ($cont = 0; $cont < pg_numrows($resultado); $cont++) {
             $content .= "<tr>";
             $content .= "<td>" . pg_result($resultado, $cont, 0) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 1) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 2) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 3) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 4) . "</td>";
             $content .= "<td>" . pg_result($resultado, $cont, 5) . "</td>";
             $content .= "</tr>";
         }
         $content .= "</table>";
         $content .= "</page>";
     } else {
         $content = "<b>No hay registros en la base de datos</b>";
     }
     $html2pdf = new HTML2PDF('P', 'A4', 'es');
     //formato del pdf (posicion (P=vertical L=horizontal), tamaño del pdf, lenguaje)
     $html2pdf->WriteHTML($content);
     //Lo que tenga content lo pasa a pdf
     ob_end_clean();
     // se limpia nuevamente el buffer
     $html2pdf->Output('exemple.pdf');
     //se genera el pdf, generando por defecto el nombre indicado para guardar
 }
 public function voucher($numFile = false)
 {
     if (!$numFile) {
         $this->redireccionar('booking');
     }
     //Session::acceso('Usuario');
     $numFile = base64_decode($numFile);
     $numFile = $numFile * 1;
     $ruta_img = 'views/layout/' . DEFAULT_LAYOUT . '/img/';
     $ruta_img2 = 'public/img/voucher/';
     ob_start();
     require_once ROOT . 'views' . DS . 'system' . DS . 'pdf' . DS . 'vouchea.php';
     $content = ob_get_clean();
     $this->getLibrary('html2pdf.class');
     try {
         $html2pdf = new HTML2PDF('P', 'A4', 'es', false, CHARSET);
         //$html2pdf->setModeDebug();
         $html2pdf->setDefaultFont('Arial');
         $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
         $html2pdf->Output('Voucher_N_' . $numFile . '.pdf');
     } catch (HTML2PDF_exception $e) {
         echo $e;
         exit;
     }
 }
Example #8
0
 function laporan_pdf($kode)
 {
     $data['kd_mahasiswa'] = $kode;
     $this->load->library('HTML2PDF');
     $html2pdf = new HTML2PDF('L', 'Letter', 'fr');
     $html2pdf->setDefaultFont('Arial');
     //filter
     #get filter
     /* $fil['kd_fakultas'] = $kd_fakultas;
     		$fil['kd_prodi'] = $kd_prodi;
     		$fil['tahun'] = $tahun;
     		$fil['nim'] = $nim; */
     //$data['nama'] = 'indriyanto';
     $data['namaUniv'] = 'UNIVERSITAS SUBANG';
     $data['alamatUniv'] = 'Jln. Perkutut Kotaraja, Telp.(0967)581562';
     $data['kotaUniv'] = 'Subang, Jawa Barat';
     // ambil data dari tabel
     $data['data_pdf'] = $this->mdl_ijazah->get_pdf($kode);
     /* if (count($da['row'])==0){
     			echo "Data Tidak Tersedia";
     			return;
     		} */
     $konten = $this->load->view('ta/ijazah_format', $data, true);
     $html2pdf->writeHTML($konten, false);
     $html2pdf->Output('exemple00.pdf');
 }
Example #9
0
 public function postApproveinvoice(Request $request)
 {
     $approve_id = Input::get('invoice_approve_id');
     $post = Input::get();
     $i = Invoice::where('Id', $approve_id)->update(array('Status' => $post['approve_status']));
     $invoicedata = Invoice::where('Id', $approve_id)->get();
     foreach ($invoicedata as $inv) {
         $email = $inv->ClientEmail;
         $invno = $inv->InvoiceCode;
         $clientmail = $inv->ClientName;
     }
     if ($i > 0) {
         $html22 = View('pdfgenerate')->with(array('invoicedata' => $invoicedata))->render();
         $html1 = "<h1>adsfadsfasdf</h1>";
         require_once app_path() . '/libs/html2pdf/html2pdf.class.php';
         $html2pdf = new \HTML2PDF('P', 'A4', 'en', true, 'UTF-8', array(0, 0, 0, 0));
         // $html2pdf->pdf->SetDisplayMode('fullpage');
         $html2pdf->WriteHTML($html22);
         $htmltosend = $html2pdf->Output('', 'S');
         $a = 'IDE | Proforma invoice_';
         $subject = $a . $invno . $clientmail;
         Mail::send('emails.invoice', ['Invoice' => 'hgff'], function ($message) use($subject, $htmltosend, $email) {
             // note: if you don't set this, it will use the defaults from config/mail.php
             $message->from('*****@*****.**', 'IDE Consulting Services Pvt Ltd');
             $message->to($email)->subject($subject)->attachData($htmltosend, 'invoice.pdf', array('mime' => 'application/pdf', 'Content-Disposition' => 'attachment'));
         });
         $request->session()->flash('alert-success', 'Invoice has been set to client !');
         return redirect('home2');
     }
 }
Example #10
0
 function laporan_pdf($kd_fakultas, $kd_prodi, $tahun, $nim)
 {
     $this->load->library('HTML2PDF');
     $html2pdf = new HTML2PDF('P', 'A4', 'fr');
     $html2pdf->setDefaultFont('Arial');
     //filter
     #get filter
     $fil['kd_fakultas'] = $kd_fakultas;
     $fil['kd_prodi'] = $kd_prodi;
     $fil['tahun'] = $tahun;
     $fil['nim'] = $nim;
     //$data['nama'] = '';
     $data['namaUniv'] = 'STMIK BANDUNG';
     $data['alamatUniv'] = 'Jl.Phh.Mustofa No. 39. Grand Surapati Core (SUCORE) Blok M No.19, Telp.022 - 7207777';
     $data['kotaUniv'] = 'Bandung, Jawa Barat';
     // ambil data dari tabel
     $data['data_pdf'] = $this->mdl_khs->get_pdf($fil, $nama_dosen);
     /* if (count($da['row'])==0){
     			echo "Data Tidak Tersedia";
     			return;
     		} */
     $konten = $this->load->view('perkuliahan/khs_laporan', $data, true);
     $html2pdf->writeHTML($konten, false);
     $html2pdf->Output('khs.pdf');
 }
function rappel($buffer)
{
    $date = date('Ymd-hi');
    $html2pdf = new HTML2PDF('P', 'LETTER', 'fr');
    $html2pdf->writeHTML($buffer);
    $html2pdf->Output($date . '_valeur_inventaire.pdf', 'D');
}
Example #12
0
function html2pdf($html, $nombre = "archivo.pdf", $orientacion = "P", $tamanio = "A4", $tituloDocumento = '')
{
    $colegioSessionBean = new ColegioSessionBean();
    $fechaActual = obtenerFechaActualFull();
    $html = str_replace("\\", "", $html);
    ob_start();
    //include(dirname(__FILE__).'/res/exemple07a.php');
    //include(dirname(__FILE__).'/res/exemple07b.php');
    echo '<link rel="stylesheet" href="' . PATH_HTTP . 'css/tablas.css" type="text/css" />';
    //$html = ereg_replace("\\", "XD", $html);
    echo '<table>
    	<tr>
    		<td align="center" width="1200"><strong>' . $colegioSessionBean->getNombre() . '</strong> <br/>' . $tituloDocumento . '</td>
    		<td rowspan="2"><img alt="logo" title="logo" src="' . PATH_HTTP . 'images/' . $colegioSessionBean->getColegio_ID() . '/logo.jpg"></td>
    	</tr>
    	</table>
    	<div style="width:1200px; align=right;font-size:8px;">Informe generado el ' . $fechaActual . '</div><br/>';
    echo $html;
    $content = ob_get_clean();
    // conversion HTML => PDF
    //require_once(dirname(__FILE__).'/../html2pdf.class.php');
    $html2pdf = new HTML2PDF($orientacion, $tamanio, 'es');
    $html2pdf->pdf->SetDisplayMode('fullpage');
    //$html2pdf->pdf->
    //	$html2pdf->pdf->SetProtection(array('print'), 'spipu');
    $html2pdf->WriteHTML($content, isset($_GET['vuehtml']));
    //echo $content;
    $html2pdf->Output($nombre);
}
Example #13
0
 protected static function HTML2PDF($html, $fileout)
 {
     self::loadLib('/html2pdf/html2pdf.class.php');
     $html2pdf = new HTML2PDF('P', 'A4', 'en');
     $html2pdf->WriteHTML($html);
     return $html2pdf->Output($fileout, 'F');
 }
Example #14
0
 /**
  * @throws HTML2PDF_exception
  */
 public function html2pdf()
 {
     $content = "\n\t\t<page>\n\t\t    <h1>Exemple d'utilisation</h1>\n\t\t    <br>\n\t\t    Ceci est un <b>exemple d'utilisation</b>\n\t\t    de <a href='http://html2pdf.fr/'>HTML2PDF</a>.<br>\n\t\t</page>";
     //require_once(dirname(__FILE__).'/html2pdf/html2pdf.class.php');
     $html2pdf = new HTML2PDF('P', 'A4', 'fr');
     $html2pdf->WriteHTML(file_get_contents($this->load->view('htmlpdf')));
     $html2pdf->Output('exemple.pdf');
 }
Example #15
0
 public function convertHtmlToFormat($orientation = 'P')
 {
     require_once 'html2pdf/html2pdf.class.php';
     $html2pdf = new HTML2PDF($orientation, 'A4', 'fr');
     $html2pdf->setDefaultFont('times');
     $html2pdf->WriteHTML($this->docTemplate->render());
     $this->doc = $html2pdf->Output(NULL, 'S');
 }
Example #16
0
 public function convert($data)
 {
     $width = 8.5 * 25.4;
     $height = 11 * 25.4;
     $html = new HTML2PDF('P', array($width, $height), 'en');
     $html->writeHTML($data);
     //		header('Cache-Control: private, max-age=0, must-revalidate');
     $html->Output('resume.pdf');
 }
Example #17
0
 /**
  *  Recieve the html and generate the pdf
  * @param string $html
  */
 function setOrderPdf($html, $fileName)
 {
     ob_end_clean();
     $html2pdf = new HTML2PDF('P', 'A4', 'en', true, 'UTF-8', array(mL, mT, mR, mB));
     //$html2pdf->addFont("times");
     $html2pdf->WriteHTML($html);
     $html2pdf->Output($fileName . '.pdf');
     die;
 }
Example #18
0
 function laporan_pdf($date_1, $date_2)
 {
     $this->load->library('HTML2PDF');
     $html2pdf = new HTML2PDF('P', 'A4', 'fr');
     $html2pdf->setDefaultFont('Arial');
     $data['data_pdf'] = $this->mdl_report_delivery->report_delivery_pdf($date_1, $date_2);
     $konten = $this->load->view('report_delivery/delivery_report', $data, true);
     $html2pdf->writeHTML($konten, false);
     $html2pdf->Output("Report_delivery_" . $date_1 . " To " . $date_2 . ".pdf");
 }
 /**
  * Creates a new HTML2PDF object. 
  * Can be overridden to create renderers with non-default options.
  */
 protected static function create_new_pdf_writer($orientation = self::ORIENTATION_PORTRAIT, $paper_size = self::PAPER_LETTER, $language = self::LANGUAGE_ENGLISH)
 {
     //create a new HTML2PDF object
     $pdf = new HTML2PDF($orientation, $paper_size, $language, false, 'ISO-8859-1');
     //true, 'UTF-8');
     //$pdf =  new HTML2PDF($orientation, $paper_size, $language, true, 'UTF-8');
     //set the font
     $pdf->setDefaultFont('Times');
     return $pdf;
 }
Example #20
0
 public function cetak()
 {
     $npm = $this->session->userdata('npm');
     ob_start();
     $data['nilai'] = $this->Model_nilai->getNilai($npm);
     $this->load->view('member/nilai/print', $data);
     $html = ob_get_contents();
     ob_get_clean();
     require_once './assets/html2pdf/html2pdf.class.php';
     $pdf = new HTML2PDF('P', 'A4', 'en');
     $pdf->WriteHTML($html);
     $pdf->Output('Data Nilai.pdf', 'R');
 }
Example #21
0
 private function generarPDF($vista, $data, $orientacion)
 {
     require_once app_path('/ayudantes/report/html2pdf.class.php');
     $pdf = new \HTML2PDF($orientacion, 'letter', 'es');
     $pdf->pdf->SetDisplayMode('fullpage');
     try {
         $html = \View::make($vista, $data)->render();
         $pdf->writeHTML($html);
         $pdf->Output($vista . '.pdf');
     } catch (\HTML2PDF_exception $e) {
         die($e . " :(");
     }
     die;
 }
Example #22
-1
 public function generatePdf(PdfEvent $event)
 {
     $html2pdf = new \HTML2PDF($event->getOrientation(), $event->getFormat(), $event->getLang(), $event->getUnicode(), $event->getEncoding(), $event->getMarges());
     $html2pdf->pdf->SetDisplayMode('real');
     $html2pdf->writeHTML($event->getContent());
     $event->setPdf($html2pdf->output(null, 'S'));
 }
Example #23
-1
function convert2pdf($content, $file_name)
{
    if ($file_name == '') {
        $file_name = date('y_m_d_h_m_s') . '.pdf';
    }
    require_once dirname(__FILE__) . '/html2pdf.class.php';
    // get the HTML
    //ob_start();
    //include(dirname(__FILE__).'/about_1.php');
    //$content = ob_get_clean();
    try {
        // init HTML2PDF
        $html2pdf = new HTML2PDF('P', 'A4', 'en', true, 'UTF-8', array(0, 0, 0, 0));
        $html2pdf->setDefaultFont('dejavusans');
        //add this line
        // display the full page
        $html2pdf->pdf->SetDisplayMode('fullpage');
        // convert
        $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
        // add the automatic index
        //$html2pdf->createIndex('Sommaire', 30, 12, false, true, 2);
        // send the PDF
        $html2pdf->Output($file_name);
    } catch (HTML2PDF_exception $e) {
        echo $e;
        exit;
    }
}
/**
 * Newscoop article_pdf function plugin
 *
 * Type:     function
 * Name:     article_pdf
 * Purpose:
 *
 * @param array
 *     $params[template]
 *     $params[prefix]
 * @param object
 *     $smarty The Smarty object
 */
function smarty_function_article_pdf($params, &$smarty)
{
    // gets the context variable
    $gimme = $smarty->getTemplateVars('gimme');
    if (isset($params['template'])) {
        $template = $params['template'];
    }
    $pdf_filename = '';
    if (isset($params['prefix'])) {
        $pdf_filename = $params['prefix'] . '-';
    }
    $publish = new DateTime($gimme->article->publish_date);
    $pdf_filename .= 'p' . $publish->format('Ymd') . '-n' . $gimme->article->number . '.pdf';
    $pdf_file = 'public/pdf/' . $pdf_filename;
    if (!file_exists($pdf_file) || $gimme->article->last_update > date('Y-m-d h:i:s', filemtime($pdf_file))) {
        require 'include/html2pdf/html2pdf.class.php';
        try {
            $content = $smarty->fetch($template);
            $html2pdf = new HTML2PDF('P', 'A4', 'de');
            $html2pdf->pdf->SetDisplayMode('real');
            $html2pdf->writeHTML($content);
            $html2pdf->Output($pdf_file, 'F');
        } catch (HTML2PDF_exception $e) {
            return '';
        }
    }
    return $pdf_file;
}
Example #25
-1
 public static function write($content, $dir)
 {
     try {
         $html2pdf = new HTML2PDF('P', 'A4', 'es');
         $html2pdf->writeHTML($content);
         $html2pdf->Output($dir, 'F');
         return true;
     } catch (Exception $ex) {
         print_r($ex);
         return false;
     }
 }
Example #26
-2
 function laporan_pdf_kode($kode_barang)
 {
     $this->load->library('HTML2PDF');
     $html2pdf = new HTML2PDF('L', 'A4', 'fr');
     $html2pdf->setDefaultFont('Arial');
     $data['data_pdf'] = $this->mdl_report_buy->report_buy_pdf_kode($kode_barang);
     $konten = $this->load->view('report_buy/buy_report_kode', $data, true);
     $html2pdf->writeHTML($konten, false);
     $html2pdf->Output("Report_buy" . $kode_barang . ".pdf");
 }
Example #27
-2
 public function save($file)
 {
     $pdfs = array();
     foreach ($this->_html as $i => $page) {
         $f = '/tmp/' . Athem_Utils::randString(10);
         $pdf = new HTML2PDF($this->_getOrientation(), $this->_getSize(), 'en');
         $pdf->WriteHTML($page);
         $pdf->Output("{$f}.pdf", 'F');
         $pdfs[] = "{$f}.pdf";
     }
     $pdfMerge = Athem_Pdf_Merge_Abstract::factory($this->_page['merge'], $pdfs);
     $pdfMerge->save($file);
 }
Example #28
-3
 public function render($file = NULL)
 {
     $html = parent::render($file);
     $html2pdf = new HTML2PDF('P', 'A4', $this->_langue);
     $html2pdf->pdf->SetAuthor($this->_author);
     $html2pdf->pdf->SetTitle($this->_title);
     $html2pdf->pdf->SetSubject($this->_subject);
     $html2pdf->pdf->SetKeywords($this->_keywords);
     $html2pdf->WriteHTML($html);
     $html2pdf->Output('public/pdf/' . $this->_name, 'F');
 }
Example #29
-25
 public function actionPendidikans()
 {
     $html2pdf = Yii::app()->ePdf->html2pdf('L', 'A4', 'en', false, 'ISO-8859-15', array(10, 5, 10, 5));
     $html2pdf->pdf->SetDisplayMode('fullpage');
     $dosen = Yii::app()->request->getParam('id_dosen', 0);
     $pj = Yii::app()->request->getParam('pengajuan', 0);
     $sql = "select unsur_pendidikan.ID_UNSUR_PEND,subun_pend.SUBUNPEND,tbl_dosen.NAMA_DOSEN, tbl_dosen.NIP_DOSEN, \n                  tbl_jabatan.NAMA_JABATAN, tbl_golongan.GOLONGAN, tbl_golongan.PANGKAT, tbl_jurusan.NAMA_JURUSAN, \n                  tbl_jurusan.NAMA_PIMPINAN, tbl_jurusan.NIP_PIMPINAN, tbl_jurusan.PANGKAT AS PJ, tbl_jurusan.GOLONGAN AS GJ, tbl_fakultas.NAMA_FAKULTAS, \n                  unsur_pendidikan.KEGIATAN_PENDIDIKAN, unsur_pendidikan.TEMPAT_PENDIDIKAN, \n                  unsur_pendidikan.TGL_KEGIATAN_PEND, unsur_pendidikan.NILAI_PENDIDIKAN, \n                  unsur_pendidikan.BUKTI_PENDIDIKAN, unsur_pendidikan.PENGAJUAN_KE \n                  from unsur_pendidikan inner join subun_pend on \n                  unsur_pendidikan.ID_SUBUNPEND=subun_pend.ID_SUBUNPEND join tbl_dosen \n                  on unsur_pendidikan.ID_DOSEN=tbl_dosen.ID_DOSEN join tbl_jabatan on \n                  tbl_dosen.ID_JABATAN=tbl_jabatan.ID_JABATAN join tbl_golongan on \n                  tbl_dosen.ID_GOLONGAN=tbl_golongan.ID_GOLONGAN join tbl_jurusan on \n                  tbl_dosen.ID_JURUSAN=tbl_jurusan.ID_JURUSAN join tbl_fakultas on \n                  tbl_jurusan.ID_FAKULTAS=tbl_fakultas.ID_FAKULTAS where \n                  unsur_pendidikan.ID_DOSEN='{$dosen}' and unsur_pendidikan.PENGAJUAN_KE='{$pj}' ";
     $data = Yii::app()->db->createCommand($sql)->queryAll();
     $content = $this->renderPartial('pendidikans', array('data' => $data), true);
     $html2pdf = new HTML2PDF('L', 'A4', 'en', array(10, 5, 10, 5));
     $html2pdf->WriteHTML($content);
     $html2pdf->Output();
 }
Example #30
-40
 public function printInvoice($id)
 {
     $data = $this->payment_model->get($id);
     if (!$data) {
         echo "Not data";
         die;
     } else {
         //echo $id;
         $this->template = new View('admin_invoice/invoice', true);
         $this->template->set(array('test' => $this->test_model->get($data['test_uid']), 'member' => $this->member_model->get($data['member_uid']), 'mr' => $data));
         require Kohana::find_file('vendor/html2pdf', 'html2pdf');
         $html2pdf = new HTML2PDF();
         //$html2pdf->HTML2PDF('L','A4', 'en', array(10, 10, 10, 10));
         $html2pdf->HTML2PDF('P', 'letter', 'en', array(10, 10, 10, 10));
         $html2pdf->WriteHTML($this->template, false);
         echo $html2pdf->Output('Sales_Order_' . $data['uid'] . '.pdf');
     }
 }