Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/iws8/html/imaterial/
Upload File :
Current File : /var/www/html/mmishra/iws8/html/imaterial/geocode_genxml_customers.php

<?php

/* $Id: geocode_genxml_customers.php 6941 2014-10-26 23:18:08Z daintree $*/
//$PageSecurity = 3;
$Title = _('Geocode Generate XML');

include ('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');

function parseToXML($htmlStr)
{
    $xmlStr=str_replace('<','&lt;',$htmlStr);
    $xmlStr=str_replace('>','&gt;',$xmlStr);
    $xmlStr=str_replace('"','&quot;',$xmlStr);
    $xmlStr=str_replace("'",'&#39;',$xmlStr);
    $xmlStr=str_replace("&",'&amp;',$xmlStr);
    return $xmlStr;
}

$sql = "SELECT * FROM custbranch WHERE 1";
$ErrMsg = _('An error occurred in retrieving the information');;
$result = DB_query($sql, $ErrMsg);

header("Content-type: text/xml");

// Iterate through the rows, printing XML nodes for each
echo '<markers>';

while ($myrow = DB_fetch_array($result)){
    // ADD TO XML DOCUMENT NODE
    echo '<marker ';
    echo 'name="' . parseToXML($myrow['brname']) . '" ';
    echo 'address="' . parseToXML($myrow["braddress1"] . ", " . $myrow["braddress2"] . ", " . $myrow["braddress3"] . ", " . $myrow["braddress4"]) . '" ';
    echo 'lat="' . $myrow['lat'] . '" ';
    echo 'lng="' . $myrow['lng'] . '" ';
    echo 'type="' . $myrow['area'] . '" ';
    echo '/>';
}

// End XML file
echo '</markers>';
?>