diff --git a/wawi/bestellung.php b/wawi/bestellung.php index 41f57f8d1..c2df226f5 100644 --- a/wawi/bestellung.php +++ b/wawi/bestellung.php @@ -425,8 +425,9 @@ if($aktion == 'suche') else echo '\n"; } - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo " Firma: \n"; @@ -437,7 +438,7 @@ if($aktion == 'suche') { echo "\n"; } - echo "\n"; + echo "\n"; echo "\n"; echo " \n"; @@ -452,8 +453,9 @@ if($aktion == 'suche') echo '\n"; } - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo " Änderung durch: \n"; @@ -1152,7 +1154,7 @@ if($aktion == 'suche') if($restBudget < 0) $alert = 'Ihr aktuelles Budget ist bereits überzogen.'; echo "

Bearbeiten

$alert

"; - echo "
\n"; + echo "\n"; echo "

Bestellnummer: ".$bestellung->bestell_nr.""; echo '

'; @@ -1697,10 +1699,48 @@ if($aktion == 'suche') $(document).ready(function(){ $(".up,.down").click(function(){ var row = $(this).parents("tr:first"); - if ($(this).is(".up")) { - row.insertBefore(row.prev()); - } else { - row.insertAfter(row.next()); + + id = row[0].id.substring("row_".length); + + sort = document.getElementById("sort_"+id); + + if ($(this).is(".up")) + { + // wenn ganz oben nicht mehr weiter rauf schieben + if(parseInt(sort.value)>1) + { + prev = row.prev(); + id2 = prev[0].id.substring("row_".length); + sort2 = document.getElementById("sort_"+id2); + if(isNaN(parseInt(sort.value)) || sort.value=="") + sort.value=anzahlRows; + if(isNaN(parseInt(sort2.value)) || sort2.value=="") + sort2.value=anzahlRows; + // sort mit dem darüberliegenden vertauschen und zeile tauschen + help = sort.value; + sort.value=sort2.value; + sort2.value=help; + row.insertBefore(row.prev()); + } + } + else + { + // wenn ganz unten, nicht mehr weiter nach unten schieben + if(parseInt(sort.value)<=anzahlRows) + { + next = row.next(); + id2 = next[0].id.substring("row_".length); + sort2 = document.getElementById("sort_"+id2); + if(isNaN(parseInt(sort.value)) || sort.value=="") + sort.valuea=nzahlRows; + if(isNaN(parseInt(sort2.value)) || sort2.value=="") + sort2.value=anzahlRows; + // sort mit dem darunterliegenden vertauschen und zeile tauschen + help = sort.value; + sort.value=sort2.value; + sort2.value=help; + row.insertAfter(row.next()); + } } }); }); @@ -1863,7 +1903,7 @@ if($aktion == 'suche') "; - echo ""; + echo ""; echo "\n"; } \ No newline at end of file