-->-->-->-->-->-->-->
require '/usr50/home/retrovox/public_html/manage/php-lib/fnRetrovoxParseXml.php';
$sDataPath = '/usr50/home/retrovox/public_html/product-data';
$iCurrentProductId = 0;
$iMaximumProductId = 0;
$iNewProductId = 0;
$sExtractedId = ''; //-- to get the product-id from the file name
//-- find the maximum product-id value so that a new product-id
//-- can be generated for the new product.
$dh = opendir($sDataPath);
while (false !== ($sMemberFileName = readdir($dh)))
{
$sExtractedId =
str_replace('.xml', '', str_replace('product-', '', $sMemberFileName));
if (is_numeric($sExtractedId))
{
$iCurrentProductId = $sExtractedId;
//-- for debugging
//echo "$iCurrentProductId
\n";
if ($iCurrentProductId > $iMaximumProductId)
{
$iMaximumProductId = $iCurrentProductId;
} //-- if
} //-- if is product data file
} //-- while more files
$iNewProductId = $iMaximumProductId + 1;
$aaProductData['product-id'] = $iNewProductId;
$aaProductData['short-description'] = '';
$aaProductData['long-description'] = '';
$aaProductData['product-name'] = '';
$aaProductData['product-size'] = '';
$aaProductData['order'] = '';
$aaProductData['price'] = '';
$aaProductData['weight'] = '';
$aaProductData['image-file'] = '';
$aaProductData['thumbnail-image-file'] = '';
$aaProductData['shipping-charge'] = '';
$sFilePath = "$sDataPath/product-$sProductId.xml";
//--<--<--<--<--<
?>