';
$data .= '
Name | id | EmpCode | AAdhar |
';
$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 .= 'Ailment Name | Ailment id | Ailment Code | Ailment Des. |
';
$query1 = "select * from ailment where ailment_id='" . $mailment_id . "' ";
$result1 = mysqli_query($conn,$query1);
$row1 = mysqli_fetch_assoc($result1);
$data .= '' . $row1['ailment_name'] . ' | ' . $row1['ailment_id'] . ' | ' . $row1['ailment_code'] . ' | ' . $row1['ailment_desc'] . ' |
';
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 .= '' . $row['ailment_name'] . ' | ' . $row['ailment_id'] . ' | ' . $row['ailment_code'] . ' | ' . $row['ailment_desc'] . ' |
';
}
}
$data .= '
';
}else if ($mcomplaint_id != '' && $mcomplaint_id != null) {
$data = '';
$data .= 'Complaint | complaint id | complaint Code | complaint Des. |
';
$query1 = "select * from complaints where complaint_id='" . $mcomplaint_id . "' ";
$result1 = mysqli_query($conn,$query1);
$row1 = mysqli_fetch_assoc($result1);
$data .= '' . $row1['complaint'] . ' | ' . $row1['complaint_id'] . ' | ' . $row1['complaint_code'] . ' | ' . $row1['complaint_desc'] . ' |
';
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 .= '' . $row['complaint'] . ' | ' . $row['complaint_id'] . ' | ' . $row['complaint_code'] . ' | ' . $row['complaint_desc'] . ' |
';
}
}
$data .= '
';
} else if ($mcontractor_id != '' && $mcontractor_id != null) {
$data = '';
$data .= 'Name | id | Desc |
';
$query1 = "select * from employer_contractor where id='" . $mcontractor_id . "' ";
$result1 = mysqli_query($conn,$query1);
$row1 = mysqli_fetch_assoc($result1);
$data .= '' . $row1['employer_contractor_name'] . ' | ' . $row1['id'] . ' | ' . $row1['employer_contractor_desc'] . ' |
';
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 .= '' . $row['employer_contractor_name'] . ' | ' . $row['id'] . ' | ' . $row['employer_contractor_desc'] . ' |
';
}
}
$data .= '
';
} else if ($mdepartment_id != '' && $mdepartment_id != null) {
$data = '';
$data .= 'Name | id | Head |
';
$query1 = "select * from department where dept_id='" . $mdepartment_id . "' ";
$result1 = mysqli_query($conn,$query1);
$row1 = mysqli_fetch_assoc($result1);
$data .= '' . $row1['dept_name'] . ' | ' . $row1['dept_id'] . ' | ' . $row1['dept_headname'] . ' |
';
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 .= '' . $row['dept_name'] . ' | ' . $row['dept_id'] . ' | ' . $row['dept_headname'] . ' |
';
}
}
$data .= '
';
}else if ($mdesignation_id != '' && $mdesignation_id != null) {
$data = '';
$data .= 'Name | id | Desc |
';
$query1 = "select * from designation where designation_id='" . $mdesignation_id . "' ";
$result1 = mysqli_query($conn,$query1);
$row1 = mysqli_fetch_assoc($result1);
$data .= '' . $row1['designation_name'] . ' | ' . $row1['designation_id'] . ' | ' . $row1['designation_desc'] . ' |
';
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 .= '' . $row['designation_name'] . ' | ' . $row['designation_id'] . ' | ' . $row['designation_desc'] . ' |
';
}
}
$data .= '
';
}else if ($msub_section_id != '' && $msub_section_id != null) {
$data = '';
$data .= 'Name | id | Head |
';
$query1 = "select * from sub_section where sub_section_id='" . $msub_section_id . "' ";
$result1 = mysqli_query($conn,$query1);
$row1 = mysqli_fetch_assoc($result1);
$data .= '' . $row1['sub_section_name'] . ' | ' . $row1['sub_section_id'] . ' | ' . $row1['sub_section_headname'] . ' |
';
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 .= '' . $row['sub_section_name'] . ' | ' . $row['sub_section_id'] . ' | ' . $row['sub_section_headname'] . ' |
';
}
}
$data .= '
';
}
error_log($data);
echo json_encode($data);
commit();