require 'fpdf/html2pdf.php'; //getting the items info $sql = "SELECT * from sale natural join product natural join cart"; $res = $conn->query($sql); $current_date = date('Y/m/d'); //getting the customer info $sql_customer = "SELECT * from sale natural join cart"; $res_customer = $conn->query($sql_customer); $row_customer = $res_customer->fetch_assoc(); $customer_name = $row_customer['customer_name']; $customer_phone = $row_customer['customer_phone']; //generating pdf file //$pdf = new FPDF(); $pdf = new PDF_HTML(); $pdf->AddPage(); $pdf->SetFillColor(0, 102, 0); ////// logo $size = "60"; $absx = (210 - $size) / 2; $pdf->Image('../image/hello_cash.jpg', $absx, 5, $size); /// $pdf->SetFont('Arial', 'B', 10); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(0, 10, '', 0, 1); $pdf->Cell(0, 10, '', 0, 1); // empty space $pdf->Cell(0, 5, '', 0, 1); $pdf->Cell(0, 10, 'Shop No. 441, Orchard Point, Mirpur Road, Dhanmondi-7, Dhaka.', 0, 1, "C"); $pdf->Cell(0, 0, 'Cell: +8801977677776, +8801717050090', 0, 1, "C"); $pdf->Image('../image/fblogo.png', $pdf->GetX() + 60, $pdf->GetY() + 2, 5); $pdf->Cell(0, 10, 'www.facebook.com/Helloelectronix', 0, 1, "C");
//Remove do array cada participante sem nome } $i++; } $participanteAr = array_values($participanteAr); //Reorganiza a array $textoPrincipal = $_POST['texto']; str_replace(array("{evento}", "{departamento}"), array($_POST['evento'], $_POST['departamento']), $textoPrincipal); $pdf = new PDF_HTML('L', 'mm'); foreach ($participanteAr as $participante) { $pdf->AddPage(); $pdf->SetLeftMargin(110); $pdf->SetRightMargin(20); $pdf->SetFont('Arial', '', 14); $pdf->SetXY(0, 0); $pdf->SetFillColor(200, 220, 255); $pdf->Rect(0, 0, 90, 210, 'F'); //Borda esquerda com simbolos da PROCEV - REMOVER DEPOIS $pdf->SetFillColor(195, 195, 195); $pdf->Rect(90, 0, 207, 50, 'F'); //Texto superior - REMOVER DEPOIS $pdf->SetFillColor(195, 195, 195); $pdf->Rect(90, 160, 207, 50, 'F'); //Texto inferior - REMOVER DEPOIS $pdf->SetXY(110, 70); //Posicao inicial do texto do certificado -- posicao x = 110mm / posicao y = 70mm //$txt = file_get_contents('fpdf/license.txt'); /*$texto = "EVENTO: ".$_POST['evento']."\nDepartamento :".$_POST['departamento']."\nPeriodo :".$_POST['periodo']. "\nParticipante :".$value;*/ $texto = utf8_decode(" " . "Certifi<B>ca</B>mos que " . $participante . " participou do evento " . $_POST['evento'] . " realizado pelo " . $_POST['departamento'] . " no periodo " . $_POST['periodo'] . " com carga horaria de " . $_POST['carga'] . " horas."); $pdf->MultiCell(167, 9, $texto, 0, 'J', false);