I think some arrays would be advisable; not sure just how, 'cos I started to go crosseyed looking at the code.
YOu get the parse error because of things like
else ($Recordset2->Fields('highalarm') != 0)
You don't need (and shouldn't have) a condition expression after the else.
But each case could be simplified a fair bit anyway:
case 'Panel A2 B3':
echo "<img src=\"";
if ($Recordset2->Fields('error') == 139)
echo $redx;
elseif ($Recordset2->Fields('highalarm') == 0)
echo $greendot;
else
echo $reddot;
echo "\">";
break;
or
case 'Panel A2 B3':
echo "<img src=\"".
($Recordset2->Fields('error') == 139
? $redx;
: ($Recordset2->Fields('highalarm') == 0
? $greendot;
: $reddot
))."\">";
break;
Assuming (I haven't rigorously looked) that the only thing that changes from case to case is which Recordset is being looked at, an array
$Recordsets=array(
'Panel A2 B3'=>$Recordset2,
'Panel A2 B2'=>$Recordset3,
...
);
And then the whole switch would collapse down to
$Recordset = $Recordsets[$Recordset1->Fields('dev_name')];
echo "<img src=\"".
($Recordset->Fields('error') == 139
? $redx;
: ($Recordset->Fields('highalarm') == 0
? $greendot;
: $reddot
))."\">";
A bit more time and domain knowledge might see a better thought-out array put together.