public function profile_user($id = false) { $data['refere'] = $this->input->server('HTTP_REFERER', TRUE); if ($this->input->post('id') != false) { $id = $this->input->post('id'); $type_user = $this->input->post('type_user'); } elseif ($this->user_id != false) { $id = $this->user_id; $type_user = $this->usertype; } else { redirect(base_url()); } $table = $type_user . 's'; if ($type_user == 'doctor') { $data['topic_type'] = 'แพทย์'; $pre = 'doc'; } elseif ($type_user == 'staff') { $data['topic_type'] = 'เจ้าหน้าที่'; $pre = 'sf'; } elseif ($type_user == 'tech') { $data['topic_type'] = 'เจ้าหน้าที่ฝ่ายช่าง'; $pre = 'tech'; } elseif ($type_user == 'admin') { $table = 'users'; $data['topic_type'] = 'ผู้ดูแลระบบ'; } $profile = $this->general_model->Query1("select * from {$table} where user_id = {$id} limit 0,1"); $data['profile'][] = array('id' => $profile[0]['user_id'], $pre . 'id' => $profile[0][$pre . '_id'], 'name' => $profile[0][$pre . '_name'] . " " . $profile[0][$pre . '_lname'], 'birth' => _set_date($profile[0][$pre . '_birth']), 'address' => $profile[0][$pre . '_address'], 'tel' => $profile[0][$pre . '_tel'], 'email' => $profile[0][$pre . '_email'], 'type_user' => $type_user); $data['login'] = $this->general_model->Query1("select * from users where user_id = {$id} limit 0,1"); $view = 'core_' . $this->usertype . '_view'; parent::$view('profile', $data); }
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'); // จากนั้นส่งชื่อไฟล์ออกมาครับผม }
<?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> <td style="text-align: center"><?php echo _set_date($value['met_date']); ?> </td> <td style="text-align: center"><?php echo $value['met_time']; ?> </td> <td style="text-align: left"><?php echo $value['met_comment']; ?> </td> <td style="text-align: center;white-space: nowrap; "> <a href="<?php echo base_url(); ?> meet/edit_meet/<?php
public function export_checkpat_doctor($check_id) { if ($check_id == false) { $ref = $this->input->server('HTTP_REFERER', TRUE); redirect($ref, 'location'); } $data['check'] = $this->general_model->get_row('check_pat', "check_id = {$check_id} "); ## $check_order = $this->general_model->get_field('check_id', 'check_pat', "pat_id = {$data['check']['pat_id']}", 'date ASC,check_id ASC'); $i = 1; foreach ($check_order as $key => $value) { if ($value['check_id'] == $check_id) { $step = $i; ##ลำดับ } $i++; } $data['patient'] = $this->general_model->get_row('patients', "pat_id = {$data['check']['pat_id']}"); $data['evol'] = $this->general_model->get_row('evolution', "pat_id = {$data['check']['pat_id']} and check_id = {$data['check']['check_id']}"); ##ดึงเฉพาะล่าสุด $data['tool'][] = $this->general_model->get_row('order_tools', "check_id = {$data['check']['check_id']}"); ##ดึงเฉพาะล่าสุด $data['pat_adr1'] = $this->general_model->get_row('adress', "pat_id = {$data['check']['pat_id']} and ads_type ='1'"); $data['pat_adr2'] = $this->general_model->get_row('adress', "pat_id = {$data['check']['pat_id']} and ads_type ='2'"); //echo $this->db->last_query();die(); // $file_name = 'ใบตรวจ ครั้งที่ ' . $step . ' ' . $data['patient']['pat_name'] . ' ' . $data['patient']['pat_lname']; 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> body { background-color: white; } span { line-height: 3; } .no{ margin-top: 10px; margin-bottom: 8px; text-align: justify; font-size: 15px; } .sub_no { margin-top: 8px; text-align: justify; font-size: 15px; } </style> <div style=""> <div style="width: 100%;text-align: center;font-size: 16px;"> <div style="text-align: center;"> <span><b>มูลนิธิขาเทียมในสมเด็จพระศรีนครินทราบรมราชชนนี </b></span><br> <span><b>Prostheses Foundation of H.R.H. the Princess Mother</b></span><br> </div> <div style=""> <table style="width: 100%;line-height: 2;text-align: center;" > <tr> <td class="left" style="width: 30%;"><span><b>ชื่อ(Name) .......... <?php echo $data['patient']['pat_name'] . ' ' . $data['patient']['pat_lname']; ?> ..........</b></span> </td> <td class="left" style="width: 30%;"><span><b>อายุ(Age) ..... <?php echo $data['patient']['pat_year']; ?> .....ปี </b></span></td> <td class="left" style="width: 30%;"><span><b>อาชีพ(Occupation) .......... <?php echo $data['patient']['pat_job_current']; ?> .......... </b></span></td> </tr> <tr> <td class="left" colspan="3"><span><b>ที่อยู่(Adress) .......... <?php echo $data['patient']['pat_address_current']; ?> ..........</b></span> </td> </tr> <tr> <td class="left" colspan="2"><span><b>โทรศัพท์(Name) .......... <?php echo $data['patient']['pat_tel']; ?> ..........</b></span> </td> <td class="left"><span><b>เลขที่คนไข้(H.N. No.) ..... <?php echo $data['patient']['pat_id']; ?> ..... </b></span></td> </tr> </table> </div> <div> __________________________________________________________________________________________________________ </div> </div> <div style="width: 49.8%;height:100%;float: left;border-right:1px solid black;text-align: center;vertical-align: middle;font-size:16px;"> <div style="height: 100%;padding-top: 5px;line-height: 2;"> <div class="clear"></div> <div class="no" style=""> <span >วันที่ - <strong><?php echo _set_date($data['check']['check_date']); ?> </strong></span><br> </div> <div class="no" style=""> <span ><b>ประวัติ</b> </span><br> <span >1.ถูกตัดขาเมื่อ </span><br> <span>ขาซ้าย เมื่อ Left side - <strong><?php echo $data['patient']['pat_date_amp_left']; ?> </strong> </span><br> <span>ขาขวา เมื่อ Right side - <strong><?php echo $data['patient']['pat_date_amp_right']; ?> </strong> </span> </div> <div class="no" style=""> <span>2.สาเหตุ - <strong> <?php echo $data['check']['pat_cause']; ?> </strong> </span><br> </div> <div class="no" style=""> <span ><b>การตรวจร่างกาย</b> </span><br> <span>ความแข่งแรงระดับ - <strong> <?php echo $data['check']['strong']; ?> </strong></span><br> <span>พิสัยการเคลื่อนไว - <strong> <?php echo $data['check']['move']; ?> <?php echo $data['check']['move_degree']; ?> องศา </strong></span><br> <!-- <span>ความยาวต่อขา </span><br> <span>- ขาซ้าย ..... <?php echo $data['check']['long_per_leg_left']; ?> .....</span><br> <span>- ขาขวา ..... <?php echo $data['check']['long_per_leg_right']; ?> .....</span><br> --> <span>ลักษณะผิวหนัง - <strong> <?php echo $data['check']['skin']; ?> </strong></span> </div> </div> </div> <div style="width: 49.8%;height:100%;float: left;line-height:2;margin-left:15px;"> <div class="no" style=""> <span>การบวม - <stron> <?php echo $data['check']['tumor']; ?> </stron> </span><br> <span>การวินิจฉัย - <stron> ขา <?php echo $data['check']['diagnosis_type']; ?> </stron> </span><br> <span>ข้างซ้าย Left - <strong><?php echo $data['check']['diagnosis_left']; ?> </strong> </span><br> <span>ข้างขวา Right - <strong><?php echo $data['check']['diagnosis_right']; ?> </strong> </span><br> <span>คำสั่ง </span><br> <?php $tools = $this->get_value->get_tools_by_check_id($data['check']['check_id']); if ($tools != false) { foreach ($tools as $k_tool => $v_tool) { ?> <span style='padding-left:20px;'> - <?php echo $v_tool['order_type'] . ' : ขา ' . $v_tool['neck'] . ' : ' . $this->get_value->get_tools_id($v_tool['tool_id']); ?> <br><?php echo $v_tool['set_type'] . ' ' . $v_tool['set_type_val'] . ' จำนวน ' . $v_tool['count'] . ' ' . $v_tool['unit']; ?> <br><?php echo $v_tool['order_cause'] != '' ? " เหตุผล {$v_tool['order_cause']}" : ''; ?> </span ><br> <?php } } ?> </div> <br><br> <div class="no" class="right"> <span style="padding-right:25px;"><b>แพทย์ผู้ตรวจ</b> </span><br> <span > <?php echo _doctor_name($data['check']['doc_id']); ?> </span><br> </div> </div> </div> <?php //die(); $html = ob_get_contents(); ob_end_clean(); $this->mpdf = new mPDF('th', 'A4-L', '0', '5px', '5px', '5px', '5px'); // mode - default '' $this->mpdf->WriteHTML($html); // สั่งให้ mPDF เขียนไฟล์ pdf $this->mpdf->Output($file_name . '.pdf', 'D'); // จากนั้นส่งชื่อไฟล์ออกมาครับผม // $view = 'core_' . $this->usertype . '_view'; // parent::$view('pat/history', $data); }
<div id="check_pat"> <div style="width:50%;float:left"> <?php include 'check_pat_info.php'; ?> </div> <?php if ($cheked == false) { ?> <div style="width:50%;float:left;"> <label for="title" class="control-label">การประเมิณหลังทำสวยงาม</label> <div class="control-group"> <label for="title" class="control-label">วันที่ประเมิณหลังทำสวยงาม : </label> <?php echo _set_date($value2['date_check_after']); ?> </div> <div class="control-group"> <div class="controls"> <?php echo $value2['result']; ?> <?php echo $value2['result'] == 'แก้ไข' ? $value2['result_detail'] : ''; ?> </div> </div> <div class="control-group">
</ul> <div id="check_pat"> <div style="width:50%;float:left"> <?php include 'check_pat_info.php'; ?> </div> <div style="width:50%;float:left;"> <label for="title" class="label_set">การตรวจก่อนทำสวยงาม</label> <div class="control-group"> <label for="title" class="control-label">วันที่ตรวจก่อนทำสวยงาม : </label> <?php echo _set_date($value2['date_check_before']); ?> </div> <!-- <div class="control-group"> <label for="title" class="control-label">ชื่อช่าง</label> <div class="controls"> <?php echo _get_techFromCheckId($value2['check_id']); ?> </div> </div> <div class="control-group"> <label for="title" class="control-label">เบ้า</label> <div class="controls"> <?php
</div> <div class="control-group"> <label for="title" class="control-label">ชือผู้ป่วย : </label> <?php echo $pat['prefix'] . $pat['pat_name'] . ' ' . $pat['pat_lname']; ?> </div> <div class="control-group"> <label for="title" class="control-label">วันที่ถุกตัด : </label><br> <div style="margin-left: 75px;"> <?php if ($pat['pat_date_amp_left'] != '' && $pat['pat_date_amp_left'] != '0000-00-00') { echo "ขาซ้าย เมื่อ " . _set_date($pat['pat_date_amp_left']) . '<br>'; } if ($pat['pat_date_amp_right'] != '' && $pat['pat_date_amp_right'] != '0000-00-00') { echo "ขาขวา เมื่อ " . _set_date($pat['pat_date_amp_right']) . '<br>'; } ?> </div> </div> <div class="control-group"> <label for="title" class="control-label">สาเหตุ : </label> <?php echo $pat['pat_cause']; ?> </div> <div class="control-group"> <label for="title" class="control-label">สถานะการตรวจ : </label><br> <div style="margin-left: 75px;"> <?php echo $value2['check_status'] != '' ? $value2['check_status'] : 'ยังไม่ได้รับการตรวจ';
?> </div> <div style="width:50%;float:left;"> <label for="title" class="label_set">การประเมิณหลังทำสวยงามแล้ว</label> <div class="control-group"> <label for="title" class="control-label">วันที่ประเมิณหลังทำสวยงาม</label> <?php if ($value2['date_check_after'] == '' or $value2['date_check_after'] == '0000-00-00 00:00:00' or $value2['date_check_after'] != date('Y-m-d H:i:s')) { ?> <input type="hidden" name="date_check_after" value="<?php echo date('Y-m-d'); ?> " ><?php echo _set_date(date('Y-m-d')); ?> <?php } else { ?> <input type="date" name="date_check_after" value="<?php echo $value2['date_check_after']; ?> " > <?php } ?> </div>
<?php if (!empty($list_tools)) { foreach ($list_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
function pdf_list_tool() { if ($this->input->post('order_id')) { $order_id = implode(',', $this->input->post('order_id')); // var_dump($tool_id );die(); $list = $this->general_model->QueryAll("\n select t1.check_id,t1.tech_id,t1.tool_id,t1.order_type,t1.tool_type,t1.order_status,t1.order_id,\n t2.tech_name,t2.tech_lname,\n t4.prefix, t4.pat_name,t4.pat_lname,\n t3.check_date\n from order_tools t1 \n left join techs t2 on t1.tech_id = t2.user_id\n left join check_pat t3 on t1.check_id = t3.check_id\n left join patients t4 on t3.pat_id = t4.pat_id\n where \n t1.order_id in ({$order_id})\n \n order by t1.check_id ASC\n \n "); foreach ($list as $key => $value) { $data['list'][] = array('pat_id' => $value['pat_id'], 'tech_name' => $value['tech_name'] . ' ' . $value['tech_lname'], 'pat_name' => $value['prefix'] . $value['pat_name'] . ' ' . $value['pat_lname'], 'tool_name' => _get_tools_name($value['tool_id']), 'order_id' => $value['order_id'], 'check_status' => _get_tools_name($value['tool_id']), 'date' => _set_date($value['check_date'])); } $file_name = 'รายงานการจัดทำอุปรณ์ '; if ($_POST['date_start']) { $file_name .= ' วันที่ ' . _set_date($_POST['date_start']) . ' ถึง ' . _set_date($_POST['date_end']); } else { $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> body { background-color: white; } </style> <div style="text-align: center;"> <h2 style="margin-top: 25px"> รายงานการจัดทำอุปรณ์ <?php if ($_POST['date_start']) { echo ' วันที่ ' . _set_date($_POST['date_start']) . ' ถึง ' . _set_date($_POST['date_end']); } else { echo " ทั้งหมด "; } ?> </h2> <style> table { border-collapse: collapse; } table, td, th { border: 1px solid black; } td{ line-height: 1.5; } </style> <table class="table"> <tr > <th style="text-align: center">ลำดับ</th> <th style="text-align: center">วันที่</th> <th style="text-align: center">ผู้ป่วย</th> <th style="text-align: center"> <?php if ($this->router->fetch_method() == 'export_list_service') { echo "สถานะการรักษา"; } ?> <?php if ($this->router->fetch_method() == 'export_list_check') { echo "สถานะการรักษา"; } ?> <?php if ($this->router->fetch_method() == 'export_list_tool') { echo "อุปกรณ์"; } ?> </th> <th style="text-align: center"> <?php if ($this->router->fetch_method() == 'export_list_service') { echo "ให้บริการโดย"; } ?> <?php if ($this->router->fetch_method() == 'export_list_check') { echo "แพทย์ผู้ตรวจ"; } ?> <?php if ($this->router->fetch_method() == 'export_list_tool') { echo "ช่างผู้จัดทำ"; } ?> </th> <!-- <?php if ($this->router->fetch_method() == 'export_list_tool') { ?> <th> อุปกรณ์</th> <?php } ?> --> </tr> <?php if (isset($data['list'])) { $i = 1; foreach ($data['list'] as $key => $value) { ?> <tr> <td class="table_no"> <center><?php echo $this->start_no + 1; ?> </center> <?php if ($this->router->fetch_method() == 'export_list_tool') { ?> <input type="hidden" name="tool_id[]" value="<?php echo $value['tool_id']; ?> "> <?php } else { ?> <input type="hidden" name="check_id[]" value="<?php echo $value['check_id']; ?> "> <?php } ?> </td> <td style="text-align: center"><?php echo $value['date']; ?> </td> <td style="text-align: center"><?php echo $value['pat_name']; ?> </td> <td style="text-align: center"><?php echo $value['check_status']; ?> </td> <td style="text-align: center"> <?php if ($this->router->fetch_method() == 'export_list_service') { echo $value['sf_name']; } ?> <?php if ($this->router->fetch_method() == 'export_list_check') { echo $value['doc_name']; } ?> <?php if ($this->router->fetch_method() == 'export_list_tool') { echo $value['tech_name']; } ?> </td> <!-- <?php if ($this->router->fetch_method() == 'export_list_tool') { ?> <td> <?php echo $value['tool_name']; ?> </td> <?php } ?> --> </tr> <?php $this->start_no++; } } ?> </table> <?php $html = ob_get_contents(); ob_end_clean(); $this->mpdf = new mPDF('th', 'A4', '0', ''); // mode - default '' $this->mpdf->WriteHTML($html); // สั่งให้ mPDF เขียนไฟล์ pdf $this->mpdf->Output($file_name . '.pdf', 'D'); // จากนั้นส่งชื่อไฟล์ออกมาครับผม } ## }
</label>.....</span> </div> <div class="no" style=""> <span>1.11 สาเหตุที่ถูกตัดขา Cause of amputation .....<label><?php echo $patient['pat_cause']; ?> </label>.....</span> </div> <div class="no" style=""> <span>1.12 วันที่ถูกตัดขา Date of amputation </span><br> <span>ขาซ้าย เมื่อ Left side .....<label><?php echo strtotime($patient['pat_date_amp_left']) != false ? _set_date($patient['pat_date_amp_left']) : $patient['pat_date_amp_left']; ?> </label>.....</span><br> <span>ขาขวา เมื่อ Right side .....<label><?php echo strtotime($patient['pat_date_amp_right']) != false ? _set_date($patient['pat_date_amp_right']) : $patient['pat_date_amp_right']; ?> </label>.....</span> </div> <div class="no" style=""> <span> 1.13 ชนิดของขาที่ถูกตัด Amputation's type ..... <?php echo _get_AmpTypeName($patient['amp_type_id']); ?> <?php echo $patient['amp_type_id'] == '' ? 'อื่นๆ คือ ' . $patient['amp_type_id'] : ''; ?> ..... </span>
function _get_meet($pat_id) { if ($pat_id == false) { return ''; die; } $CI =& get_instance(); $CI->load->model('general_model'); // $row = $CI->general_model->get_row_select('check_id', 'check_pat', "pat_id = {$pat_id}", "order by check_id desc limit 1"); $query = $CI->db->query("select check_id from check_pat where pat_id = {$pat_id} order by check_id desc limit 1"); $row = $query->row(); if (!empty($row)) { $row2 = $CI->general_model->get_row_select('met_date,met_time', 'meet', "check_id = {$row->check_id}", ""); return "<span title='เวลา " . $row2['met_time'] . "'>" . _set_date($row2['met_date']) . "</span>"; } else { return " - "; } }
public function export_checkpat($check_id, $type = false) { if ($check_id == false) { $ref = $this->input->server('HTTP_REFERER', TRUE); redirect($ref, 'location'); } $check = $this->general_model->get_row('check_pat', "check_id = {$check_id} "); ## $pat_id = $check['pat_id']; $pat = $this->general_model->get_row('patients', "pat_id = {$pat_id}"); $order_tools = $this->general_model->get_all('order_tools', "check_id = {$check_id}"); $file_name = 'ใบเบิกอุปกรณ์ เลขที่ ' . $check_id . ' ' . $pat['pat_name'] . ' ' . $pat['pat_lname']; 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> body { background-color: white; } span { line-height: 3; } .no{ margin-top: 10px; margin-bottom: 8px; text-align: justify; font-size: 15px; } .sub_no { margin-top: 8px; text-align: justify; font-size: 15px; } </style> <div id="printTool" class="row-fluid"> <style> .table-bordered,.table-bordered td ,.table-bordered th { border: 1px solid black; line-height: 20px; border-collapse: collapse; padding:5px; font-size: 12px; } </style> <div class="span12" style="text-align: center;"> <h2>ใบเบิกวัสดุ อุปกรณ์ภายใน <small>เลขที่ <?php echo $check_id; ?> </small></h2> </div> <div class="" style="text-align: left;width: 50%;float: left;"> <strong>ชื่อ </strong> <?php echo $pat['pat_name'] . ' ' . $pat['pat_lname']; ?> <strong>HN. </strong> <?php echo $pat['hn']; ?> </div> <div class="" style="text-align: right;width: 50%;float: left;"> <strong>วันที่ </strong> <?php echo _set_date_full($check['check_date']); ?> </div> <hr> <table class="table table-bordered" style="width: 100%;"> <tr> <td style="text-align: center;width: 20px;" >ลำดับ</td> <td style="text-align: center;">รายการ</td> <td style="text-align: center;width: 50px;">ประเภท</td> <td style="text-align: center;width: 50px;">ขนาด/เบอร์</td> <td style="text-align: center;width: 50px;">จำนวน</td> <td style="text-align: center;width: 50px;">หน่วย</td> <td style="text-align: center;width: 120px;">หมายเหตุ</td> </tr> <?php if (isset($order_tools)) { $i = 0; foreach ($order_tools as $key => $value) { ?> <tr> <td style="text-align: center;"><?php echo ++$i; ?> </td> <td><?php echo $this->get_value->get_tools_id($value['tool_id']); ?> </td> <td style="text-align: center;"><?php echo $value['order_type']; ?> </td> <td style="text-align: center;"><?php echo $value['set_type'] . ' ' . $value['set_type_val']; ?> </td> <td style="text-align: center;"><?php echo $value['count']; ?> </td> <td style="text-align: center;"><?php echo $value['unit']; ?> </td> <td><?php echo $value['order_cause']; ?> </td> </tr> <?php } } else { ?> <tr><td colspan="7"> -- ไม่มีข้อมูลเบิกพัสดุ --</td></tr> <?php } ?> </table> <hr> <table width="100%"> <tr> <td style="text-align: center;">ผู้เบิก</td> <td style="text-align: center;">หัวหน้างานผู้เบิก</td> <td style="text-align: center;">ผู้จ่าย</td> <td style="text-align: center;">บัญชีพัสดุ</td> </tr> <tr> <td style="text-align: center;"> ................................. </td> <td style="text-align: center;"> ................................. </td> <td style="text-align: center;"> ................................. </td> <td style="text-align: center;"> ................................. </td> </tr> <tr> <td style="text-align: center;"><p style="text-align: center;">(<?php echo $this->get_value->get_doctor_name($this->user_id); ?> )</p></td> <td style="text-align: center;"> <p style="text-align: center;">(<span style="color:#FFF;"><?php echo $this->get_value->get_doctor_name($this->user_id); ?> </span>)</p> </td> <td style="text-align: center;"> <p style="text-align: center;">(<span style="color:#FFF;"><?php echo $this->get_value->get_doctor_name($this->user_id); ?> </span>)</p> </td> <td style="text-align: center;"> <p style="text-align: center;">(<span style="color:#FFF;"><?php echo $this->get_value->get_doctor_name($this->user_id); ?> </span>)</p> </td> </tr> </table> <?php // die(); $html = ob_get_contents(); ob_end_clean(); // header('Content-type: application/pdf'); $this->mpdf = new mPDF('th', 'A5-L', '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'); // จากนั้นส่งชื่อไฟล์ออกมาครับผม // die(); // $view = 'core_' . $this->usertype . '_view'; // parent::$view('pat/history', $data); }