function duedates($programStartDate, $month, $request) {
if ($request == "accelarate")
{
$weakcycle = '2';
}
else if ($request == "deaccelerate")
{
$weakcycle = '4';
}
else
{
$weakcycle = '4';
}
$db = new databasemanager();
$unixtime = strtotime($programStartDate);
switch($month)
{
case'2':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
break;
case'3':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
break;
case'4':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
break;
case '5':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
break;
case '6':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
break;
case '7':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
$date[] = calculateenddate(6,$weakcycle,7,$unixtime);
break;
case '8':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
$date[] = calculateenddate(6,$weakcycle,7,$unixtime);
$date[] = calculateenddate(7,$weakcycle,7,$unixtime);
break;
case '9':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
$date[] = calculateenddate(6,$weakcycle,7,$unixtime);
$date[] = calculateenddate(7,$weakcycle,7,$unixtime);
$date[] = calculateenddate(8,$weakcycle,7,$unixtime);
break;
case '10':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
$date[] = calculateenddate(6,$weakcycle,7,$unixtime);
$date[] = calculateenddate(7,$weakcycle,7,$unixtime);
$date[] = calculateenddate(8,$weakcycle,7,$unixtime);
$date[] = calculateenddate(9,$weakcycle,7,$unixtime);
break;
case '11':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
$date[] = calculateenddate(6,$weakcycle,7,$unixtime);
$date[] = calculateenddate(7,$weakcycle,7,$unixtime);
$date[] = calculateenddate(8,$weakcycle,7,$unixtime);
$date[] = calculateenddate(9,$weakcycle,7,$unixtime);
$date[] = calculateenddate(10,$weakcycle,7,$unixtime);
break;
case '12':
$date[] = calculateenddate(1,$weakcycle,7,$unixtime);
$date[] = calculateenddate(2,$weakcycle,7,$unixtime);
$date[] = calculateenddate(3,$weakcycle,7,$unixtime);
$date[] = calculateenddate(4,$weakcycle,7,$unixtime);
$date[] = calculateenddate(5,$weakcycle,7,$unixtime);
$date[] = calculateenddate(6,$weakcycle,7,$unixtime);
$date[] = calculateenddate(7,$weakcycle,7,$unixtime);
$date[] = calculateenddate(8,$weakcycle,7,$unixtime);
$date[] = calculateenddate(9,$weakcycle,7,$unixtime);
$date[] = calculateenddate(10,$weakcycle,7,$unixtime);
$date[] = calculateenddate(11,$weakcycle,7,$unixtime);
break;
}
return $date;
}
Saturday, April 16, 2011
What is a loop?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment