"; } if($hasWriteAccess ) { $edit_link=""; } if($hasExecuteAccess) { if(!hasChildData('patient_master','dept_id',$dept_id)){ $delete_link=""; } } $space="   "; $links = $view_link.$space.$edit_link.$space.$delete_link; $data['rows'][] = array( 'id' => $row_dept['dept_id'], 'cell' => array($count++,$row_dept['dept_id'] ,$bu_name ,$row_dept['dept_name'],$row_dept['dept_headname'],$row_dept['dept_email'],$links) ); } $data['rows'][] = array( 'id' => $row['filterkey'], 'cell' => array('', "", "", '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '') ); echo json_encode($data); ?>