}
    function count_sum($str_edu1, $connect)
    {
        $q_edu1 = mysql_query($str_edu1, $connect) or die(mysql_error());
        return mysql_num_rows($q_edu1);
    }
    function cal_percen($total, $total_all)
    {
        return round($total / $total_all * 100, 2);
    }
}
//end class
##------------------------------------------------
http:
//127.0.0.1/report_pdf/appendix_report/query_report_esn_merge.php?begin=01-10-2450&end=24-10-2550
$esn = new esncall();
$begin = trim($_GET['begin']);
//echo "<br>";
$end = trim($_GET['end']);
//echo "<br>";
##--YEAR current
$y_cur = date('Y');
//ปีัปัจจุบัน
//echo "<br>";
//echo "<br>";
//echo $y_cur;
$y_e = $esn->explode_date($end);
//echo "<br>";
#-- convert DATE ---
$b_conv = $esn->date_eng_format($begin);
//echo "<br>";
            $br = $row->birthdate;
            $ex = explode('-', $br);
            if (!empty($ex[0])) {
                $this->total_age += $this->cur_yr - $ex[0];
                $this->total++;
            }
        }
        //echo  $this->total_age;
        //echo "<br>";
        //echo $this->total;
        return round($this->total_age / $this->total, 2);
    }
}
//end class
//http://127.0.0.1/report_pdf/appendix_report/query_report_esn_merge.php?begin=01-10-2450&end=24-10-2550
$esn = new esncall();
$begin = trim($_GET['begin']);
//echo "<br>";
$end = trim($_GET['end']);
//echo "<br>";
##--YEAR current
$y_cur = date('Y');
//ปีัปัจจุบัน
//echo "<br>";
//echo "<br>";
//echo $y_cur;
$y_e = $esn->explode_date($end);
//echo "<br>";
#-- convert DATE ---
$b_conv = $esn->date_eng_format($begin);
//echo "<br>";