"; } if($hasWriteAccess ) { $edit_link=""; } if($hasExecuteAccess ) { $delete_link=""; } $space="   "; $links = $view_link.$space.$edit_link.$space.$delete_link; $data['rows'][] = array( 'id' => $row_patient['id'], 'cell' => array($count++, $row_patient['department_name'], $row_patient['department_code'],$links) ); } echo json_encode($data); ?>