require_once("conf_func.php"); $orderby=trim($_REQUEST['orderby']); $ord=trim($_REQUEST['ord'])=="" ? "desc" : trim($_REQUEST['ord']); //-----------Search Value-----------// $ac_code=trim($_REQUEST['ac_code']); $ac_name=trim($_REQUEST['ac_name']); $item_name=trim($_REQUEST['item_name']); if(trim($_REQUEST['st_mm'])=="" and trim($_REQUEST['st_yy'])!=""){ $job_start=trim($_REQUEST['st_yy'])."0101"; $st_yy=trim($_REQUEST['st_yy']); $st_mm='01'; }else if(trim($_REQUEST['st_mm'])!="" and trim($_REQUEST['st_yy'])!=""){ $job_start=trim($_REQUEST['st_yy']).str_pad(trim($_REQUEST['st_mm']),2,"0",STR_PAD_LEFT)."01"; $st_yy=trim($_REQUEST['st_yy']); $st_mm=trim($_REQUEST['st_mm']); }else{ $job_start=""; $st_yy=''; $st_mm=''; } if(trim($_REQUEST['ed_mm'])!="" and trim($_REQUEST['ed_yy'])!=""){ $endyear=cal_days_in_month(CAL_GREGORIAN, (int)trim($_REQUEST['ed_mm']), (int)trim($_REQUEST['ed_yy']) ); $job_end=trim($_REQUEST['ed_yy']).str_pad(trim($_REQUEST['ed_mm']),2,"0",STR_PAD_LEFT).$endyear; $ed_yy=trim($_REQUEST['ed_yy']); $ed_mm=trim($_REQUEST['ed_mm']); }else if(trim($_REQUEST['ed_mm'])=="" and trim($_REQUEST['ed_yy'])!=""){ $job_end=trim($_REQUEST['ed_yy'])."1231"; $ed_yy=trim($_REQUEST['ed_yy']); $ed_mm='12'; }else{ $job_end=""; $ed_yy=date("Y"); $ed_mm='12'; } $wheis=""; if(strlen($ac_code)>=10){ $wheis.=" AND ac_code LIKE '%".mysql_real_escape_string(str_replace(" ","%",$ac_code))."%' "; } if($ac_name!=""){ $wheis.=" AND ac_name LIKE '%".mysql_real_escape_string(str_replace(" ","%",$ac_name))."%' "; } if($item_name!=""){ $wheis.=" AND item_name LIKE '%".mysql_real_escape_string(str_replace(" ","%",$item_name))."%' "; } if(strlen($job_start)==8 and strlen($job_end)==8){ $wheis.=" AND pay_date BETWEEN '".mysql_real_escape_string($job_start)."' AND '".mysql_real_escape_string($job_end)."' "; }else if(strlen($job_start)==0 and strlen($job_end)==8){ $wheis.=" AND pay_date<= ".$job_end ; }else if(strlen($job_start)==8 and strlen($job_end)==0){ $wheis.=" AND pay_date >= ".$job_start ; }else{ //$wheis.=" AND pay_date LIKE '".date("Y")."%' "; } if(session_is_registered("u_name") and session_is_registered("u_mail") and session_is_registered("u_code") and session_is_registered("privilege_mn") and $_SESSION['privilege_mn']<5 ){ $linkto="pay_report.php?ac_code=".$ac_code."&ac_name=".$ac_name."&item_name=".$item_name."&st_yy=".$st_yy."&st_mm=".$st_mm."&ed_mm=".$ed_mm."&ed_yy=".$ed_yy ; }else{ if($ac_code!="" and strlen($ac_code)>=10 and is_numeric($ac_code) ){ $wheis.=" AND ac_code LIKE '%".mysql_real_escape_string(str_replace(" ","%",$ac_code))."%' "; } $linkto="pay_report.php?ac_code=".$ac_code ; } ?>
![]() |
![]() |
|
include("menu_navi.php"); ?>
![]() ![]()
ค้นหาข้อมูล รายงาน ค่าใช้จ่าย
if(session_is_registered("u_name") and session_is_registered("u_mail") and session_is_registered("u_code") and session_is_registered("privilege_mn") and $_SESSION['privilege_mn']<5 ){
?>
} // end if(session_is_registered("u_name") and session_is_registered("u_mail") and session_is_registered("u_code") and session_is_registered("privilege_mn") and $_SESSION['privilege_mn']<5 ){
else {
?>
if($wheis!=""){; ?> |