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

[eluser]MarcelMarnix[/eluser]
Hello,

I was wondering what kind of grid to use for planning purpose.
After googling for three days, I found nothing.

the Idea: I want to create an online planning for a small (6 alleys) bowling centre.

I want to show the free lanes in green and the occupied ones in red. Later I also want to be able to hover over the red ones and see in a popup who has this reservation.

And.. when hovering the green ones a popup with the possibility to book online.

example day

|Time |Lane1|Lane2|Lane3|
|15:00|Green|Red |Green|
|16:00|Green|Red |Red |

http://marcelmarnix.com/images/DayPlanning.png

Example Week (Monday and tuesday closed)
The numbers show the free lanes.

|Time |We|Th|Fr|
|15:00|3 |0 |6 |
|16:00|3 |0 |3 |

http://marcelmarnix.com/images/WeekPlanning.png

Any Ideas?
Thanks in advance
#2

[eluser]überfuzz[/eluser]
Where did you hit the ground?
#3

[eluser]MarcelMarnix[/eluser]
I did not hit the ground yet!!

The example is an excell sheet!!

I just need some help and ideas,

(Sorry for my English because I am Not)
#4

[eluser]überfuzz[/eluser]
One idea would be start build the app and hit us with questions as you go along. ;-)
#5

[eluser]CroNiX[/eluser]
Not too hard...just build your table with your data... Then for the various fields that need color coding run a check on if the lane is available. If its available, wrap it in a <span style="color:green">the_value</span> if not use red (or use a classname on the td instead of span (better).

To hover and get details/be able to make reservation, you would probably want to use a javascript framework like jQuery or Mootools.
#6

[eluser]jcavard[/eluser]
[quote author="MarcelMarnix" date="1259711472"]I did not hit the ground yet!!

The example is an excell sheet!!

I just need some help and ideas,

(Sorry for my English because I am Not)[/quote]

Well, I don't mean to be rude but I don't understand how you got a contract for some app development and can't figure out a basic thing such as HTML TABLE, If you can't do this... you might as well cancel that project as it's basically the main goal of your app.

It's pretty straight forward...

loop through the time of the day (0-23h)
then loop through each of 6 alleyrs (0-5)
then color=red or color=green depending on some DB query that returns availability...

Code:
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 = 0; $i < 24; i++) //0:00 - 23:00
{
    echo "<tr>";
    echo "<td>" . sprintf("d:00", $i) . "</td>";
    echo "</tr>";
    echo "<tr>";

    for($j = 1; $j < 7; $j++) // alley #1-#6
    {
        $avail = $this->Some_model->get_availability($alley, $date_time);
        
        echo '<td style="color: ' . ($avail ? 'green' : 'red') . ';">X</td>';
    }
    
    echo "</tr>";
}
echo "</table>";

This would output somethign like
Code:
+----------+----------+----------+----------+----------+----------+----------+
|TIME      | Alley #1 | Alley #2 | Alley #3 | Alley #4 | Alley #5 | Alley #6 |
+----------+----------+----------+----------+----------+----------+----------+
|    00:00 |        X |        X |        X |        X |        X |        X |
+----------+----------+----------+----------+----------+----------+----------+
|    01:00 |        X |        X |        X |        X |        X |        X |
+----------+----------+----------+----------+----------+----------+----------+
|     .... |        X |        X |        X |        X |        X |        X |
+----------+----------+----------+----------+----------+----------+----------+
|    23:00 |        X |        X |        X |        X |        X |        X |
+----------+----------+----------+----------+----------+----------+----------+
#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:
&lt;?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;
#8

[eluser]jcavard[/eluser]
[quote author="MarcelMarnix" date="1259764575"]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:
&lt;?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;
[/quote]
I'll stick around, just post whatever question you have.




Theme © iAndrew 2016 - Forum software by © MyBB