<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Feereceipt extends CI_Controller {
    public function __construct(){
        parent::__construct();
        $this->load->helper('text');
        $this->load->helper(array('form','url'));
        date_default_timezone_set('Asia/Kolkata');
        $this->load->helper('date');
        $this->load->database();
        $this->load->model('NewFeeModel');
        $this->load->library('form_validation');
        $this->load->helper(array('form', 'url'));
        $this->load->library('session');
        $this->load->library('Pdf');
    }

    public function index(){
        
    }
    
  public function fee_invoice($fee_no){
    $get_fee_info=$this->NewFeeModel->get_invoice_data($fee_no);
    if($get_fee_info){
    $old_limit = ini_set("memory_limit", "16M");
    $dompdf = new Pdf();
        
    $dompdf->set_paper('letter', 'portrait'); //landscape , portrait
    $html_content = '';        
    $html_content .= $this->NewFeeModel->fee_invoice($fee_no);
    $this->pdf->loadHtml($html_content);
    $this->pdf->render();
    $this->pdf->stream("".$fee_no.".pdf", array("Attachment"=>0));
    }
}
}
