Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $id_pemohon = $this->uri->segment(4);
- $detail = $this->apotik_model->select_detail_pemohon($id_pemohon)->row();
- $xnomor = $detail->no_register;
- $xnmapotik = $detail->nama_apotek;
- $this->load->library('PHPWord');
- $PHPWord = new PHPWord();
- $document = $PHPWord->loadTemplate('template_surat/piagam_apotek1.docx');
- $document->setValue('nomor1', $xnomor);
- $document->setValue('vnamaapotek', $xnmapotik);
- $time = time();
- $filename = 'Piagam_apotek_'.$time.'.docx';
- //$document->save($filename);
- header("Content-type: application/vnd.ms-word");
- header('Content-Disposition: attachment;filename="'.$filename.'"'); //tell browser what's the file name
- header('Cache-Control: max-age=0'); //no cache
- $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
- $objWriter->save($filename);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement