<?php

/*
[Assecutor Data Service GmbH <=> UPS]

The XML structure of our order request has grown many years.
Anytime we attached great importance to maintain the compatibility 
of the structure from the beginning until today.
In this way the request could be enhanced successively if needed,
e.g. measures, article data, special vehicles or driver and so on.

Reading our short description of the order request structure could 
be overwhelming and so, a small but comprehensive example is the best
way to get in.

For most purposes this example may be sufficient .

We have a fix <auth>-Header for each location (Hannover, Bremen, Berlin, Hamburg, etc.)

The commission number <no> will be your order number. [mandatory]

The timestamp the order (tour) has to be executed/started can be sent as "normal"
timestamp or better as UTC. [mandatory]

Informations concerning the tour like accounting, processing et al. can be placed in <remark>.
Similar to this in <courier_remark> informations can be inserted for the driver. [optional]

The unspecific tag structure <gdc> <val>....</val> <val>....</val> .... </gdc>
serves as container for special tour values (IDs, Codes, etc.). These values
will be used e.g. for sending them back in event responses. [optional]

The tag <stations> aggregates all customer data with addresses, persons, companies.
If the customer is a private person, please fill up the tag <company> with the name!

Inside each <station> tag there is a <gdc> tag structure, similar to the <gdc> tag described
above. These values will be stored for each station (customer) like a customer ID, hash, etc.

If you want, please execute this script in an existing PHP environment to POST the request.
You will get back a short XML response with our order number like
<xml><state>OK</state><carrier><orderno>nnnnnnnn</orderno></carrier></xml>

Thank you very much!  :-)

Best regards,
your Assecutor Team
*/

$req = "
<xml> 
  <order> 
    <auth> 
      <customer>STF909266</customer>
			<account>STF909266</account>
			<password>F80120</password>
			<session_id>
				f288f46c5d79de67251ea00e6c7970f6e4da3b7fbbce2345d7772b0674a318d5b3758ba1faf81fdf9253465f6642dfee38853822faf9db66ed087d9e847f267a
			</session_id> 
    </auth> 
    <no>COMMNO1234</no> 
    <ordertime></ordertime> 
    <ordertimeUTC>2020-07-23 12:00:00.000 0000 UTC</ordertimeUTC> 
    <remark><![CDATA[TESTAUFTRAG!!!!!!!!!!! 1 Packst�ck(e); 1 Strauss; COMMNO1234, ....]]></remark> 
    <courier_remark><![CDATA[TESTAUFTRAG!!!!!!!!!!! 1 Packst�ck(e); 1 Strauss]]></courier_remark> 
    <gdc> 
      <val><![CDATA[TOUR_INFO_1_OPTIONAL_RETURN_VALUE_FOR_RESPONSE]]></val>
      <val><![CDATA[TOUR_INFO_2_OPTIONAL_RETURN_VALUE_FOR_RESPONSE]]></val>
      <val>....</val>
    </gdc> 
    <stations> 
      <station> 
        <company><![CDATA[UPS]]></company>
        <street><![CDATA[Rehkamp]]></street> 
        <houseno><![CDATA[15]]></houseno> 
        <zipcode><![CDATA[30853]]></zipcode> 
        <city><![CDATA[Langenhagen]]></city> 
        <special_remark><![CDATA[]]></special_remark>
        <person><![CDATA[Mr. Contact]]></person> 
        <phone><![CDATA[495117259318]]></phone> 
        <email><![CDATA[service@ups.de]]></email>
        <gdc> 
          <val><![CDATA[STATION_INFO_1_OPTIONAL_RETURN_VALUE_FOR_RESPONSE]]></val>
          <val><![CDATA[STATION_INFO_2_OPTIONAL_RETURN_VALUE_FOR_RESPONSE]]></val>
          <val><![CDATA[....]]></val>
        </gdc>
      </station>
      <station> 
        <company><![CDATA[Customer 01]]></company> 
        <street><![CDATA[Street 01]]></street> 
        <houseno><![CDATA[1]]></houseno> 
        <zipcode><![CDATA[11111]]></zipcode> 
        <city><![CDATA[City 01]]></city> 
        <special_remark><![CDATA[Bitte pers�nlich im Gesch�ft abgeben.]]></special_remark> 
        <person><![CDATA[Peter Parker]]></person> 
        <phone><![CDATA[495111234501]]></phone> 
        <email><![CDATA[customer_01@xxxx.de]]></email>
        <gdc> 
          <val><![CDATA[STATION_INFO_1_OPTIONAL_RETURN_VALUE_FOR_RESPONSE]]></val>
          <val><![CDATA[STATION_INFO_2_OPTIONAL_RETURN_VALUE_FOR_RESPONSE]]></val>
          <val><![CDATA[....]]></val>
        </gdc>
      </station>
      <station> 
        <company><![CDATA[Customer 02]]></company> 
        <street><![CDATA[Street 02]]></street> 
        <houseno><![CDATA[2]]></houseno> 
        <zipcode><![CDATA[22222]]></zipcode> 
        <city><![CDATA[City 02]]></city> 
        <special_remark><![CDATA[Bitte beim Nachbarn abgeben.]]></special_remark> 
        <person><![CDATA[Barry Allen]]></person>
        <phone><![CDATA[495111234501]]></phone> 
        <email><![CDATA[customer_02@yyyy.de]]></email>
        <gdc> 
          <val><![CDATA[STATION_INFO_1_OPTIONAL_RETURN_VALUE_FOR_RESPONSE]]></val>
          <val><![CDATA[STATION_INFO_2_OPTIONAL_RETURN_VALUE_FOR_RESPONSE]]></val>
          <val><![CDATA[....]]></val>
        </gdc>
      </station>
    </stations> 
  </order> 
</xml>";

$req = urlencode($req);
?>


<html>

<head>

</head>

<body>

  <form name="test" action="https://apache-3.assecutor.de/test_sb_intern/service/order_request.php" method="post">
  
    <input type="hidden" name="orderReq" value="<?php echo $req ?>">

    <input type="submit" value="Senden POST">
     
  </form>

</body>

</html>
