Hello everyone,
I'm stuck with coloring the value in a row. For now I am testing with one number to see if I can give the row with the value a color, but for now it keeps creating a new row wich will have the background-color I want. The code starts on row 42. The rest of the scripts works.
<html>
<body>
<?php
mt_srand((double)microtime()*1000000);
//Een bijzondere aanpak voor het vullen
function Vullen()
{
$getallen = array(0,1,2,3,4,5,6,7,8,9);
shuffle($getallen);
return $getallen;
}
$getallen = Vullen();
//De functie display is om de getallen aan de rijnummers te koppelen: dus 1 + 0 t/m 9 voor rij 1 en 2 + 0 t/m 9 voor rij twee etc
function display($getallen){
$table = '<table border="1px" cellpadding="1px" >';
$bingokaart = array();
//hoeveel rijen
for ($row = 1; $row < 7; ++$row){
$columnCount=0;
$bingokaart[$row] = array();
$table .= '<tr>';
//Hier print je de getallen en de rijen
foreach ($getallen as $number){
if($columnCount < 6){
$bingokaart[$row] = $row .$number;
$table .= '<td>'.$bingokaart[$row] . '</td>';
}
/*}*/
$columnCount++;
//Einde van de bingokaart
//Hier definieer ik de getallen die getrokken worden per rij en column
//for testing I use just one number
$backgroundColor = 'green';
$getrokkengetal = 15;
//here I use OR just to test if the color of the field will change
if (($bingokaart[$row]==$getrokkengetal) || ($columnCount == $getrokkengetal)) {
//Here it makes a new row with the background color - But it must color the cell with the nummber on row 1
//If i don't use the div it will echo (for example) 1 . background-color:#ff0000
echo "<div style ='background-color:#ff0000'> $row </div>";
}
}
$table .= '</tr>';
}
$table .='</table>';
echo $table;
}
display($getallen);
?>
</body>
</html>
Thanks for the help!
Rem