class hitungTelat{
function berhitung($checkout){
$today = date("Y-m-d");
$m = date("m", strtotime($today));
$d = date("d", strtotime($today));
$y = date("Y", strtotime($today));
$m2 = date('m', strtotime($checkout));
$d2 = date('d', strtotime($checkout));
$y2 = date('Y', strtotime($checkout));
$a=GregorianToJD($m, $d, $y); //today
$b=GregorianToJD($m2, $d2, $y2); //checkout date
$telat = $a - $b;
if($telat<=0)
$telat=0;
return $telat;
}
}
//$tel = new hitungTelat();
//echo $tel->berhitung("2012-07-23"); //kalau today=2012-07-25 maka hasilnya = 2
Mantap gan, lengkap,
ReplyDeleteLebih lengkap disini gan KLIK