$quo = $this->m_site_survey->site_survey_item($id_project); echo $this->db->last_query(); foreach ($quo as $q) { $quotation_ = $this->m_site_survey->get_info_survey($q->f_id_quotation); foreach ($quotation_ as $quo) { $i++; $idquo = $quo->f_id_quotation; $project = $quo->project_name; $quotationum = $quo->quotation_number; $id_site_survey_ = $quo->id_site_survey; $html ='<h2 align="center">Site Survey Information</h2>'; $html .='<h4 style="font: 14px arial, sans-serif;">Project : '.$project.' </h4>'; $html .='<h4 style="font: 14px arial, sans-serif;">Quotation Number : '.$quotationum.' </h4>'; } } $html .='<table style="width:90%;border: 1px solid black;border-collapse: collapse;" align="center">'; $html .='<thead>'; $html .='<tr>'; $html .='<th style="width: 5%; border: 1px solid black;border-collapse: collapse;" ><p>ลำดับ</p><p> No.</p></th>'; $html .='<th style="width: 15%; border: 1px solid black;border-collapse: collapse;" ><p>รหัส</p><p> Code</p></th>'; $html .='<th style="width: 30%; border: 1px solid black;border-collapse: collapse;"><p>รายละเอียดสินค้า</p><p>Description</p></th>'; $html .='<th style="width: 30%; border: 1px solid black;border-collapse: collapse;"><p>ความกว้าง</p><p> Width(mm.)</p></th>'; $html .='<th style="width: 30%; border: 1px solid black;border-collapse: collapse;"><p>ความสูง</p><p> Height(mm.)</p></th>'; $html .='<th style="width: 10%; border: 1px solid black;border-collapse: collapse;"><p>จำนวน</p><p> Quantity</p></th>'; $html .='</tr>'; $html .=' </thead>'; $i = 0; foreach ($quotation_ as $q) { $i++; $html .='<tbody>'; $html .='<tr>'; $html .='<td align="center" style="width: 5%; border: 1px solid black;border-collapse: collapse;"> '.$i.'</td>'; $html .='<td align="center" style="width: 15%; border: 1px solid black;border-collapse: collapse;"> '.$q->item_name_ss.'</td>'; $w = explode("/", $q->approx_width_mm); $count_w = count($w); $html .='<td align="center" style="width: 30%; border: 1px solid black;border-collapse: collapse;"> '.$q->item_description.'</td>'; $html .='<td align="center" style="width: 30%; border: 1px solid black;border-collapse: collapse;"> '.$w[($count_w-1)].'</td>'; $h = explode("/", $q->approx_height_mm); $count_h = count($h); $html .='<td align="center" style="width: 30%; border: 1px solid black;border-collapse: collapse;"> '.$h[($count_h-1)].'</td>'; $html .='<td align="center" style="width: 10%; border: 1px solid black;border-collapse: collapse;"> '.$q->item_quantity.'</td>'; $html .='</tr>'; } $html .='</tbody>'; $html .='</table>'; foreach ($quotation_ as $quo) { $filename = 'site_infomation_survey_'.$quo->f_id_quotation.'_'.$id_project.'.pdf'; } $files = glob('uploads/site_infomation/*'); // get all file names (ARRAY) $count = count($files); for($i=0;$i<$count;$i++) { if($files[$i] == 'uploads/site_infomation/'.$filename) { unlink($files[$i]);// delete file } } $this->mpdf = new mPDF('th','A4');// $this->mpdf->debug = true; $this->mpdf->WriteHTML($html); $this->mpdf->Output('uploads/site_infomation/'.$filename); $data = array( 'file_site_information' => $filename ); foreach ($quotation_ as $quoo) { $this->m_site_survey->update_site_survey_item($data,$quoo->id_site_survey); echo $this->db->last_query(); }
SELECT // ข้อมูลที่ต้องการ FROM // จาก Table? WHERE // เงื่อนไข GROUP BY // รวมกลุ่มให้ข้อมูล ORDER BY // เรียงลำดับข้อมูล
$data; // ข้อมูลที่ได้จาก database $tmp_quo = ''; $html = ''; foreach($data as $key => $value){ if($tmp_quo != $value[/*f_id_quo*/] && $key != 0){ $this->mpdf = new mPDF('th','A4'); $this->mpdf->debug = true; $this->mpdf->WriteHTML($html); $this->mpdf->Output('uploads/site_infomation/'.$filename); // ตรง Output ถ้าถูกเรียก Header น่าจะทำให้ code หยุดทำงาน $html = ''; } $html; // กำหนดข้อมูล html if($key+1 == sizeof($data)){ $this->mpdf = new mPDF('th','A4'); $this->mpdf->debug = true; $this->mpdf->WriteHTML($html); $this->mpdf->Output('uploads/site_infomation/'.$filename); // ตรง Output ถ้าถูกเรียก Header น่าจะทำให้ code หยุดทำงาน } }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง