#
Insanity. How can you code like this?
this doesn’t even make any sense.
so, let’s check if $fullweight is below 300. right. now lets check if $fullweight is between 700 & 750. my god.
if ($fullweight <= 300) { // if less than 300 grams
if ($fullweight <= 100) { $delcost = 1.49; }
// OMG WHY ON EARTH IS THIS CHECKING IF IT IS LESS!??!?!?!?!?!
if (($fullweight > 60) && ($fullweight <= 100)) { $delcost = 0.34; }
if (($fullweight > 100) && ($fullweight <= 150)) { $delcost = 0.46; }
if (($fullweight > 150) && ($fullweight <= 200)) { $delcost = 0.56; }
if (($fullweight > 200) && ($fullweight <= 250)) { $delcost = 0.69; }
if (($fullweight > 250) && ($fullweight <= 300)) { $delcost = 0.80; }
if (($fullweight > 300) && ($fullweight <= 350)) { $delcost = 0.91; }
if (($fullweight > 350) && ($fullweight <= 400)) { $delcost = 1.10; }
if (($fullweight > 400) && ($fullweight <= 450)) { $delcost = 1.25; }
if (($fullweight > 450) && ($fullweight <= 500)) { $delcost = 1.42; }
if (($fullweight > 500) && ($fullweight <= 600)) { $delcost = 1.68; }
if (($fullweight > 600) && ($fullweight <= 700)) { $delcost = 1.98; }
if (($fullweight > 700) && ($fullweight <= 750)) { $delcost = 2.04; }
} else {
if ($fullweight <= 1000) {
if (($fullweight > 750) && ($fullweight <= 800)) { $delcost = 3.06; }
if (($fullweight > 800) && ($fullweight <= 900)) { $delcost = 3.36; }
if (($fullweight > 900) && ($fullweight <= 1000)) { $delcost = 3.67; }
} else {
$startcost = 3.67;
$remainder = ($fullweight-1000);
$tmp = ($remainder%250);
$divisable = ($remainder/250);
$above_onethousand_cost = ($divisable*0.89);
$delcost = ($startcost+$above_onethousand_cost);
}
}
This was posted 1 year ago. It has 0 notes.