function get_status($data) {
return ($data->cm_status == 'Y') ? 'Active' :
($data->cm_status == 'N') ? 'Inactive' : '-';
}
I should get Active if $data->cm_status is Y
I should get Inactive if $data->cm_status is N
I should get - if $data->cm_status is anything else
But actually in all case I am getting Inactive
What is the mistake I am doing?
references to your answers appreciated