Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Pdf extends CI_Controller {
- public function __construct() {
- parent::__construct();
- $this->load->library('M_pdf');
- }
- public function index() {
- //load view
- $this->load->model("crud_model");
- $data["fetch_data_seminar"] = $this->crud_model->fetch_data_seminar();
- $data1["fetch_data_conf"] = $this->crud_model->fetch_data_conf();
- $data2["fetch_data_extra"] = $this->crud_model->fetch_data_extra();
- $data3["fetch_data_cgpa"] = $this->crud_model->fetch_data_cgpa();
- $data4["fetch_data_representation"] = $this->crud_model->fetch_data_representation();
- $data5["fetch_data_participation"] = $this->crud_model->fetch_data_participation();
- $data6["fetch_data_organ"] = $this->crud_model->fetch_data_organ();
- $data7["fetch_data_events"] = $this->crud_model->fetch_data_events();
- $data8["fetch_data_program"] = $this->crud_model->fetch_data_program();
- $data_array = array(
- 'seminar' => $data,
- 'conf' => $data1,
- 'extra' => $data2,
- 'cgpa' => $data3,
- 'representation' => $data4,
- 'participation' => $data5,
- 'organ' => $data6,
- 'events' => $data7,
- 'program' => $data8,
- );
- $showdata = [];
- $html = $this->load->view('makepdf', $data_array, TRUE);
- $pdfFilePath = "download.pdf";
- $this->m_pdf->pdf->WriteHTML($html);
- $this->m_pdf->pdf->Output(pdfFilePath . pdf, "D");
- }
- public function generatepdf() {
- }
- }
- $pdfFilePath = "download.pdf";
- //save in folder
- $this->m_pdf->pdf->Output("./your_folder_location/".$pdfFilePath, "F");
- //download file
- $this->m_pdf->pdf->Output($pdfFilePath, "D");
Add Comment
Please, Sign In to add comment