Welcome Guest, Not a member yet? Register   Sign In
What grid to use for planning purpose, to show events in a colored cell
#7

[eluser]MarcelMarnix[/eluser]
Thanks for the code I needed a start.

No it's not a contract, just a project getting to learn more about CI. I even want to use doctrine and Jquery.

I've Adjusted the code a little bit to have a working example, now I will try to find out how to create my relational database, model etc. and get it all working In CI I will post that code later.

Perhaps you all could help me to keep the code clean and keep the code where it belongs (M, V or C).

Later I want to know about how to use Jquery for the hovering.

Code:
<?php
echo "<table>";
echo "<tr>";
echo "<td>Time</td>";
echo "<td>Alley #1</td>";
echo "<td>Alley #2</td>";
echo "<td>Alley #3</td>";
echo "<td>Alley #4</td>";
echo "<td>Alley #5</td>";
echo "<td>Alley #6</td>";
echo "</tr>";

for($i = 14; $i < 24; $i++) //14:00 - 23:00
{
   echo "<tr>";
    echo "<td>" . sprintf("%d:00", $i) . "</td>";

    for($j = 1; $j < 7; $j++) // alley #1-#6
    {
       // Here comes code from the model
       // $avail = $this->Some_model->get_availability($alley, $date_time);
      
       ($j & 1) ? $avail=true : $avail=false; //Even or Odd just for example
        echo '<td align="center" bgcolor="' . ($avail ? 'green' : 'red') . '">X</td>';
    }
    
    echo "</tr>";
}
echo "</table>";
?&gt;


Messages In This Thread
What grid to use for planning purpose, to show events in a colored cell - by El Forum - 12-02-2009, 02:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB