Elxis CMS Forum

Extensions => Components => Topic started by: bledi on January 31, 2014, 09:47:43

Title: XML Exporting data
Post by: bledi on January 31, 2014, 09:47:43
Hello, i think a small bug:
When i export as XML room data at the end of, line 77 is missing </iosres>, instead of </iosr should be </iosres>.
Another request:
the format of the dates exported in the IOSR 3. was: <sdate>2014/18/5</sdate>
while IOSR 4 is: <sdate>2014185</sdate>. I use the exporting of data to create Excel files, and give to my partners as excel files.
So, if this dos not influence in other types of exportings maybe the dates format can be changed, using "/"

Thanks Bledi
Title: Re: XML Exporting data
Post by: datahell on January 31, 2014, 13:12:02
I don't see "</iosr" I see the correct "</iosres>"

IOSR 4.x internally used zdates.
 2014185 is NOT 2014/18/5, this is a huge mistake! 2014185 is the 186th day of year 2014 which means July 5 2014!
The counting starts from 0, so 185  is the 186th day of the year.

2014000 is January 1 2014
2014001 is January 2 2014
....
2014030 is January 31 2014
2014031 is February 1 2014
2014032 is February 2 2014
...

Importing/exporting price rates is an internal ISOR feature this is why it uses the internal format (zdates).

In php you can get the number of day with the "z" parameter in date funtion.
date('z');

IOSR uses sprintf to make sure this value has 3 digits length.
Let's say you want the zdate for September 23 2014, you calculate it like this:
$ts = mktime(12, 0, 0, 9, 23, 2014);
$zdate = '2014'.sprintf("%03d", gmdate('z', $ts));

I have implemented "zdates" and use these because they are ultra fast in calculations. Dates are stored as 7 digits integers and can be compared easily and fast.
Title: Re: XML Exporting data
Post by: bledi on January 31, 2014, 18:21:05
Thanks Datahell,
But i tried again to export some rooms and again at the end of each XML file, i see only  "</iosr" I don`t know why...


Concerning the zdates i am clear now,

Thanks Bledi
Title: Re: XML Exporting data
Post by: datahell on January 31, 2014, 19:04:41
I am sorry, I don't see any problem in XML export. The tag closes properly.
If you want send me a personal message with username/password for your site's administration panel to check it.