vendredi 25 novembre 2016

working with nested if query [on hold]

Hi I have a field which is supposed to display 1 of 3 icons based on a 2 conditions.

The key field here is VisitPlanRequired, if the answer to this is a "No" then the the icon should be na.png, however if it a "Yes", it then depends on another variable.

So if VisitPlanRequired = yes, then the two options are either ok.jpg or notok.jpg, the actual decider is whether the field VisitPlanIssued is null or contains a date, so if it contains a date, it should go to "ok", if it doesnt, it should go to notok.

This is the code I have so far, but I am struggling to get it to work for all three conditions, I would appreciate your help:

if ($data["VisitPlanRequired"]==='No')
   $value="<img src=images/na.png id='image'>";

elseif 
($data["AuditPlanIssued"])
{   $value="<img src=images/ok.jpg id='image'>";}

else
   $value="<img src=images/notok.jpg id='image'>";

Aucun commentaire:

Enregistrer un commentaire