<?php
include("../../check.php");
include('smtp/PHPMailerAutoload.php');
require __DIR__ . '/vendor/vendor/autoload.php';



$id = $_GET['id'];

$getall = $getData->runQuery("SELECT * FROM `customer` WHERE id='$id'");
foreach($getall as $rows){
$dataaa = $rows['standard'];
$result = explode(',',$dataaa);
$counts = count($result);
$name = $rows['name'];
$address = $rows['address'];
$address2 = $rows['address2'];
$scope_of_business = $rows['scope_of_business'];
$create = date('Y-m-d', strtotime($rows['date']));
}



use setasign\Fpdi\Fpdi;

$pdf = new Fpdi();
$pdf->AddPage(); // adds page in landscape
$pdf->setSourceFile("bqc1.pdf");
// import page 1
$tplId = $pdf->importPage(1);
// use the imported page and place it at point 5,5 with your preferred width in mm
$pdf->useTemplate($tplId, 0, 0, 211);
$pdf->SetFont('Arial','I',20); // Font Name, Font Style (eg. 'B' for Bold), Font Size
$pdf->SetTextColor(0,0,0); // RGB


$pdf->SetXY(30, 80); // X start, Y start in mm
$pdf->Cell(150, 10, $name, 0, 0, 'C');

$pdf->SetFont('Arial','',16); // Font Name, Font Style (eg. 'B' for Bold), Font Size

$pdf->SetXY(46, 94); // X start, Y start in mm
$pdf->MultiCell(120,7,$address.' '.$address2,0,'C', false);

$pdf->SetFont('Arial','',28);
$pdf->SetXY(68, 126); // X start, Y start in mm

$pdf->Cell(80, 10, $_GET['st'], 0, 0, 'L');


$pdf->SetFont('Arial','B',20);
$pdf->SetXY(47, 156); // X start, Y start in mm

$pdf->MultiCell(120,7,$scope_of_business,0,'C', false);


/**/
$pdf->SetFont('Arial','B',12);
$pdf->SetXY(60, 216); 
$pdf->Cell(70, 10, "Draft", 0, 0, 'L');
/**/
// adds current date
$pdf->SetFont('Arial','B',12); 
$pdf->SetTextColor(0,0,0); 
$pdf->SetXY(70, 189); 

$create = date('Y-m-d');

$showdate = date('d/m/Y', strtotime($create));
$date = date('Y-m-d', strtotime($create));
$pdf->Write(0, $showdate);

$end = date('Y-m-d', strtotime('+3 years', strtotime($date)));
$end = date('Y-m-d', strtotime($end));
$end2= strtotime($end);
$finalend = date('d/m/Y', strtotime('-1 days', $end2));

$pdf->SetXY(70, 209); 
$pdf->Write(0, $finalend);

$first = date('Y-m-d', strtotime('+1 year', strtotime($date)));
$first = date('d/m/Y', strtotime('-1 days', strtotime($first)));

$pdf->SetXY(70, 196); 
$pdf->Write(0, $first);

$second = date('Y-m-d', strtotime('+2 year', strtotime($date)));
$second = date('d/m/Y', strtotime('-1 days', strtotime($second)));

$pdf->SetXY(70, 202); 
$pdf->Write(0, $second);


$pdf->Output();

?>