Subversion Repositories cheapmusic

Rev

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

Rev Author Line No. Line
43 - 1
<?php
2
if (empty($argv[1]) || !file_exists($argv[1])) {
3
    echo "File argument missing", PHP_EOL;
49 - 4
    exit(1);
43 - 5
}
6
 
7
$xml=simplexml_load_file($argv[1]) or die("Error: Cannot create xml object from file");
8
 
9
foreach ($xml->{'promotion'} as $promotion) {
10
    echo "NULL";
11
    echo "," . $promotion->ADVERTISER;
12
    echo "," . date_format(date_create($promotion->PROMOTIONSTARTDATE), 'Y-m-d');
13
    echo "," . date_format(date_create($promotion->PROMOTIONENDDATE), 'Y-m-d');
14
    echo ",\"" . $promotion->NAME . "\"";
15
    echo "," . ($promotion->COUPONCODE != '0' ? $promotion->COUPONCODE : "");
16
    echo "," . str_replace('http://', 'https://', (string)$promotion->TRACKINGURL);
17
    echo "," . str_replace('http://', 'https://', (string)$promotion->IMAGEURL);
18
    echo PHP_EOL;
49 - 19
}
20
exit(0);