ESH/excel_abnormality.php
2024-10-23 18:28:06 +05:30

720 lines
32 KiB
PHP

<?
include('includes/config/config.php');
include('includes/functions.php');
error_reporting(E_ERROR | E_PARSE);
header('Content-Type: application/force-download');
header('Content-disposition: attachment; filename=Abnormality_data.xls');
?>
<body>
<?php include('excel_ohc_header.php') ?>
<table border="1" width="100%" class="center card table table-striped">
<?php
$year = $_REQUEST['year'];
$qry_filter = "";
$query_date = "";
$start_date = $_REQUEST['startDate'];
$end_date = $_REQUEST['endDate'];
if (isset($start_date) && $start_date != '') {
$qry_date .= " and date(checkup_date) >=str_to_date('" . $start_date . "','%d-%m-%Y') ";
}
if (isset($end_date) && $end_date != '') {
$qry_date .= " and date(checkup_date) <=str_to_date('" . $end_date . "','%d-%m-%Y') ";
}
$abnormality_id_main = $_POST['abnormality_type'];
$abnormality_name_main = getFieldFromTable('abnormality_name', 'abnormality', 'abnormality_id', $abnormality_id_main);
if (isset($year) && $year != '') {
$qry_filter .= " and year(checkup_date) ='" . $year . "'";
}
?>
<tr style="background-color:aquamarine ;">
<th align="center" colspan="3">ALL ABNORMALITIES DISTRIBUTION DATA
<?php if (isset($year) && $year != '') {
echo " FOR " . $year;
} else {
echo " FROM " . $start_date . " TO " . $end_date;
} ?>
</th>
</tr>
<thead>
<tr>
<td style='background-color:#00d0ff'><strong>ABNORMALITY</strong></td>
<td style='background-color:#4de5eb;color:black' colspan="2">EMPLOYEES HAVING ABNORMALITY</td>
</tr>
</thead>
<?php
$data = array();
$abnormality_id_arr = array();
$sql_abnormality = "select * from abnormality";
$result_abnormality = mysqli_query($conn, $sql_abnormality);
$ab_count = 0;
while ($row_abnormality = mysqli_fetch_assoc($result_abnormality)) {
$abnormality_id = $row_abnormality['abnormality_id'];
$abnormality_id_arr[$ab_count] = $abnormality_id;
$ab_count++;
$query = "select max(checkup_id),emp_id from checkup_form where emp_id in (select id from patient_master where status='Active' order by id asc) and abnormality_ids ='" . $abnormality_id . "' or abnormality_ids like '%," . $abnormality_id . "' or abnormality_ids like '" . $abnormality_id . ",%' or abnormality_ids like '%," . $abnormality_id . ",%' $qry_filter $qry_date group by emp_id order by emp_id ";
error_log("query for abnormality reocrd " . $query);
if (!$result = mysqli_query($conn, $query)) {
error_log("error " . mysqli_error($conn) . " query " . $query);
} else {
$count = mysqli_num_rows($result);
$i = 0;
if ($count > 0) {
while ($row_first = mysqli_fetch_assoc($result)) {
$data[$abnormality_id][$i] = $row_first['emp_id'];
$i++;
}
} else {
$data[$abnormality_id][$i] = 0;
}
}
}
error_log("first data array " . print_r($data, true));
error_log("abnormality " . print_r($abnormality_id_arr, true));
for ($j = 0; $j < sizeof($abnormality_id_arr); $j++) {
?>
<tr>
<td><?= getFieldFromTable('abnormality_name', 'abnormality', 'abnormality_id', $abnormality_id_arr[$j]) ?></td>
<td colspan="2">
<?php
for ($k = 0; $k < sizeof($data[$abnormality_id_arr[$j]]); $k++) { ?>
<?php if ($data[$abnormality_id_arr[$j]][$k] != 0) {
echo "EMP ID- " . $data[$abnormality_id_arr[$j]][$k] . " " . getFieldFromTable('patient_name', 'patient_master', 'id', $data[$abnormality_id_arr[$j]][$k]);
} else {
echo "NO DATA";
} ?><br>
<?php
}
?>
</td>
</tr>
<?php
}
?>
<tr style="background-color:aquamarine ;">
<th align="center" colspan="3"><?= "AGE WISE DIST FOR " . strtoupper($abnormality_name_main) ?> &nbsp; DATA
<?php if (isset($year) && $year != '') {
echo " FOR " . $year;
} else {
echo " FROM " . $start_date . " TO " . $end_date;
} ?>
</th>
</tr>
<thead>
<tr>
<td style='background-color:#00d0ff'><strong>AGE GROUP</strong></td>
<td style='background-color:#4de5eb;color:black' colspan="2">EMPLOYEES RECORD</td>
</tr>
</thead>
<?php
$query_age_part = "";
$data_age = [];
$data_gender = [];
$data_pat_cat = [];
$data_collar = [];
$data_agewise_total = [];
$data_pat_cat_total = [];
$data_gender_total = [];
$query_age = "select * from rule_age_range";
if (!$result_age = mysqli_query($conn, $query_age)) {
error_log("error in age range query " . $query_age . " query " . $query_age);
} else {
while ($row_age = mysqli_fetch_assoc($result_age)) {
$start_age = $row_age['rule_age_start'];
$end_age = $row_age['rule_age_end'];
if ($end_age == 0) {
$start_age = $row_age['rule_age_start'];
$query_age_part = "year(CURDATE())-year(dob)>='" . $start_age . "'";
} else {
$query_age_part = "year(CURDATE())-year(dob)>='" . $start_age . "' and year(CURDATE())-year(dob)<'" . $end_age . "'";
}
$query = "select max(checkup_id),emp_id from checkup_form where emp_id in (select id from patient_master where status='Active' and $query_age_part order by id asc) $qry_filter $qry_date and (abnormality_ids ='" . $abnormality_id_main . "' or abnormality_ids like '%," . $abnormality_id_main . "' or abnormality_ids like '" . $abnormality_id_main . ",%' or abnormality_ids like '%," . $abnormality_id_main . ",%') group by emp_id order by emp_id ";
error_log("query for abnormality count " . $query);
if (!$result = mysqli_query($conn, $query)) {
error_log("error " . mysqli_error($conn) . " query " . $query);
} else {
$count = mysqli_num_rows($result);
$i = 0;
if ($count > 0) {
while ($row_age = mysqli_fetch_assoc($result)) {
$data_age[$start_age][$i] = $row_age['emp_id'];
$i++;
}
} else {
$data_age[$start_age][$i] = 0;
}
}
}
}
// for gender distribution
$query1 = "select max(checkup_id),emp_id from checkup_form where emp_id in (select id from patient_master where status='Active' and gender='M' order by id asc) $qry_filter $qry_date and (abnormality_ids ='" . $abnormality_id_main . "' or abnormality_ids like '%," . $abnormality_id_main . "' or abnormality_ids like '" . $abnormality_id_main . ",%' or abnormality_ids like '%," . $abnormality_id_main . ",%') group by emp_id order by emp_id ";
if (!$result1 = mysqli_query($conn, $query1)) {
error_log("error in query for male count " . mysqli_error($conn));
}
$count = mysqli_num_rows($result1);
$i = 0;
if ($count > 0) {
while ($row_gender = mysqli_fetch_assoc($result1)) {
$data_gender['male'][$i] = $row_gender['emp_id'];
$i++;
}
} else {
$data_gender['male'][$i] = 0;
}
error_log("query for male count " . $query1);
$query2 = "select max(checkup_id),emp_id from checkup_form where emp_id in (select id from patient_master where status='Active' and gender='F' order by id asc) $qry_filter $qry_date and (abnormality_ids ='" . $abnormality_id_main . "' or abnormality_ids like '%," . $abnormality_id_main . "' or abnormality_ids like '" . $abnormality_id_main . ",%' or abnormality_ids like '%," . $abnormality_id_main . ",%') group by emp_id order by emp_id ";
if (!$result2 = mysqli_query($conn, $query2)) {
error_log("error in female count query " . mysqli_error($conn));
}
$count = mysqli_num_rows($result2);
$i = 0;
if ($count > 0) {
while ($row_female = mysqli_fetch_assoc($result2)) {
$data_gender['female'][$i] = $row_female['emp_id'];
$i++;
}
} else {
$data_gender['female'][$i] = 0;
}
error_log("query for female count " . $query2);
// for patient category distribution
$query_cat = "select * from patient_category";
$result_cat = mysqli_query($conn, $query_cat);
while ($row_cat = mysqli_fetch_assoc($result_cat)) {
$pat_cat = $row_cat['patient_cat_id'];
$query3 = "select max(checkup_id),emp_id from checkup_form where emp_id in (select id from patient_master where status='Active' and patient_cat_id = '" . $pat_cat . "' order by id asc) $qry_filter $qry_date and (abnormality_ids ='" . $abnormality_id_main . "' or abnormality_ids like '%," . $abnormality_id_main . "' or abnormality_ids like '" . $abnormality_id_main . ",%' or abnormality_ids like '%," . $abnormality_id_main . ",%') group by emp_id order by emp_id ";
if (!$result3 = mysqli_query($conn, $query3)) {
error_log("error in cat wise query " . $query3);
}
error_log("query " . $query3);
$count = mysqli_num_rows($result3);
$i = 0;
if ($count > 0) {
while ($row_cat1 = mysqli_fetch_assoc($result3)) {
$data_pat_cat[$pat_cat][$i] = $row_cat1['emp_id'];
$i++;
}
} else {
$data_pat_cat[$pat_cat][$i] = 0;
}
}
$data = array();
$data = array(
'age' => $data_age,
'gender' => $data_gender,
'patient_category' => $data_pat_cat
);
error_log("data detailed " . print_r($data, true));
$default_age = array();
$k = 0;
$sql = "select * from rule_age_range";
$result = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_assoc($result)) {
$default_age[$k] = $row['rule_age_start'];
$k++;
}
$labels = array();
for ($i = 0; $i < sizeof($default_age); $i++) {
$end_age = $default_age[$i + 1];
if ($end_age == "" || $end_age == null) {
$end_age = '+';
}
$labels[$i] = $default_age[$i] . "-" . $end_age;
?>
<tr>
<td>
<?= $labels[$i] ?>
</td>
<td colspan="2">
<?php
$data_arr = $data['age'][$default_age[$i]];
error_log("length" . sizeof($data_arr));
for ($k = 0; $k < sizeof($data_arr); $k++) {
?>
<?php if ($data_arr[$k] != 0) {
echo "EMP ID- " . $data_arr[$k] . " " . getFieldFromTable('patient_name', 'patient_master', 'id', $data_arr[$k]);
} else {
echo "NO DATA";
} ?>
<br>
<?php } ?>
</td>
</tr>
<?php } ?>
<tr style="background-color:aquamarine ;">
<th align="center" colspan="3"><?= "GENDER WISE DIST FOR " . strtoupper($abnormality_name_main) ?> &nbsp; DATA
<?php if (isset($year) && $year != '') {
echo " FOR " . $year;
} else {
echo " FROM " . $start_date . " TO " . $end_date;
} ?>
</th>
</tr>
<thead>
<tr>
<td style='background-color:#00d0ff'><strong>GENDER</strong></td>
<td style='background-color:#4de5eb;color:black' colspan="2">EMPLOYEES RECORD</td>
</tr>
</thead>
<tr>
<td>MALE</td>
<?php
$gender_arr = $data['gender']['male']; ?>
<td colspan="2">
<?php
for ($k = 0; $k < sizeof($gender_arr); $k++) {
?>
<?php if ($gender_arr[$k] != 0) {
echo "EMP ID- " . $gender_arr[$k] . " " . getFieldFromTable('patient_name', 'patient_master', 'id', $gender_arr[$k]);
} else {
echo "NO DATA";
} ?>
<br>
<?php } ?>
</td>
</tr>
<tr>
<td>FEMALE</td>
<?php
$female_arr = $data['gender']['female']; ?>
<td colspan="2">
<?php
for ($k = 0; $k < sizeof($female_arr); $k++) {
?>
<?php if ($female_arr[$k] != 0) {
echo "EMP ID- " . $female_arr[$k] . " " . getFieldFromTable('patient_name', 'patient_master', 'id', $female_arr[$k]);
} else {
echo "NO DATA";
} ?>
<br>
<?php } ?>
</td>
</tr>
<tr style="background-color:aquamarine ;">
<th align="center" colspan="3"><?= "EMPLOYEE CATEGORY WISE DIST FOR " . strtoupper($abnormality_name_main) ?> &nbsp; DATA
<?php if (isset($year) && $year != '') {
echo " FOR " . $year;
} else {
echo " FROM " . $start_date . " TO " . $end_date;
} ?>
</th>
</tr>
<thead>
<tr>
<td style='background-color:#00d0ff'><strong>CATEGORY</strong></td>
<td style='background-color:#4de5eb;color:black' colspan="2">EMPLOYEES RECORD</td>
</tr>
</thead>
<?php
$sql_cat = "select * from patient_category";
$result_cat = mysqli_query($conn, $sql_cat);
while ($row_cat = mysqli_fetch_assoc($result_cat)) {
?>
<tr>
<td>
<?= getFieldFromTable('patient_cat_name', 'patient_category', 'patient_cat_id', $row_cat['patient_cat_id']) ?>
</td>
<td colspan="2">
<?php
$cat_arr = $data['patient_category'][$row_cat['patient_cat_id']];
for ($k = 0; $k < sizeof($cat_arr); $k++) { ?>
<?php if ($cat_arr[$k] != 0) {
echo "EMP ID- " . $cat_arr[$k] . " " . getFieldFromTable('patient_name', 'patient_master', 'id', $cat_arr[$k]);
} else {
echo "NO DATA";
} ?>
<br>
<?php
}
?>
</td>
</tr>
<?php
}
?>
<tr style="background-color:aquamarine ;">
<th align="center" colspan="3"><?= "ABNORMALITY DIST ACC TO AGE AND GENDER ON THE BASIS OF BMI FOR " . strtoupper($abnormality_name_main) ?> &nbsp; DATA
<?php if (isset($year) && $year != '') {
echo " FOR " . $year;
} else {
echo " FROM " . $start_date . " TO " . $end_date;
} ?>
</th>
</tr>
<thead>
<tr>
<td style='background-color:#00d0ff'><strong>CRITERIA</strong></td>
<td style='background-color:#4de5eb;color:black'>EMPLOYEES RECORD(BMI < 25)</td>
<td style='background-color:#4de5eb;color:black'>EMPLOYEES RECORD(BMI >= 25)</td>
</tr>
</thead>
<?php
$query_age_part = "";
$data_age_bmi = [];
$data_gender_bmi = [];
$data_age_bmiwise_total = [];
$data_gender_bmi_total = [];
$query_age = "select * from rule_age_range";
if (!$result_age = mysqli_query($conn, $query_age)) {
error_log("error in age range query for bmi " . $query_age . " query " . $query_age);
} else {
while ($row_age = mysqli_fetch_assoc($result_age)) {
$start_age = $row_age['rule_age_start'];
$end_age = $row_age['rule_age_end'];
if ($end_age == 0) {
$start_age = $row_age['rule_age_start'];
$query_age_part = "year(CURDATE())-year(dob)>='" . $start_age . "'";
} else {
$query_age_part = "year(CURDATE())-year(dob)>='" . $start_age . "' and year(CURDATE())-year(dob)<'" . $end_age . "'";
}
$query = "select distinct(cf.checkup_form_id) from checkup_form_key_value cf left join checkup_parameter cp on cp.`column_name` = cf.checkup_form_key
where cp.key_health_map_name=(select key_param_id from key_health_reportable_parameter_master where key_param_name='bmi')
and cf.checkup_form_value<25 and cf.checkup_form_value!='' and cf.checkup_form_id in (select new_table.id from (select max(checkup_id) as id from checkup_form where emp_id in
(select id from patient_master where status='Active' and $query_age_part order by id asc) $qry_filter $qry_date and (abnormality_ids ='" . $abnormality_id_main . "' or abnormality_ids like '%," . $abnormality_id_main . "' or abnormality_ids like '" . $abnormality_id_main . ",%' or abnormality_ids like '%," . $abnormality_id_main . ",%') group by emp_id order by emp_id) as new_table );
";
error_log("query for abnormality count bmi < 25" . $query);
if (!$result = mysqli_query($conn, $query)) {
error_log("error " . mysqli_error($conn) . " query " . $query);
} else {
$count = mysqli_num_rows($result);
$i = 0;
if ($count > 0) {
while ($row_bmi_age = mysqli_fetch_assoc($result)) {
$data_age_bmi['bmi<25'][$start_age][$i] = $row_bmi_age['checkup_form_id'];
$i++;
}
} else {
$data_age_bmi['bmi<25'][$start_age][$i] = 0;
}
}
$query2 = "select distinct(cf.checkup_form_id) from checkup_form_key_value cf left join checkup_parameter cp on cp.`column_name` = cf.checkup_form_key
where cp.key_health_map_name=(select key_param_id from key_health_reportable_parameter_master where key_param_name='bmi')
and cf.checkup_form_value>=25 and cf.checkup_form_value!='' and cf.checkup_form_id in (select new_table.id from (select max(checkup_id) as id from checkup_form where emp_id in
(select id from patient_master where status='Active' and $query_age_part order by id asc) $qry_filter $qry_date and (abnormality_ids ='" . $abnormality_id_main . "' or abnormality_ids like '%," . $abnormality_id_main . "' or abnormality_ids like '" . $abnormality_id_main . ",%' or abnormality_ids like '%," . $abnormality_id_main . ",%') group by emp_id order by emp_id) as new_table );
";
error_log("query for abnormality count bmi >= 25 " . $query2);
if (!$result_second = mysqli_query($conn, $query2)) {
error_log("error " . mysqli_error($conn) . " query2 " . $query2);
}
$count = mysqli_num_rows($result_second);
$i = 0;
if ($count > 0) {
while ($row_bmi_age_2 = mysqli_fetch_assoc($result_second)) {
$data_age_bmi['bmi>=25'][$start_age][$i] = $row_bmi_age_2['checkup_from_id'];
$i++;
}
} else {
$data_age_bmi['bmi>=25'][$start_age][$i] = 0;
}
}
}
// for gender distribution
// for bmi < 25
$query_gender = "select distinct(cf.checkup_form_id),cf.* from checkup_form_key_value cf left join checkup_parameter cp on cp.`column_name` = cf.checkup_form_key
where cp.key_health_map_name=(select key_param_id from key_health_reportable_parameter_master where key_param_name='bmi')
and cf.checkup_form_value<25 and cf.checkup_form_value!='' and cf.checkup_form_id in (select new_table.id from (select max(checkup_id) as id from checkup_form where emp_id in
(select id from patient_master where status='Active' and gender='M' order by id asc) $qry_filter $qry_date and (abnormality_ids ='" . $abnormality_id_main . "' or abnormality_ids like '%," . $abnormality_id_main . "' or abnormality_ids like '" . $abnormality_id_main . ",%' or abnormality_ids like '%," . $abnormality_id_main . ",%') group by emp_id order by emp_id) as new_table )";
if (!$result_gender = mysqli_query($conn, $query_gender)) {
error_log("error in query for male count bmi < 25 " . mysqli_error($conn));
}
$count = mysqli_num_rows($result_gender);
$i = 0;
if ($count > 0) {
while ($row_bmi_male = mysqli_fetch_assoc($result_gender)) {
$data_gender_bmi['bmi<25']['male'][$i] = $row_bmi_male['checkup_form_id'];
$i++;
}
} else {
$data_gender_bmi['bmi<25']['male'][$i] = 0;
}
error_log("query for male count bmi < 25" . $query_gender);
$query_gender_2 = "select distinct(cf.checkup_form_id),cf.* from checkup_form_key_value cf left join checkup_parameter cp on cp.`column_name` = cf.checkup_form_key
where cp.key_health_map_name=(select key_param_id from key_health_reportable_parameter_master where key_param_name='bmi')
and cf.checkup_form_value>=25 and cf.checkup_form_value!='' and cf.checkup_form_id in (select new_table.id from (select max(checkup_id) as id from checkup_form where emp_id in
(select id from patient_master where status='Active' and gender='M' order by id asc) $qry_filter $qry_date and (abnormality_ids ='" . $abnormality_id_main . "' or abnormality_ids like '%," . $abnormality_id_main . "' or abnormality_ids like '" . $abnormality_id_main . ",%' or abnormality_ids like '%," . $abnormality_id_main . ",%') group by emp_id order by emp_id) as new_table )";
if (!$result_gender_2 = mysqli_query($conn, $query_gender_2)) {
error_log("error in query for male count bmi >= 25 " . mysqli_error($conn));
}
$count = mysqli_num_rows($result_gender_2);
$i = 0;
if ($count > 0) {
while ($row_bmi_male_2 = mysqli_fetch_assoc($result_gender_2)) {
$data_gender_bmi['bmi>=25']['male'][$i] = $row_bmi_male_2['checkup_form_id'];
$i++;
}
} else {
$data_gender_bmi['bmi>=25']['male'][$i] = 0;
}
$query_gender_female = "select distinct(cf.checkup_form_id),cf.* from checkup_form_key_value cf left join checkup_parameter cp on cp.`column_name` = cf.checkup_form_key
where cp.key_health_map_name=(select key_param_id from key_health_reportable_parameter_master where key_param_name='bmi')
and cf.checkup_form_value<25 and cf.checkup_form_value!='' and cf.checkup_form_id in (select new_table.id from (select max(checkup_id) as id from checkup_form where emp_id in
(select id from patient_master where status='Active' and gender='F' order by id asc) $qry_filter $qry_date and (abnormality_ids ='" . $abnormality_id_main . "' or abnormality_ids like '%," . $abnormality_id_main . "' or abnormality_ids like '" . $abnormality_id_main . ",%' or abnormality_ids like '%," . $abnormality_id_main . ",%') group by emp_id order by emp_id) as new_table )";
if (!$result_gender_female = mysqli_query($conn, $query_gender_female)) {
error_log("error in female count query bmi < 25 " . mysqli_error($conn));
}
$count = mysqli_num_rows($result_gender_female);
$i = 0;
if ($count > 0) {
while ($row_bmi_female = mysqli_fetch_assoc($result_gender_female)) {
$data_gender_bmi['bmi<25']['female'][$i] = $row_bmi_female['checkup_form_id'];
$i++;
}
} else {
$data_gender_bmi['bmi<25']['female'][$i] = 0;
}
error_log("query for female count bmi < 25" . $query2);
$query_gender_female_2 = "select distinct(cf.checkup_form_id),cf.* from checkup_form_key_value cf left join checkup_parameter cp on cp.`column_name` = cf.checkup_form_key
where cp.key_health_map_name=(select key_param_id from key_health_reportable_parameter_master where key_param_name='bmi')
and cf.checkup_form_value>=25 and cf.checkup_form_value!='' and cf.checkup_form_id in (select new_table.id from (select max(checkup_id) as id from checkup_form where emp_id in
(select id from patient_master where status='Active' and gender='F' order by id asc) $qry_filter $qry_date and (abnormality_ids ='" . $abnormality_id_main . "' or abnormality_ids like '%," . $abnormality_id_main . "' or abnormality_ids like '" . $abnormality_id_main . ",%' or abnormality_ids like '%," . $abnormality_id_main . ",%') group by emp_id order by emp_id) as new_table )";
if (!$result_gender_female_2 = mysqli_query($conn, $query_gender_female_2)) {
error_log("error in female count query bmi >= 25 " . mysqli_error($conn));
}
$count = mysqli_num_rows($result_gender_female_2);
$i = 0;
if ($count > 0) {
while ($row_bmi_female_2 = mysqli_fetch_assoc($result_gender_female_2)) {
$data_gender_bmi['bmi>=25']['female'][$i] = $row_bmi_female_2['checkup_form_id'];
$i++;
}
} else {
$data_gender_bmi['bmi>=25']['female'][$i] = 0;
}
error_log("query for female count bmi >= 25" . $query2);
$data = array();
$data = array(
'age' => $data_age_bmi,
'gender' => $data_gender_bmi
);
error_log("final graph data " . print_r($data, true));
$labels = array();
for ($i = 0; $i < sizeof($default_age); $i++) {
$end_age = $default_age[$i + 1];
if ($end_age == "" || $end_age == null) {
$end_age = '+';
}
$labels[$i] = $default_age[$i] . "-" . $end_age;
$gender_less_male = $data['gender']['bmi<25']['male'];
$gender_greater_male = $data['gender']['bmi>=25']['male'];
$gender_less_female = $data['gender']['bmi<25']['female'];
$gender_greater_female = $data['gender']['bmi>=25']['female'];
$age_data_arr = $data['age']['bmi<25'][$default_age[$i]];
$age_data_arr_less = $data['age']['bmi>=25'][$default_age[$i]];
?>
<tr>
<td>
<?= $labels[$i] ?>
</td>
<td>
<?php
for ($j = 0; $j < sizeof($age_data_arr); $j++) { ?>
<?php if ($age_data_arr[$j] != 0) {
$emp_id = getFieldFromTable('emp_id', 'checkup_form', 'checkup_id', $age_data_arr[$j]);
error_log("emp id" . $emp_id);
echo "EMP ID- " . $emp_id . " " . getFieldFromTable('patient_name', 'patient_master', 'id', $emp_id);
} else {
echo "NO DATA";
} ?>
<br>
<?php
}
?>
</td>
<td>
<?php
for ($j = 0; $j < sizeof($age_data_arr_less); $j++) { ?>
<?php if ($age_data_arr_less[$j] != 0) {
$emp_id = getFieldFromTable('emp_id', 'checkup_form', 'checkup_id', $age_data_arr_less[$j]);
error_log("emp id" . $emp_id);
echo "EMP ID- " . $emp_id . " " . getFieldFromTable('patient_name', 'patient_master', 'id', $emp_id);
} else {
echo "NO DATA";
} ?>
<br>
<?php
}
?>
</td>
</tr>
<?php
}
?>
<tr>
<td>MALE</td>
<td>
<?php
error_log("gender_less_male ", print_r($gender_less_male, true));
for ($j = 0; $j < sizeof($gender_less_male); $j++) { ?>
<?php if ($gender_less_male[$j] != 0) {
$emp_id = getFieldFromTable('emp_id', 'checkup_form', 'checkup_id', $gender_less_male[$j]);
error_log("emp id" . $emp_id);
echo "EMP ID- " . $emp_id . " " . getFieldFromTable('patient_name', 'patient_master', 'id', $emp_id);
} else {
echo "NO DATA";
} ?>
<br>
<?php
}
?>
</td>
<td>
<?php
error_log("gender_greater_male ", print_r($gender_greater_male, true));
for ($j = 0; $j < sizeof($gender_greater_male); $j++) { ?>
<?php if ($gender_greater_male[$j] != 0) {
$emp_id = getFieldFromTable('emp_id', 'checkup_form', 'checkup_id', $gender_greater_male[$j]);
error_log("emp id" . $emp_id);
echo "EMP ID- " . $emp_id . " " . getFieldFromTable('patient_name', 'patient_master', 'id', $emp_id);
} else {
echo "NO DATA";
} ?>
<br>
<?php
}
?>
</td>
</tr>
<tr>
<td>FEMALE</td>
<td>
<?php
error_log("gender_less_female ", print_r($gender_less_female, true));
for ($j = 0; $j < sizeof($gender_less_female); $j++) { ?>
<?php if ($gender_less_female[$j] != 0) {
$emp_id = getFieldFromTable('emp_id', 'checkup_form', 'checkup_id', $gender_less_female[$j]);
error_log("emp id" . $emp_id);
echo "EMP ID- " . $emp_id . " " . getFieldFromTable('patient_name', 'patient_master', 'id', $emp_id);
} else {
echo "NO DATA";
} ?>
<br>
<?php
}
?>
</td>
<td>
<?php
error_log("gender_greater_female ", print_r($gender_greater_female, true));
for ($j = 0; $j < sizeof($gender_greater_female); $j++) { ?>
<?php if ($gender_greater_female[$j] != 0) {
$emp_id = getFieldFromTable('emp_id', 'checkup_form', 'checkup_id', $gender_greater_female[$j]);
error_log("emp id" . $emp_id);
echo "EMP ID- " . $emp_id . " " . getFieldFromTable('patient_name', 'patient_master', 'id', $emp_id);
} else {
echo "NO DATA";
} ?>
<br>
<?php
}
?>
</td>
</tr>
</table>
</body>