";
}else if($row['appointment_type']=='I'){
$view_link="";
}
if($row['appointment_type']=='O'){
$edit_link="";
}else if($row['appointment_type']=='I'){
$edit_link="";
}
$delete_link="";
$space=" ";
$links = $assign_link.$space.$view_link.$space.$edit_link.$space.$delete_link;
$isEmergency ="";
$isInjury="";
if($row['appointment_type']=='I'){
//$links.="";
$isInjury="";
}if($row['IsEmergency']==1 ){
// $links.="";
$isEmergency ="";
}
$check_results = "SBP:".$row['bp_sbp'].", DBP:".$row['bp_dbp'].", FBS:".$row['blood_sugar_fbs'].", RBS:".$row['blood_sugar_rbs'];
if($row['appointment_type']=='O'){
$diagnosis =getCommaSeperatedValuesForInClause("select ailment_name from ailment ","ailment_id",$row['ailment_ids']);
}else if($row['appointment_type']=='I'){
$diagnosis=getCommaSeperatedValuesForInClause("select injury_type_name from injury_type","injury_type_id",$row['injury_types']);
}
$appointment_date =$row['appointment_date'];
$complaints =$row['complaints'];
$examination_remarks =$row['examination_remarks'];
$space=" ";
$links = $view_link.$space.$edit_link.$space.$delete_link;
$data['rows'][] = array(
'id' => $row['id'],
'cell' => array($count++, date_format(date_create($row['appointment_date']),"d-M-Y H:i A"),$row['ticket_no'],$row['name'],getTableFieldValue('employee',"concat(fname,' ',lname)",'id',$row['emp_id']),$complaints, $examination_remarks, $diagnosis, getTreatmentTextForGuest($row['appointment_id']),$row['referral'], $row['followup'],$isEmergency, $isInjury,$check_results,$row['remarks'], $links)
);
}
;
$data['rows'][] = array(
'id' => $row['filterkey'],
'cell' => array('', "", "", '', '','', '', '', '', '', '', '', '','', '', '','', '', '','')
);
echo json_encode($data);
?>