public function exportListToolPDF() { $where = ''; if ($this->input->post('order_id_all')) { $order_id_all = $this->input->post('order_id_all'); $where = "order_id in ({$order_id_all})"; } $order_tools = $this->general_model->get_all('order_tools', $where, '', 'check_date asc'); $file_name = 'รายงานการสั่งและเบิกอุปกรณ์ '; ob_start(); $arr_data = array(); $arr_data_tmp = array(); ?> <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?> asset/css/style.css"> <meta charset="utf-8"> <style> .table-bordered,.table-bordered td ,.table-bordered th { border: 1px solid black; line-height: 20px; border-collapse: collapse; padding:5px; font-size: 12px; } body { background-color: #FFF; } </style> <div class="span12" style="text-align: center;"> <h2>การสั่ง และ เบิกอุปกรณ์ จำแนกตามรายการ</h2> </div> <table class="table table-bordered" style="width: 100%;"> <tr class=""> <th style="text-align: center;width: 50px;">ลำดับ</th> <th style="text-align: left">รายชื่อผู้ป่วย</th> <th style="text-align: center"> วันที่ใช้บริการ </th> <th style="text-align: center">อุปกรณ์</th> <th style="text-align: center">ประเภทขา</th> <th style="text-align: center">ขนาด/เบอร์</th> <th style="text-align: center">จำนวน</th> <th style="text-align: center">หน่วย</th> <th style="text-align: center">หมายเหตุ</th> </tr> <?php if (!empty($order_tools)) { foreach ($order_tools as $key => $value) { ?> <tr> <td style="text-align: center"><?php echo ++$this->start_no; ?> </td> <td style="text-align: left;white-space: nowrap; "><?php echo _pat_name($value['pat_id']); ?> </td> <td style="text-align: center"><?php echo _set_date($value['check_date']); ?> </td> <td style="text-align: left"><?php echo _get_tools_name($value['tool_id']); ?> </td> <td style="text-align: center"><?php echo _get_group_tool_name($value['tool_id']); ?> </td> <td style="text-align: center"><?php echo $value['set_type']; ?> </td> <td style="text-align: center"><?php echo $value['count']; ?> </td> <td style="text-align: center"><?php echo $value['unit']; ?> </td> <td style="text-align: left"><?php echo $value['comment']; ?> </td> </tr> <?php } } else { ?> <tr> <td colspan="9" style="text-align: center"> -- ไม่มีข้อมูลอุปกรณ์ --</td> </tr> <?php } ?> </table> <?php // die(); $html = ob_get_contents(); ob_end_clean(); // header('Content-type: application/pdf'); $this->mpdf = new mPDF('th', 'A4', '0'); // mode - default '' $this->mpdf->WriteHTML($html); // สั่งให้ mPDF เขียนไฟล์ pdf $this->mpdf->SetHTMLHeader('dsfasd'); // $this->mpdf->setFooter('{PAGENO}'); $this->mpdf->SetHTMLFooter("วันที่ออกเอกสาร : " . _set_date(date('Y-m-d'))); $this->mpdf->Output($file_name . '.pdf', 'I'); // จากนั้นส่งชื่อไฟล์ออกมาครับผม }
<th style="text-align: center">หมายเหตุ</th> <th style="text-align: center">#</th> </tr> <?php if (!empty($list_meet)) { foreach ($list_meet as $key => $value) { ?> <tr> <td style="text-align: center"><?php echo ++$this->start_no; ?> </td> <td style="text-align: left;white-space: nowrap; "> <?php echo _pat_name($value['pat_id']); ?> <?php if ($value['check_id'] != '') { ?> <a href="<?php echo base_url(); ?> patient/check_pat/<?php echo $value['check_id']; ?> " class='fancyboxhd fancybox.iframe btn btn-info' target="_blank" style="float: right"><i class="icon icon-user icon-white"></i></a> <?php } ?> </td>