/**
  * Create the XAV request
  *
  * @return string
  */
 private function createRequest()
 {
     $xml = new DOMDocument();
     $xml->formatOutput = true;
     $avRequest = $xml->appendChild($xml->createElement("AddressValidationRequest"));
     $avRequest->setAttribute('xml:lang', 'en-US');
     $request = $avRequest->appendChild($xml->createElement("Request"));
     $node = $xml->importNode($this->createTransactionNode(), true);
     $request->appendChild($node);
     $request->appendChild($xml->createElement("RequestAction", "XAV"));
     if (null !== $this->requestOption) {
         $request->appendChild($xml->createElement("RequestOption", $this->requestOption));
     }
     if (null !== $this->maxSuggestion) {
         $avRequest->appendChild($xml->createElement("MaximumListSize", $this->maxSuggestion));
     }
     if (null !== $this->address) {
         $addressNode = $avRequest->appendChild($xml->createElement("AddressKeyFormat"));
         if ($this->address->getAttentionName()) {
             $addressNode->appendChild($xml->createElement("ConsigneeName", $this->address->getAttentionName()));
         }
         if ($this->address->getBuildingName()) {
             $addressNode->appendChild($xml->createElement("BuildingName", $this->address->getBuildingName()));
         }
         if ($this->address->getAddressLine1()) {
             $addressNode->appendChild($xml->createElement("AddressLine", $this->address->getAddressLine1()));
         }
         if ($this->address->getAddressLine2()) {
             $addressNode->appendChild($xml->createElement("AddressLine", $this->address->getAddressLine2()));
         }
         if ($this->address->getAddressLine3()) {
             $addressNode->appendChild($xml->createElement("AddressLine", $this->address->getAddressLine3()));
         }
         if ($this->address->getStateProvinceCode()) {
             $addressNode->appendChild($xml->createElement("PoliticalDivision2", $this->address->getStateProvinceCode()));
         }
         if ($this->address->getCity()) {
             $addressNode->appendChild($xml->createElement("PoliticalDivision1", $this->address->getCity()));
         }
         if ($this->address->getCountryCode()) {
             $addressNode->appendChild($xml->createElement("CountryCode", $this->address->getCountryCode()));
         }
         if ($this->address->getPostalCode()) {
             $addressNode->appendChild($xml->createElement("PostcodePrimaryLow", $this->address->getPostalCode()));
         }
     }
     return $xml->saveXML();
 }
Esempio n. 2
0
		<input type="text" class="form-control" name="complement" value="<?php 
echo $address->getComplement();
?>
"/>
	</div>
	<div class="form-group">
		<label for="zip">Zip</label>
		<input type="text" class="form-control" name="zip" value="<?php 
echo $address->getZip();
?>
"/>
	</div>
	<div class="form-group">
		<label for="city">City</label>
		<input type="text" class="form-control" name="city" value="<?php 
echo $address->getCity();
?>
"/>
	</div>
	<div class="form-group">
		<label for="state">State</label>
		<input type="text" class="form-control" name="state" value="<?php 
echo $address->getState();
?>
"/>
	</div>
	<div class="form-group">
		<label for="country">Country</label>
		<input type="text" class="form-control" name="country" value="<?php 
echo $address->getCountry();
?>
//////////////////////////////////////////////////////////////////////////
//Quatrième bloc : Texte d'intro
$pdf->SetFont('Arial', '', 8);
$pdf->setY($pdf->GetY() + 2);
$pdf->MultiCell($pdf->w - 25, 3, utf8_decode($text_intro));
//////////////////////////////////////////////////////////////////////////
//Cinquième bloc : Détails de la commande
$pdf->setY($pdf->GetY() + 2);
$pdf->SecondTable($order);
checkIfDropPage($pdf, $order, $table_first, 20);
//Bloc DO :
$pdf->setY($pdf->GetY() + 2);
$pdf->SetTextColor(0);
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(180, 6, utf8_decode('Delivery Address : '), 0, 1, 'L', false);
$pdf->SetFont('Arial', '', 8);
$delivery_address = new address($order->getId_delivery_address());
$pdf->Cell(0, 5, utf8_decode($delivery_address->getLine() . ' ' . $delivery_address->getComplement()), 0, 1, 'L', false);
$pdf->Cell(0, 5, utf8_decode($delivery_address->getZip() . ' ' . $delivery_address->getCity() . ' ' . $delivery_address->getCountry()), 0, 1, 'L', false);
checkIfDropPage($pdf, $order, $table_first, 20);
/////////////////////////////////////////////////////////////////////////
//Sixième bloc : Texte de fin
$pdf->setY($pdf->GetY() + 5);
$pdf->SetFont('Arial', '', 8);
$pdf->SetTextColor(0);
$pdf->MultiCell($pdf->w - 25, 3, utf8_decode($text_fin));
//Pas besoin de celui-ci
$pdf->MultiCell($pdf->w - 25, 3, utf8_decode($order->getLine_bellow()));
//////////////////////////////////////////////////////////////////////////
//On sort le PDF avec le nom qui va bien
$pdf->Output($id_document . '_' . str_replace(' ', '', $company->getName()) . '.pdf', 'I');
$pdf = new PDF();
$pdf->AliasNbPages();
//////////////////////////////////////////////////////////////////////////
// Pause : Tableau d'information à afficher / calcul n°id
$id_document = generateIdDoc($typedocument, $company, $order);
$table_first = array(array(utf8_decode('n° :'), $id_document, date('d.m.Y', $order->getDate_entry())), array('UST-ID :', $company->getUst_id(), utf8_decode($employee->getSurname() . ' ' . $employee->getName())), array('Your ID :', $company->getId(), '0' . '/{nb}'));
setNewPage($pdf, $order, $table_first);
///////////////////////////////////////////////////////////////////////////
// Premier Bloc : Info biothys
// Nom du client + adresse
$pdf->SetFont('Arial', 'U', 6);
$pdf->Cell(0, 5, utf8_decode('Biothys GmbH | Gewerbestr. 6 | D-77731 Willstätt'), 0, 1, 'L', false);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(0, 5, utf8_decode($company->getName()), 0, 1, 'L', false);
$pdf->Cell(0, 5, utf8_decode($receiving_address->getLine() . ' ' . $receiving_address->getComplement()), 0, 1, 'L', false);
$pdf->Cell(0, 5, utf8_decode($receiving_address->getZip() . ' ' . $receiving_address->getCity() . ' ' . $receiving_address->getCountry()), 0, 1, 'L', false);
///////////////////////////////////////////////////////////////////////////
//Deuxième Bloc : type de document
$pdf->SetFont('Arial', 'B', 20);
$pdf->Cell(180, 15, utf8_decode('Offer'), 0, 1, 'R', false);
//////////////////////////////////////////////////////////////////////////
//Troisième bloc : Afficher le tableau d'info générale sur la commande
$pdf->Cell(0, 10, '', 0, 1);
//Création du cadre
$pdf->SetFont('Arial', 'B', 11);
$pdf->Cell(185, 21, '', 1);
$pdf->setX($pdf->GetX() - 185);
$pdf->setY($pdf->GetY() + 2);
//écriture du texte
$pdf->FirstTable($table_first);
//////////////////////////////////////////////////////////////////////////