hallo zusammen,
ist es möglich folgender code kürzer, eleganter zuschreiben?
ist es möglich folgender code kürzer, eleganter zuschreiben?
PHP-Code:
if ($row_modell['idlieferung'] == "HT03") {
if ($row_modell['gewicht'] < 150) { $ht_netto = 89; }
elseif ($row_modell['gewicht'] >= 150 && $row_modell['gewicht'] < 250) { $ht_netto = 129; }
elseif ($row_modell['gewicht'] >= 250 && $row_modell['gewicht'] < 400) { $ht_netto = 156; }
elseif ($row_modell['gewicht'] >= 400 && $row_modell['gewicht'] < 600) { $ht_netto = 242; }
elseif ($row_modell['gewicht'] >= 600 && $row_modell['gewicht'] < 800) { $ht_netto = 318; }
elseif ($row_modell['gewicht'] >= 800 && $row_modell['gewicht'] < 1000) { $ht_netto = 371; }
elseif ($row_modell['gewicht'] >= 1000 && $row_modell['gewicht'] < 1200) { $ht_netto = 425; }
elseif ($row_modell['gewicht'] >= 1200 && $row_modell['gewicht'] < 1450) { $ht_netto = 500; }
elseif ($row_modell['gewicht'] >= 1450 && $row_modell['gewicht'] < 1650) { $ht_netto = 608; }
elseif ($row_modell['gewicht'] >= 1650 && $row_modell['gewicht'] < 1800) { $ht_netto = 662; }
elseif ($row_modell['gewicht'] >= 1800 && $row_modell['gewicht'] < 2000) { $ht_netto = 710; }
elseif ($row_modell['gewicht'] >= 2000 && $row_modell['gewicht'] < 2500) { $ht_netto = 877; }
elseif ($row_modell['gewicht'] >= 2500 && $row_modell['gewicht'] < 3000) { $ht_netto = 1038; }
elseif ($row_modell['gewicht'] >= 3000) { $ht_netto = "Preis auf Anfrage"; }
}
Kommentar