$period_start, 'start_time'=>$start, 'date'=>$start, 'end'=>$period_end, 'end_time'=>$period_end, 'weekday'=>$weekday, 'prorata'=>round($remain_time/$total_time,4), 'total_time'=>sprintf('%3.1f',$total_time/86400), 'remain_time'=>sprintf('%3.1f',$remain_time/86400), 'used_time'=>sprintf('%3.1f',$used_time/86400), ); if ($df) foreach (array('start','date','end') as $key) $result[$key] = Site::Date($result[$key]); return $result; } /** * Return if a date is in the same month as another date */ public static function inMonth($date,$period=NULL) { if (is_null($period)) $period = time(); return ($date >= strtotime('first day of',$period) AND $date <= strtotime('last day of',$period)); } public static function multiple($rs) { switch($rs) { case 0: $multiple=52; break; case 1: $multiple=12; break; case 2: $multiple=4; break; case 3: $multiple=2; break; case 4: $multiple=1; break; case 5: $multiple=0.5; break; case 6: $multiple=0.33; break; } return $multiple; } } ?>