...

View Full Version : How to show the Status of the values in database similar to Booking Tickets in online



Mythili
10-21-2012, 07:21 PM
U might have see in online ticket reservation status..the reservation of the seats status is showed in different colors according to the change in database values.lik that consider 9 vehicles status in a matrix lik format..according to database values of the vehicles such as the compaction level the cells should be shown in different colors

Example
Vehicle ID Compaction Level
1 68
2 40
3 80
4 70
5 20
6 52
7 90
8 87
9 62

This are the threshold levels >80 (Threshold color is green), >50(color is blue) , <50(color is red)
How to do this in php...please help me out...need it urgent

bjarneo
10-21-2012, 08:13 PM
Just set a class (css) on lets say the span holding your value.

Quick example:



$valueDatabase = 80;
// Code above this is where you get the value(s) from your database

if($valueDatabase > 80) {
echo '<span class="green">'.$valueDatabase.'</span>';
} else if($valueDatabase > 50) {
echo '<span class="blue">'.$valueDatabase.'</span>';
} else {
echo '<span class="red">'.$valueDatabase.'</span>';
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum