$strSQL10 = "select o.hn,o.vn,p.pname,p.fname,p.lname,v.age_y,concat(d.vn in(o.vn) and d.icode LIKE '1%')as drug,concat(i.vn in(v.vn))as appointment,concat(s.vn in(o.vn))as surveil,o.vstdate from ovst o";
$strSQL10 .= " left outer join vn_stat v on v.vn=o.vn ";
$strSQL10 .= " left outer join opitemrece d on d.vn =o.vn ";
$strSQL10 .= " left outer join patient p on p.hn=o.hn ";
$strSQL10 .= " left outer join oapp i on i.vn=v.vn";
$strSQL10 .= " left outer join surveil_member s on s.vn=v.vn";
$strSQL10 .= " Where 1 AND o.vstdate='".$_POST["date"]."' ";
if( $_REQUEST["Search"]!= '')
{
$strSQL10 .= " AND (o.hn LIKE '%".$_REQUEST["Search"]."%' ) ";
}