Subversion Repositories cheapmusic

Rev

Rev 43 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
if (empty($argv[1]) || !file_exists($argv[1])) {
    echo "File argument missing", PHP_EOL;
    exit(1);
}

$xml=simplexml_load_file($argv[1]) or die("Error: Cannot create xml object from file");

foreach ($xml->{'promotion'} as $promotion) {
    echo "NULL";
    echo "," . $promotion->ADVERTISER;
    echo "," . date_format(date_create($promotion->PROMOTIONSTARTDATE), 'Y-m-d');
    echo "," . date_format(date_create($promotion->PROMOTIONENDDATE), 'Y-m-d');
    echo ",\"" . $promotion->NAME . "\"";
    echo "," . ($promotion->COUPONCODE != '0' ? $promotion->COUPONCODE : "");
    echo "," . str_replace('http://', 'https://', (string)$promotion->TRACKINGURL);
    echo "," . str_replace('http://', 'https://', (string)$promotion->IMAGEURL);
    echo PHP_EOL;
}
exit(0);