From a0b473a0b964e2c806688c4a4ec19a4d1b1e63c4 Mon Sep 17 00:00:00 2001 From: juppe Date: Fri, 3 Apr 2009 06:06:36 +0000 Subject: [PATCH] Parseroidaan tullin ELEX XML --- nouda_elexvastaus.php | 124 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 nouda_elexvastaus.php diff --git a/nouda_elexvastaus.php b/nouda_elexvastaus.php new file mode 100644 index 0000000000..307b9ddc4a --- /dev/null +++ b/nouda_elexvastaus.php @@ -0,0 +1,124 @@ +".t("Nouda ELEX vastaussanoma").":

"; + + $responseFunction = array( "TDE" => "Hylkäys", + "TEP" => "Menettelyyn luovutuksen epääminen", + "TER" => "Virhe", + "THY" => "Hyväksyminen", + "TLP" => "Lisäselvityspyyntö ", + "TLU" => "Vientimenettelyyn luovutus", + "TMI" => "Mitätöinti", + "TOI" => "Oikaisupäätös", + "TPV" => "Poistumisvahvistus ", + "TTI" => "Tullin ilmoitus", + "TVA" => "Vastaanotto"); + + $xmlstring = " + + 003702454428-TESTI + 003712345678 + 2008-02-27T05:15:00.000+02:00 + 208058000473 + 1204082112625 + 1.0 + + + TDE + + + + Z + FI002000 + + + FI002000 Sähköinen tullauskeskus + Tulli + + ELEX + + + 020 090 00 + 020 391 115 + + + + + + + 29900108165000301 + 2008-02-27T05:15:13.688+02:00 + + + 90051913 + M233-5294NK + + + + + + 10 + 1 + + Asiakirjan koodi (N952) ei löydy tietokannasta + 12 + + + + "; + + + $xml = simplexml_load_string($xmlstring); + + echo $xml->Message->sender."
"; + echo $xml->Message->recipient."
"; + echo $xml->Message->issue."
"; + echo $xml->Message->reference."
"; + echo $xml->Message->controlReference."
"; + echo $xml->Message->version."
"; + + echo $xml->Response->function."
"; + + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Location->qualifier."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Location->identification."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->identity."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->identityExtension."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->codeListResponsibleAgency."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->name1."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->name2."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->Adress->line."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->Adress->city."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->Adress->postCode."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->Adress->country."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->Contact->name."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->Communication->telephone."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->Communication->telefax."
"; + echo $xml->Response->ContactCustomsOffice->CustomsOffice->Party->Communication->email."
"; + + echo $xml->Response->Status->effective."
"; + echo $xml->Response->Status->Pointer->documentSection."
"; + echo $xml->Response->Status->Pointer->sequence."
"; + + echo $xml->Response->Control->limit."
"; + + echo $xml->Response->Declaration->acceptance."
"; + echo $xml->Response->Declaration->customsReference."
"; + echo $xml->Response->Declaration->MRN."
"; + echo $xml->Response->Declaration->rejection."
"; + echo $xml->Response->Declaration->GoodsShipment->UCR->traderReference."
"; + echo $xml->Response->Declaration->GoodsShipment->UCR->additionalTraderReference."
"; + + foreach ($xml->Response->Error as $error) { + echo $error->Pointer->documentSection."
"; + echo $error->Pointer->sequence."
"; + echo $error->additionalDescription."
"; + echo $error->validation."
"; + } + + echo $xml->Response->AdditionalInformation->statement."
"; + echo $xml->Response->AdditionalInformation->statementDescription."
"; + + require ('inc/footer.inc'); +?> \ No newline at end of file