| // Contract => 24 | // Contract => 24 | ||||
| if ($countD24 != 0) { | if ($countD24 != 0) { | ||||
| if (strpos($c->ranges, '>') !== false) { | if (strpos($c->ranges, '>') !== false) { | ||||
| info('if yang pertama ' . $c->ranges); | |||||
| $pieces = explode(">", $c->ranges); | $pieces = explode(">", $c->ranges); | ||||
| $comm24 = '+ ' . $c->comm; | $comm24 = '+ ' . $c->comm; | ||||
| $commV24 = ''; | $commV24 = ''; | ||||
| $addRM24 = $c->comm; | $addRM24 = $c->comm; | ||||
| info($commV24 . ' first if ' . $addRM24); | |||||
| } else { | } else { | ||||
| $comms = explode("RM", $c->comm); | $comms = explode("RM", $c->comm); | ||||
| if (!empty($comms[1])) { | if (!empty($comms[1])) { | ||||
| } | } | ||||
| } | } | ||||
| if (strpos($c->ranges, '-') !== false) { | if (strpos($c->ranges, '-') !== false) { | ||||
| info('if yang kedua ' .$c->ranges); | |||||
| $pieces = explode("-", $c->ranges); | $pieces = explode("-", $c->ranges); | ||||
| if ($countD24 >= intval($pieces[0]) && $countD24 <= intval($pieces[1])) { | if ($countD24 >= intval($pieces[0]) && $countD24 <= intval($pieces[1])) { | ||||
| $commV24 = floatval($c->comm) / 100; | |||||
| $comm24 = $c->comm . '%'; | |||||
| if (strpos($c->comm, 'RM') !== false) { | |||||
| $comm24 = '+ ' . $c->comm; | |||||
| $commV24 = ''; | |||||
| $addRM24 = $c->comm; | |||||
| info($commV24 . ' first if ' . $addRM24); | |||||
| } else { | |||||
| $comms = explode("RM", $c->comm); | |||||
| if (!empty($comms[1])) { | |||||
| $comm24 = 'RM ' . $comms[1]; | |||||
| $commV24 = floatval($comms[1]); | |||||
| } else { | |||||
| if ($comms[0] != '') { | |||||
| $comm24 = $comms[0] . '%'; | |||||
| $commV24 = floatval($comms[0]) / 100; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } |