我试图显示这个表:
(澄清一下:Uren = 小时,Maandag = 星期一,Dinsdag = 星期二,Woensdag = 星期三,Donderdag = 星期四,Vrijdag = 星期五。
现在我计划在不同的表格中显示所有这样的数据,在同一页面上的某种“列表”中:
Monday
Hours: Monday
1. Index
2. Index
3. Index
4. Index
5. Index
6. Index
7. Index
8. Index
Tuesday
etc. etc.
其他日子都一样~
一直只有前8个小时。现在我得到了这个代码:
公共函数 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
现在它确实在同一页面上显示一切,但像这样:
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
直到 8... 而不是上面的例子。但它应该在几小时和几天内分开。
我不知道如何解决这个问题。所有的帮助都是appriciated..