Weergeven' . NEW_LINE;
}
?>
'.print_r( $arrAll_villas).'';
//print_r(array_values($arrVilla));
foreach($arrAll_villas as $ids){
$arrAll_ids[] = $ids[1];
}
// $arrAll_ids heeft nu de voorkomende id's
// hierin gooien we alles weg wat niet uniek is
// dus 1,1,3,3,3 moet alleen 1,3 van over blijven
$arrAll_unique_ids = array_unique($arrAll_ids);
// nu gaan we deze id's gebruiken om in de
// db resultaten van net de data te sorteren
$output = '';
//print_r($arrAll_unique_ids);exit;
//echo $arrAll_villas[2][0];exit;
foreach($arrAll_unique_ids as $key=>$table_villa){
$tdrow = '';
$villaname = '';
$villaname = $arrAll_villas[$key][0];
for($i=1;$i<=52;$i++){
if(!empty($arrAll_villas[$i][3])){
$tdrow .= '| '.$arrAll_villas[$key][3].' | ';
}
else {
$tdrow .= ' | ';
}
}
$output = '';
$output .= '| '.$villaname.' |
';
$output .= ''.$tdrow.'
';
$table = $output;
$table .= '
';
//echo 'key= '.$key.'
table_villa= '.$table_villa.'
';
}
echo $table;
/*
if (array_key_exists($id, $arrVilla))
{
echo'
| weeknumber: |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
';
echo '';
echo '| ' . $arrVilla[0] . ' | ';
for ($weekId = 1; $weekId <= 52; $weekId++)
{
if ($weekId == $arrVilla[$id])
{
echo '' . $arrVilla[$id] . ' | ';
$id = $id + 3;
if (!array_key_exists($id, $arrVilla))
{
for ($weekId = $weekId; $weekId <= 51; $weekId++)
{
echo '0 | ';
}
}
}
else
{
echo '0 | ';
}
}
echo'
';
echo'
';
}
else
{
echo'geen beschikbaarheid aanwezig';
}
*/
?>