<?php
$row = array(31) {
'entity_id' =>
string(2) "14"
'entity_type_id' =>
string(1) "1"
'attribute_set_id' =>
string(1) "0"
'website_id' =>
string(1) "1"
'email' =>
string(29) "office@solarpower-augsburg.de"
'group_id' =>
string(1) "1"
'increment_id' =>
string(9) "000000011"
'store_id' =>
string(1) "0"
'created_at' =>
string(19) "2013-10-22 10:28:59"
'updated_at' =>
string(19) "2013-10-22 10:51:50"
'is_active' =>
string(1) "1"
'disable_auto_group_change' =>
string(1) "0"
'prefix' =>
string(4) "Herr"
'firstname' =>
string(9) "Gabriele "
'middlename' =>
NULL
'lastname' =>
string(5) "Ament"
'suffix' =>
string(26) "Solarpower Energy for Life"
'name' =>
string(46) "Herr Gabriele Ament Solarpower Energy for Life"
'is_partner' =>
string(1) "1"
'default_billing' =>
string(2) "16"
'billing_firstname' =>
string(9) "Gabriele "
'billing_lastname' =>
string(5) "Ament"
'billing_postcode' =>
string(5) "86199"
'billing_city' =>
string(8) "Augsburg"
'billing_telephone' =>
string(14) "0821·90732-50"
'billing_country_id' =>
string(2) "DE"
'billing_street' =>
string(20) "Zum Fuggerschloß 38"
'billing_region' =>
string(6) "Bayern"
'billing_company' =>
string(46) "Solarpower Energy for Life Gabriele Ament e.K."
'tom_geo_latitude' =>
string(10) "48.3237705"
'tom_geo_longitude' =>
string(10) "10.8221745"
}
$dom = new DOMDocument("1.0","UTF-8");
$node = $dom->createElement("Markers");
$parnode = $dom->appendChild($node);
$this->getResponse()->setHeader('Content-Type','text/xml','utf8');
foreach ($row as $key => $value) {
$address = $value['billing_street'] .','. $value['billing_country_id'] .'-'. $value['billing_postcode'] .' '. $value['billing_city'];
$distance = 6371 * acos( cos( deg2rad($qryVal[0]) ) * cos( deg2rad( $value['tom_geo_latitude'] ) ) * cos( deg2rad( $value['tom_geo_longitude'] ) - deg2rad($qryVal[1]) ) + sin( deg2rad($qryVal[0]) ) * sin(deg2rad( $value['tom_geo_latitude'] ) ) );
$contactPerson = $value['billing_firstname'] .' '. $value['billing_lastname'];
// ADD TO XML DOCUMENT NODE
$marker = $dom->createElement("Marker");
$newnode = $parnode->appendChild($marker);
$newnode->setAttribute("StoreId", $value['store_id']);
$newnode->setAttribute("Lat", $value['tom_geo_latitude']);
$newnode->setAttribute("Lng", $value['tom_geo_longitude']);
$newnode->setAttribute("Distance", $distance);
$newnode->setAttribute("ImgUrl", $key['ImgUrl']);
$newnode->setAttribute("CategoryIcon", '/skin/frontend/default/solarinvert/tom/dealer/default.png');
$newnode->setAttribute("Contactperson", $contactPerson);
$newnode->setAttribute("Phone", $value['billing_telephone']);
$newnode->setAttribute("Logo", $value['logo']);
/*
$newnode->setAttribute("Country", $value['billing_country_id']);
$newnode->setAttribute("Fax", $value['billing_fax']);
$newnode->setAttribute("Address", $address);
$newnode->setAttribute("Type", $value['Type']);
$newnode->setAttribute("Email", $value['email']);
$newnode->setAttribute("Website", $value['Website']);
$newnode->setAttribute("State", $value['billing_region']);
$newnode->setAttribute("City", $value['billing_city']);
$newnode->setAttribute("Name", $value['billing_company']);
*/
// $newnode->setAttribute("LabelId", $key['LabelId']);
// $newnode->setAttribute("LabelText", $key['LabelText']);
// $newnode->setAttribute("Google", $key['Google']);
// $newnode->setAttribute("Facebook", $key['Facebook']);
// $newnode->setAttribute("Twitter", $key['Twitter']);
// $newnode->setAttribute("Printrest", $key['Printrest']);
// $newnode->setAttribute("Gallery", $row['Gallery']);
// $newnode->setAttribute("Info", $row['Info']);
// $newnode->setAttribute("Working", $row['Working']);
// $newnode->setAttribute("Video", $row['Video']);
// $newnode->setAttribute("Direction", $row['Direction']);
}
echo $dom->saveXML();
}
- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.23
- Parse error: syntax error, unexpected '{' in /in/bg7mT on line 3
Process exited with code 255.
preferences:
173.05 ms | 1399 KiB | 60 Q