'; $data .= 'NameidEmpCodeAAdhar'; $query1 = "select * from patient_master where id='" . $mpatient_id . "' "; $result1 = mysqli_query($conn,$query1); $row1 = mysqli_fetch_assoc($result1); $data .= '' . $row1['patient_name'] . '' . $row1['id'] . '' . $row1['emp_code'] . '' . $row1['aadhar_no'] . ''; for ($i = 0; $i < $noOfRows; $i++) { if (${"patient_id$i"} == '' or ${"patient_id$i"} == null) { continue; } else { $query = "select * from patient_master where id= '" . ${"patient_id$i"} . "' "; $result = mysqli_query($conn,$query); $row = mysqli_fetch_assoc($result); error_log("merge query get data:" . $query); $data .= '' . $row['patient_name'] . '' . $row['id'] . '' . $row['emp_code'] . '' . $row['aadhar_no'] . ''; } } $data .= ''; }else if ($mailment_id != '' && $mailment_id != null) { $data = ''; $data .= ''; $query1 = "select * from ailment where ailment_id='" . $mailment_id . "' "; $result1 = mysqli_query($conn,$query1); $row1 = mysqli_fetch_assoc($result1); $data .= ''; for ($i = 0; $i < $noOfRows; $i++) { if (${"ailment_id$i"} == '' or ${"ailment_id$i"} == null) { continue; } else { $query = "select * from ailment where ailment_id= '" . ${"ailment_id$i"} . "' "; error_log("aliment sql ".$query); $result = mysqli_query($conn,$query); $row = mysqli_fetch_assoc($result); error_log("merge query get data:" . $query); $data .= ''; } } $data .= '
Ailment NameAilment idAilment CodeAilment Des.
' . $row1['ailment_name'] . '' . $row1['ailment_id'] . '' . $row1['ailment_code'] . '' . $row1['ailment_desc'] . '
' . $row['ailment_name'] . '' . $row['ailment_id'] . '' . $row['ailment_code'] . '' . $row['ailment_desc'] . '
'; }else if ($mcomplaint_id != '' && $mcomplaint_id != null) { $data = ''; $data .= ''; $query1 = "select * from complaints where complaint_id='" . $mcomplaint_id . "' "; $result1 = mysqli_query($conn,$query1); $row1 = mysqli_fetch_assoc($result1); $data .= ''; for ($i = 0; $i < $noOfRows; $i++) { if (${"complaint_id$i"} == '' or ${"complaint_id$i"} == null) { continue; } else { $query = "select * from complaints where complaint_id= '" . ${"complaint_id$i"} . "' "; error_log("complaint sql ".$query); $result = mysqli_query($conn,$query); $row = mysqli_fetch_assoc($result); error_log("merge query get data:" . $query); $data .= ''; } } $data .= '
Complaintcomplaint idcomplaint Codecomplaint Des.
' . $row1['complaint'] . '' . $row1['complaint_id'] . '' . $row1['complaint_code'] . '' . $row1['complaint_desc'] . '
' . $row['complaint'] . '' . $row['complaint_id'] . '' . $row['complaint_code'] . '' . $row['complaint_desc'] . '
'; } else if ($mcontractor_id != '' && $mcontractor_id != null) { $data = ''; $data .= ''; $query1 = "select * from employer_contractor where id='" . $mcontractor_id . "' "; $result1 = mysqli_query($conn,$query1); $row1 = mysqli_fetch_assoc($result1); $data .= ''; for ($i = 0; $i < $noOfRows; $i++) { if (${"contractor_id$i"} == '' or ${"contractor_id$i"} == null) { continue; } else { $query = "select * from employer_contractor where id= '" . ${"contractor_id$i"} . "' "; $result = mysqli_query($conn,$query); $row = mysqli_fetch_assoc($result); error_log("merge query get data:" . $query); $data .= ''; } } $data .= '
NameidDesc
' . $row1['employer_contractor_name'] . '' . $row1['id'] . '' . $row1['employer_contractor_desc'] . '
' . $row['employer_contractor_name'] . '' . $row['id'] . '' . $row['employer_contractor_desc'] . '
'; } else if ($mdepartment_id != '' && $mdepartment_id != null) { $data = ''; $data .= ''; $query1 = "select * from department where dept_id='" . $mdepartment_id . "' "; $result1 = mysqli_query($conn,$query1); $row1 = mysqli_fetch_assoc($result1); $data .= ''; for ($i = 0; $i < $noOfRows; $i++) { if (${"department_id$i"} == '' or ${"department_id$i"} == null) { continue; } else { $query = "select * from department where dept_id= '" . ${"department_id$i"} . "' "; $result = mysqli_query($conn,$query); $row = mysqli_fetch_assoc($result); error_log("merge query get data:" . $query); $data .= ''; } } $data .= '
NameidHead
' . $row1['dept_name'] . '' . $row1['dept_id'] . '' . $row1['dept_headname'] . '
' . $row['dept_name'] . '' . $row['dept_id'] . '' . $row['dept_headname'] . '
'; }else if ($mdesignation_id != '' && $mdesignation_id != null) { $data = ''; $data .= ''; $query1 = "select * from designation where designation_id='" . $mdesignation_id . "' "; $result1 = mysqli_query($conn,$query1); $row1 = mysqli_fetch_assoc($result1); $data .= ''; for ($i = 0; $i < $noOfRows; $i++) { if (${"designation_id$i"} == '' or ${"designation_id$i"} == null) { continue; } else { $query = "select * from designation where designation_id= '" . ${"designation_id$i"} . "' "; $result = mysqli_query($conn,$query); $row = mysqli_fetch_assoc($result); error_log("merge query get data:" . $query); $data .= ''; } } $data .= '
NameidDesc
' . $row1['designation_name'] . '' . $row1['designation_id'] . '' . $row1['designation_desc'] . '
' . $row['designation_name'] . '' . $row['designation_id'] . '' . $row['designation_desc'] . '
'; }else if ($msub_section_id != '' && $msub_section_id != null) { $data = ''; $data .= ''; $query1 = "select * from sub_section where sub_section_id='" . $msub_section_id . "' "; $result1 = mysqli_query($conn,$query1); $row1 = mysqli_fetch_assoc($result1); $data .= ''; for ($i = 0; $i < $noOfRows; $i++) { if (${"sub_section_id$i"} == '' or ${"sub_section_id$i"} == null) { continue; } else { $query = "select * from sub_section where sub_section_id= '" . ${"sub_section_id$i"} . "' "; $result = mysqli_query($conn,$query); $row = mysqli_fetch_assoc($result); error_log("merge query get data:" . $query); $data .= ''; } } $data .= '
NameidHead
' . $row1['sub_section_name'] . '' . $row1['sub_section_id'] . '' . $row1['sub_section_headname'] . '
' . $row['sub_section_name'] . '' . $row['sub_section_id'] . '' . $row['sub_section_headname'] . '
'; } error_log($data); echo json_encode($data); commit();