<?php
header("content-type:text/html;charset=utf-8");

function divisionAgeAllowance($Year,$Month){
    $time = time();
    date_default_timezone_set('PRC');
    $dateYear =date('Y年',$time);
    $year = (int)$dateYear;
    $dateMonth =date('m月',$time);
    $month = (int)$dateMonth;
    if($year-$Year==1&&($month<$Month))
    {
        echo '这个人的司龄补助为0元';
    }
    
    else if($year-$Year&&($month>=$Month)){
        $divisionAge=$year-$Year;
        if($divisionAge>=12)
        {
            echo '这个人的司龄补助为 600元';
        }
        else
        {
            $money=0;
            for($i=0,$money;$i<$divisionAge;$i++){ 
                $money=$money+50;
            }
            echo $money;
            
        }
    }
    
    else if($year-$Year&&($month<$Month)){
        $divisionAge=$year-$Year;
        if($divisionAge>12)
        {
            echo '这个人的司龄补助为 600元';
        }
        else
        {
            $money=0;
            for($i=1,$money;$i<$divisionAge;$i++){
                $money=$money+50;
            }
            echo $money;
    
        }
    }
    else 
        echo '这个人的司龄补助为0元';
}
divisionAgeAllowance(2012,1);
?>