I want to distribute some personnel in a week every day there are 3 times 7h-15h 15-23h 23h-7h .
The problem that I don't want a person to show more than one time in a day. I want to distribute personnel list to the day of week I try this:
<?php
$input = array("Name1","Name2", "Name3","Name4");
$rand_keys = array_rand($input, 3);
?>
<table border=1>
<tr>
<th> Samedi </th> <th> Dimanche </th> <th> Lundi </th> <th> Mardi </th> <th> Merecredi </th> <th> Jeudi </th> <th> Vendredi </th>
</tr>
<tr>
<?php
$j=1;
for($i=0;$i<7;$i++){
echo "<td>";
for($k=0;$k<3;$k++){
echo $input[$rand_keys[0]] ."7H-15H
" ;
echo $input[$rand_keys[1]] ."15H-23H
" ;
echo $input[$rand_keys[2]] ."23H-7H
" ;
}
echo "</td>";
}
?>