Need help reworking this php code/logic. Right now, if I have no value for either column ‘Duration’ or ‘Size’, my html table is blank and I put a default value of n/a.
I want to change the logic to continue to handle that condition and give an n/a value, but also add the logic to read if BOTH are n/a, then set my column ‘Status’ value = ‘In Progress’.
Somehow, my commented code isn’t working right. Thanks.
foreach ($keys as $column){
if (isset($row[$column])){
if ($column == 'Server'){
echo '<td> <a href="' . $server_array[$row[$column]] . '">' . $row[$column] . '</a></td>';
} elseif ($column == 'Status'){
echo '<td> <font color="' . $color_array[$row[$column]] . '">' . $row[$column] . '</font></td>';
} else {
echo '<td>' . $row[$column] . '</td>';
}
} elseif ($column == 'Status') {
echo '<td><font color="yellow"> Review </font></td>';
} elseif ($column == 'Duration') {
echo '<td> n/a </td>';
} elseif ($column == 'Size') {
echo '<td> n/a </td>';
//} elseif ($column == 'Duration') && ($column =='Size') {
// echo '<td> In Progress </td>';
} else {
echo '<td> </td>';
}
}
try this
instead of