/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
backoffice
/
ajax
/
member_renew
/
up file
home
<?php require('../../../fpdf/alphapdf.php'); include('../../../config/main_function.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); $pdf = new FPDF(); $pdf->AliasNbPages(); $pdf->SetAutoPageBreak(false); $pdf->AddFont('THSarabunNew', '', 'THSarabunNew.php'); $pdf->AddFont('THSarabunNew Bold', '', 'THSarabunNew Bold.php'); $pdf->AddFont('THSarabunNew BoldItalic', '', 'THSarabunNew BoldItalic.php'); $pdf->AddPage(); $sql_system = "SELECT * FROM tbl_system_setting WHERE setting_id = '1';"; $rs_system = mysqli_query($connection, $sql_system); $row_system = mysqli_fetch_array($rs_system); $key = $row_system['secure_text']; $pointer = $row_system['secure_pointer']; $member_id = mysqli_real_escape_string($connection, $_POST['member_id']); $temp_member_id = explode(".", $member_id); $member_id = bigsara_decode($temp_member_id[0], $temp_member_id[1]); $member_type = mysqli_real_escape_string($connection, $_POST['member_type']); $member_level = mysqli_real_escape_string($connection, $_POST['member_level']); if ($member_type == '1') { $table = "tbl_member_detail_employer"; } else if ($member_type == '2') { $table = "tbl_member_detail_company"; } else if ($member_type == '3') { $table = "tbl_member_detail_agency"; } else if ($member_type == '4') { $table = "tbl_member_detail_worker"; } $sql = "SELECT * FROM $table WHERE member_id = '$member_id'"; $res = mysqli_query($connection, $sql); $row = mysqli_fetch_assoc($res); $cardAddress = ""; if ($row['card_district_id'] != "") { $card_district_id = $row['card_district_id']; $sqlAddressCard = "SELECT `tbl_district`.`district_name_th` , `tbl_amphoe`.`amphoe_name_th` , `tbl_province`.`province_name_th` , `tbl_district`.`district_zipcode` FROM `tbl_district` JOIN `tbl_amphoe` ON `tbl_amphoe`.`amphoe_id` = `tbl_district`.`ref_amphoe` JOIN `tbl_province` ON `tbl_province`.`province_id` = `tbl_amphoe`.`ref_province` WHERE `tbl_district`.`district_id` = '$card_district_id'"; $rsAddressCard = mysqli_query($connection, $sqlAddressCard); $rowAddressCard = mysqli_fetch_array($rsAddressCard); // $cardAddress = $row['card_address'] . " " . $rowAddressCard['district_name_th'] . " " . $rowAddressCard['amphoe_name_th'] . " " . $rowAddressCard['province_name_th'] . " " . $rowAddressCard['district_zipcode']; $cardAddress = $row['card_address']; } $companyAddress = ""; if ($row['company_district_id'] != "") { $company_district_id = $row['company_district_id']; $sqlAddressCompany = "SELECT `tbl_district`.`district_name_th` , `tbl_amphoe`.`amphoe_name_th` , `tbl_province`.`province_name_th` , `tbl_district`.`district_zipcode` FROM `tbl_district` JOIN `tbl_amphoe` ON `tbl_amphoe`.`amphoe_id` = `tbl_district`.`ref_amphoe` JOIN `tbl_province` ON `tbl_province`.`province_id` = `tbl_amphoe`.`ref_province` WHERE `tbl_district`.`district_id` = '$company_district_id'"; $rsAddressCompany = mysqli_query($connection, $sqlAddressCompany); $rowAddressCompany = mysqli_fetch_array($rsAddressCompany); // $companyAddress = $row['card_address']. " " . $rowAddressCompany['district_name_th'] . " " . $rowAddressCompany['amphoe_name_th'] . " " . $rowAddressCompany['province_name_th'] . " " . $rowAddressCompany['district_zipcode']; $companyAddress = $row['card_address']; } if ($member_type == 1) { $register_type = 'นายจ้าง'; } elseif ($member_type == 2) { $register_type = 'บนจ.'; } elseif ($member_type == 3) { $register_type = 'Agency'; } elseif ($member_type == 4) { $register_type = 'แรงงาน'; } if ($member_level == 'g9k1s') { $register_level = 'ทั่วไป'; } elseif ($member_level == 'kki22') { $register_level = 'วิสามัญ'; } elseif ($member_level == 'x9fkq') { $register_level = 'สามัญ.'; } $temp_title = explode(" ", getTitle_name($row['title_name'])); $title_th = $temp_title[0]; $title_en = $temp_title[2]; $sqlPayment = "SELECT * FROM `tbl_member_payment` WHERE `member_id` = '$member_id'"; $rsPayment = mysqli_query($connection, $sqlPayment); $rowPayment = mysqli_fetch_array($rsPayment); $payment = ($rowPayment['approve_datetime'] != "") ? "ชำระสำเร็จ เมื่อ " . date("d/m/Y", strtotime($rowPayment['approve_datetime'] + 543)) : "รอตรวจสอบ"; $pdf->SetFont('THSarabunNew Bold', '', 14); $pdf->Image('Logo.png', 14.8, 11, 21, 21, 'PNG'); //LOGO $pdf->SetXY(38, 13); $pdf->MultiCell(0, 5, iconv('UTF-8', 'cp874', 'สมาคมผู้ประกอบการนำคนต่างด้าวมาทำงานในประเทศ(ประเทศไทย)'), 0, 'L', 0); $pdf->SetXY(38, 19); $pdf->MultiCell(0, 5, iconv('UTF-8', 'cp874', '59/28 หมู่ที่ 8 ตำบลท่าทราย อำเภอเมืองสมุทรสาคร จังหวัดสมุทรสาคร 74000'), 0, 'L', 0); $pdf->SetXY(38, 25); $pdf->MultiCell(0, 5, iconv('UTF-8', 'cp874', 'หมายเลขผู้ภาษี: 0745561004453'), 0, 'L', 0); $pdf->SetFont('THSarabunNew Bold', '', 18.5); $pdf->SetXY(90, 38); //ใบสมัครสมาชิก $pdf->MultiCell(200, 5, iconv('UTF-8', 'cp874', 'ใบเสร็จรับเงิน'), 0, 'L', 0); ////ข้อมูลในตาราง/////(หัวตาราง) $pdf->SetFont('THSarabunNew Bold', '', 14); $pdf->SetXY(13, 50); $pdf->MultiCell(0, 5, iconv('UTF-8', 'cp874', 'ลูกค้า : '), 0, 'L', 0); $pdf->SetXY(13, 56); $pdf->MultiCell(0, 5, iconv('UTF-8', 'cp874', 'ที่อยู่ :'), 0, 'L', 0); $pdf->SetXY(13, 62); $pdf->MultiCell(0, 5, iconv('UTF-8', 'cp874', 'หมายเลขผู้ภาษี :'), 0, 'L', 0); $pdf->SetXY(140, 50); $pdf->MultiCell(0, 5, iconv('UTF-8', 'cp874', 'เลขที่ใบเสร็จ :'), 0, 'L', 0); $pdf->SetXY(151, 56); $pdf->MultiCell(0, 5, iconv('UTF-8', 'cp874', 'วันที่ :'), 0, 'L', 0); $pdf->SetXY(170, 64); // Create headers $pdf->Ln(); // Move to the next line $pdf->Cell(70, 8, iconv('UTF-8', 'cp874', 'รายการ'), 1, 0, 'L'); $pdf->Cell(40, 8, iconv('UTF-8', 'cp874', 'จำนวน'), 1, 0, 'C'); $pdf->Cell(40, 8, iconv('UTF-8', 'cp874', 'หน่วยละ'), 1, 0, 'C'); $pdf->Cell(40, 8, iconv('UTF-8', 'cp874', 'จำนวนเงิน'), 1, 0, 'C'); $pdf->Ln(); // Move to the next line $pdf->Cell(70, 70, iconv('UTF-8', 'cp874', ''), 1, 0, 'L'); $pdf->Cell(40, 70, iconv('UTF-8', 'cp874', ''), 1, 0, 'C'); $pdf->Cell(40, 70, iconv('UTF-8', 'cp874', ''), 1, 0, 'C'); $pdf->Cell(40, 70, iconv('UTF-8', 'cp874', ''), 1, 0, 'C'); $pdf->Ln(); // Move to the next line $pdf->Cell(150, 8, iconv('UTF-8', 'cp874', convertToMoney(30000)), 1, 0, 'C'); $pdf->Cell(40, 8, iconv('UTF-8', 'cp874', '30,000'), 1, 0, 'R'); $pdf->SetXY(13, 80); $pdf->MultiCell(0, 5, iconv('UTF-8', 'cp874', 'ค่าสมัครสมาชิกระดับ ทั่วไป'), 0, 'L', 0); $pdf->SetXY(100, 80); $pdf->MultiCell(0, 5, iconv('UTF-8', 'cp874', '1'), 0, 'L', 0); $pdf->SetXY(145, 80); $pdf->MultiCell(0, 5, iconv('UTF-8', 'cp874', '30,000'), 0, 'L', 0); $pdf->SetXY(185,80); $pdf->MultiCell(0, 5, iconv('UTF-8', 'cp874', '30,000'), 0, 'L', 0); $pdf->Output();