Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

PHP Color coding help

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

PHP Color coding help

Postby fonrob » Tue Jan 08, 2013 6:57 am

I need to have words flagged with color here is my code how can I have both failed and Cancelled show up red.

if($num_sched_adj > '0')
{
echo '</ul><table class="data">
<tr>
<th style="width:5%">SMS </th>
<th style="width:5%">Time </th>
<th style="width:40%">Group </th>
<th style="width:40%">Job </th>
<th style="width:10%">Status </th>
</tr>';

WHILE($row4 = MYSQL_FETCH_ARRAY($sched_adjresult))
{
$date_start = $row4['date_start'];
$ticket = $row4['ticket'];
$time_start = SUBSTR($row4['time_start'], 0, 5);
$group_Name = $row4['Group_Name'];
$job_Name = STR_REPLACE(',', '<br/>',$row4['Job_Name']);
$adjstatus = $row4['status'];
$altcolor = $altcolor == 'rowcolor2' ? 'rowcolor1' : 'rowcolor2';
$statuscolor = $adjstatus == 'Failed' ? '#C12603' : '#01C425';
$statuscolor = $adjstatus == 'Cancelled' ? '#C12603' : '#01C425';


echo '<tr class="'.$altcolor.'">
<td class="text_center">'.$ticket.'</td>
<td class="text_center">'.$time_start.'</td>
<td class="text_left">'.$group_Name.'</td>
<td class="text_left">'.$job_Name.'</td>
<td class="text_center" style="background-color:'.$statuscolor.'">'.$adjstatus.'</td>
</tr>';

}
echo '</table>';
fonrob
New php-forum User
New php-forum User
 
Posts: 1
Joined: Tue Jan 08, 2013 6:52 am

Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron