Subversion Repositories cheapmusic

Rev

Go to most recent revision | Details | 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;
4
}
5
 
6
$xml=simplexml_load_file($argv[1]) or die("Error: Cannot create xml object from file");
7
 
8
foreach ($xml->{'promotion'} as $promotion) {
9
    echo "NULL";
10
    echo "," . $promotion->ADVERTISER;
11
    echo "," . date_format(date_create($promotion->PROMOTIONSTARTDATE), 'Y-m-d');
12
    echo "," . date_format(date_create($promotion->PROMOTIONENDDATE), 'Y-m-d');
13
    echo ",\"" . $promotion->NAME . "\"";
14
    echo "," . ($promotion->COUPONCODE != '0' ? $promotion->COUPONCODE : "");
15
    echo "," . str_replace('http://', 'https://', (string)$promotion->TRACKINGURL);
16
    echo "," . str_replace('http://', 'https://', (string)$promotion->IMAGEURL);
17
    echo PHP_EOL;
18
}