Guest User

Untitled

a guest
Nov 17th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. <form class="form" method="get" action="<?=site_url()?>/laporan/pdfdownload" id="myID" name="myName">
  2. <select id="sel1" class="form-control">
  3. <option disabled selected="selected">Pilih</option>
  4. <?php foreach ($kerja as $rows){?>
  5. <option value="<?php echo $rows->id_project?>"><?php echo $rows->id_project.' - '.$rows->nama_project ?></option>
  6. <?php }?>
  7. </select>
  8. <select id="sel2" class="form-control">
  9. <option disabled selected="selected">Pilih</option>
  10. <?php foreach ($item as $rows){?>
  11. <option value="<?php echo $rows->id_project?>"><?php echo $rows->id_project.' - '.$rows->nama_project ?></option>
  12. <?php }?>
  13. </select>
  14. <button id="filter_button" style="margin-top: 26px;margin-left: 28px;width: auto" name="filter_button" type="submit" class="form btn btn-danger"><i class="fa fa-search"></i>&nbspSearch</button>
  15. </form>
  16.  
  17. public function pdfdownload(){
  18. //If i click submit then all of the post didnt get sended
  19. $one = $this->input->post('sel1');//no value at all, anyone know why?
  20. $two = $this->input->post('sel2');//no value at all, anyone know why?
  21.  
  22. $data['real'] = $this->report_m($one,$two)->row();
  23.  
  24. htmlcontent = $this->load->view('laporan/download/laporan3.php',$data,true);
  25. include(APPPATH."third_party/dompdf/autoload.inc.php");
  26. // require_once APPPATH . 'third_party/dompdf/autoload.inc.php';
  27. $dompdf = new DompdfDompdf();
  28. $dompdf->load_html($htmlcontent);
  29. $dompdf->set_paper("f4");
  30. $dompdf->render();
  31. $dompdf->stream("cobadlu.pdf",array("Attachment" => false));
  32. exit(0);
  33. }
  34.  
  35. enter code here
Add Comment
Please, Sign In to add comment