Skip to content

Instantly share code, notes, and snippets.

@jcricaro
Created May 16, 2016 23:14
Show Gist options
  • Save jcricaro/8dff8d8ad56cd3041317d1ec682d6b28 to your computer and use it in GitHub Desktop.
Save jcricaro/8dff8d8ad56cd3041317d1ec682d6b28 to your computer and use it in GitHub Desktop.
if($provincial) {
//provincial
if($weight <= 1) {
return 120;
} elseif($weight <= 2) {
return 160;
} else {
return 160 + (ceil($weight - 2) * 60);
}
} else {
if($cod) {
//metro manila cod
if($weight <= 1) {
return 100;
} elseif($weight <= 3) {
return 130;
} else {
return 130 + (ceil($weight - 3) * 50);
}
} else {
//metro manila non cod
if($weight <= 1) {
return 65;
} elseif($weight <= 3) {
return 120;
} else {
return 120 + (ceil($weight - 3) * 30);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment