Im trying to display this table:
(To clarify: Uren = Hours, Maandag = Monday, Dinsdag = Tuesday, Woensdag = Wednesday, Donderdag = Thursday, Vrijdag = Friday.
Now im planning to show all data like this in different tables, on the same page in a some kind of "list":
Monday
Hours: Monday
1. Index
2. Index
3. Index
4. Index
5. Index
6. Index
7. Index
8. Index
Tuesday
etc. etc.
Same for all other days~
Only the first 8 hours all the time. Now i got this code:
public function notLoggedIn($whichtable, $whichrow, $link, $preference, $dag, $uur) { $this->newfunction = new functions;
$getvalue = $this->newGet();
$resultaat = DB_connect()->query("SELECT * FROM $whichtable WHERE $whichrow = '$preference'");
$days = array("Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag"); // take all dagen op
$loop = array();
while($rij = $resultaat->fetch_assoc())
{
$loop[] = $rij;
}
foreach ($days as $currentDay)
{
echo "<table style='float:left; width:100%;'>";
echo "<th></th><th style='width:100%; left:0; background-color:#9a136e; color:#fff; font-size:20px;'>
<div style='margin-auto;'>$currentDay</div></th>";
foreach($loop as $test)
{
$day = $test[$currentDay];
$uren = $test['Uren'];
$getkleur = explode(",", $day);
echo "<tr>"; ?> <th style='width:20%; display:$getkleur[5]; border-right:1px dotted #000;'>
<? $this->newfunction->linkToHoure($uren)?></th><?
echo "<td style='border-bottom:1px solid #999; display:$getkleur[5]; width:100%; height:40px;'>".$getkleur[0]."
<a style='font-size:24px; margin-top:-7px; position:absolute; right:0;' href='#'>></a></td></tr>
<tr><td></td><td style='width:100%;'><b><a style='background-color:$getkleur[4]; color:#fff;' href=''>".$getkleur[3]."</b>
<b><a style='color:#906;' href=''>". $getkleur[2]."</b></a></td></tr>";
} // close foreach
echo "</table>";
}
}// close notloggedin function
Now it does display everthing on the same page , but like this:
1. (Index of monday). Monday
1. (Index of Tuesday). Tuesday
1. (Index of Wednesday). Wednesday
1. (Index of Thursday). Thursday
1. (Index of Friday). Friday
2. (Index of Monday). Monday
2. (Index of Tuesday). Tuesday
2. (Index of Wednesday). Wednesday
2. (Index of Thursday). Thursday
2. (Index of Friday). Friday
Till 8... Instead of the example above. But it should get seperated in hours & days.
I got no idea how to solve this. All help is appriciated..