ria/application/controllers/c_test.php
venbatechnologies@gmail.com b1c8fe52a4 issues fixes
2018-07-12 12:34:06 +05:30

53 lines
1.4 KiB
PHP
Executable File

<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
require APPPATH . '/libraries/BaseController.php';
class C_test extends BaseController {
function __construct()
{
parent::__construct();
$this->load->model('purchaseorder_model');
$this->load->library('session');
$this->isLoggedIn();
//$this->load->library('grocery_CRUD');
}
public function create_pdf() {
// Load all views as normal
$PONO = $_GET['PO'];
$data['PODetail'] = $this->purchaseorder_model->getPurchaseOrder($PONO);
$data['POLineItem'] = $this->purchaseorder_model->getPOLineItem($PONO);
//$data['CompanyDtl'] = $this->purchaseorder_model->getcompanydtl();
print_r($data['CompanyDtl']);
//$this->global['pageTitle'] = 'Purchase Order Report';
// Add header to pdf
$this->load->view('includes/pdfheader');
// Load the pdf page with multiviews
$this->load->View("create_pdf", $data, NULL);
// Add header to pdf
$this->load->view('includes/pdffooter');
// Get output html
$php = $this->output->get_output();
// Load library
$this->load->library('dompdf_gen');
// Convert to PDF
$this->dompdf->load_html($php);
$this->dompdf->render();
$data['Attachment'] = FALSE;
$this->dompdf->stream("PurchaseOrderreport.pdf",$data,$php);
}
}