I'm getting data from this function, now I want checked checkboxes based on my condition and my condition is if I got value roro
from db no will be checked if I got Vessel, Containerized
yes will be checked.
$getDataForPDF = getDataForPDF($bookingsId, $bookingsLettersDockReceiptId);
if($getDataForPDF["typeOfMove"] == "Vessel, Containerized") {
$checkedYes = "checked";
} if($getDataForPDF["typeOfMove"] == "roro") {
$checkedNo = "checked";
}
and I'm using this condition in checkboxes
$html .= '<tr>';
$html .= '<td colspan="3">';
$html .= '<small>11. TYPE OF MOVE</small> <br />';
$html .= $getDataForPDF["typeOfMove"];
$html .= '</td>';
$html .= '<td colspan="2">';
$html .= '<small>11a. CONTAINERIZED (Vessel only)</small> <br/>';
$html .= '<input type="checkbox" checked="'.$checkedYes.'" name="yes"> Yes <input type="checkbox" checked="'.$checkedNo.'" name="no"> No';
$html .= '</td>';
$html .= '</tr>';
my condition is right but not working on checked="checked"
condition. What is wrong in my code?