- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
function retPercByAct($num,$economy) { //50% discount => economy=0 => 15%
$t='15/5 0-49,
16/6 50-100,
17/7 101-200,
18/8 201-350,
19/9 351-500,
20/10 601-1000,
21/11 1001-500000,';
$t=explode(',',$t);
foreach($t as $k=>$v) {
$v=trim($v);
list($perc,$nums)=explode(' ',$v);
$nums=explode('-',$nums);
if($nums[0]<=$num && $nums[1]>=$num) {
$perc=explode('/',$perc);
if(!$economy) $percR=$perc[0]; else $percR=$perc[1];
break;
}
}
return $percR;
}