B
Bruno Moura
Hi
I have a following method
view(all_people, begin_date, end_date)
That's give me an array like this:
# for a first day (day 1)
view("*", '2009-12-01 00:00:00', '2009-12-01 24:59:59')
[[name_person1, room1], [name_person2, room2], [name_person3, room2]]
# for a second day (day 2)
view("*", '2009-12-02 00:00:00', '2009-12-02 24:59:59')
[[name_person1, room1], [name_person3, room1], [name_person2, room2]]
And I need to organize theses arrays in a following structure:
[{room1 => [{day1 => [name_person1]},
{day2 => [name_person1, name_person3]}]
},
{room2 => [{day1 => [name_person2, name_person3]},
{day2 => [name_person2]}]
}]
And finally put this array in a cvs strings
room1; day1; name_person1
room1; day2; name_person1
room1; day2; name_person3
room2; day1; name_person2
room2; day1; name_person3
room2; day2; name_person2
I tried some scripts for hours but I didn't do this job!
Too complicated for my.
Someone can help me if this?
Thanks so much!
I have a following method
view(all_people, begin_date, end_date)
That's give me an array like this:
# for a first day (day 1)
view("*", '2009-12-01 00:00:00', '2009-12-01 24:59:59')
[[name_person1, room1], [name_person2, room2], [name_person3, room2]]
# for a second day (day 2)
view("*", '2009-12-02 00:00:00', '2009-12-02 24:59:59')
[[name_person1, room1], [name_person3, room1], [name_person2, room2]]
And I need to organize theses arrays in a following structure:
[{room1 => [{day1 => [name_person1]},
{day2 => [name_person1, name_person3]}]
},
{room2 => [{day1 => [name_person2, name_person3]},
{day2 => [name_person2]}]
}]
And finally put this array in a cvs strings
room1; day1; name_person1
room1; day2; name_person1
room1; day2; name_person3
room2; day1; name_person2
room2; day1; name_person3
room2; day2; name_person2
I tried some scripts for hours but I didn't do this job!
Too complicated for my.
Someone can help me if this?
Thanks so much!