}
}
$esn = new query3();
$begin = trim($_REQUEST['begin']);
$end = trim($_REQUEST['end']);
$b_conv = $esn->date_eng_format($begin);
$e_conv = $esn->date_eng_format($end);
#$hn=trim($_REQUEST["hn"]); //ของเดิม
$hn = trim($_REQUEST["HN"]);
//echo "<br>";
$fname = "GiveInformation1";
$result_give_yes[] = array();
if (strlen($hn) == 6) {
    $z = 1;
    while ($z <= 5) {
        $fname = "GiveInformation" . $z;
        //AND  `MonitoringDate`   BETWEEN  ' $b_conv'  AND '$e_conv'  ";
        $wr = " AND  `MonitoringDate`   BETWEEN  ' {$b_conv}'  AND '{$e_conv}'  ";
        $strQue_ = $esn->query_tb($hn, $fname, $wr);
        //echo "<br>";
        $que = mysql_query($strQue_) or die('Can \'t  connect  MYSQL SERVER !!! ');
        $result_give_yes[$z] = mysql_num_rows($que);
        //echo "<br>";
        $z++;
    }
}
$arr_give = array('- What \'s your disease?', '- What \'s treatment?', '- How to manage the side effect?', '- Bring medication to each visit?', '- How to correct be havior?', '- Ohter');
#http://esn.com/report_pdf/appendix_report/query_case3_hn.php?begin=03-11-2542&end=07-11-2557&HN=AA0096
#http://www.esn.com/report_pdf/appendix_report/query_case3_hn.php?begin=03-11-2542&end=07-11-2557&HN=AA0096
include "report_case3_hn.php";
//ปรับปรุง
        return $this->str_ = "    SELECT  \n                                             DISTINCT ( HN )\n                                           FROM   " . $fname;
    }
}
$esn = new query3();
$result_give_yes[] = array();
$begin = trim($_REQUEST['begin']);
$end = trim($_REQUEST['end']);
$b_conv = $esn->date_eng_format($begin);
$e_conv = $esn->date_eng_format($end);
$tb = "`06_giveinformation`";
$field_name = "GiveInformation1";
$fname = $tb . "   WHERE   `MonitoringDate`   BETWEEN  ' {$b_conv}'  AND '{$e_conv}'  AND  ";
#  WHERE   `MonitoringDate`   BETWEEN  ' $b_conv'  AND '$e_conv'
// echo  $esn->query_tb($fname);
$z = 1;
while ($z <= 5) {
    $fname_ = "   GiveInformation" . $z . " ='Y'  ;";
    #echo  $strQue_= $esn->query_tb($hn,$fname);
    $strQue_ = $esn->query_tb($fname . $fname_);
    $que = mysql_query($strQue_) or die('Can \'t  connect  MYSQL SERVER !!! ');
    $result_give_yes[$z] = mysql_num_rows($que);
    $z++;
    // echo "<br>";
}
$arr_give = array('- What \'s your disease?', '- What \'s treatment?', '- How to manage the side effect?', '- Bring medication to each visit?', '- How to correct be havior?', '- Ohter');
#http://esn.com/report_pdf/appendix_report/query_case3_distinct_hn.php?begin=03-11-2542&end=07-11-2557
include "report_case3_hn.php";
//ปรับปรุง
?>