query("SELECT * FROM touren WHERE typ=7"); while($row = $tmp->fetch_assoc()) { if($row['utyp']==1) { $GLOBALS['mysql']->insert("UPDATE tourenliste SET Norm='".$_POST['rsnorm1']."',logid='".time()."' WHERE tour='".$row['id']."' and kw='".$kw."' and jahr='".$jahr."'"); } if($row['utyp']==2) { $GLOBALS['mysql']->insert("UPDATE tourenliste SET Norm='".$_POST['rsnorm2']."',logid='".time()."' WHERE tour='".$row['id']."' and kw='".$kw."' and jahr='".$jahr."'"); } if($row['utyp']==3) { $GLOBALS['mysql']->insert("UPDATE tourenliste SET Norm='".$_POST['rsnorm3']."',logid='".time()."' WHERE tour='".$row['id']."' and kw='".$kw."' and jahr='".$jahr."'"); } if($row['utyp']==4) { $GLOBALS['mysql']->insert("UPDATE tourenliste SET Norm='".$_POST['rsnorm4']."',logid='".time()."' WHERE tour='".$row['id']."' and kw='".$kw."' and jahr='".$jahr."'"); } } $success[]='Der Rundschau-Normplan wurde geändert.'; $template->assign('success', $success); } //-------------------------------------------------------------------------------------- //---------------- Abnahme-Tour löschen elseif(isset($_POST['delete2'])) { // If Tour >7000 $GLOBALS['mysql']->query("DELETE FROM tourenliste WHERE id='".$_POST['delete2']."'"); } //---------------- tour speichern //---------------- neue Tour Hinzufügen elseif(isset($_POST['dazu'])) { $ptourid=$_POST['plus']; $ptourid=$ptourid-6300; $row_tourp = $GLOBALS['mysql']->query_single("SELECT * FROM tourenliste WHERE tour='".$ptourid."' and kw='".$kw."' AND jahr='".$jahr."'"); echo $ptourid; // echo "
"; print_r($row_tourp); echo ""; // $row_tourpi = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$ptourid."'"); $row_tourpp = $GLOBALS['mysql']->query_single("SELECT * FROM touren WHERE id='".$_POST['plus']."'"); $ppakete=$row_tourp['exemplare']/$row_tourp['Norm']; $ppakete=$ppakete/2; $ppakete2=ceil($ppakete); $GLOBALS['mysql']->insert("INSERT INTO tourenliste (tour,gewicht2,gewicht4,zeit,rampe,exemplare,pakete2,gewicht,kw,tag,monat,jahr,typ,utyp,infotext,Norm,Pakete) VALUES( '".$_POST['plus']."', '1', '1', '".$row_tourp['zeit']."', '".$row_tourp['rampe']."', '1', '".$ppakete."', '1', '".$row_tourp['kw']."', '".$row_tourp['tag']."', '".$row_tourp['monat']."', '".$row_tourp['jahr']."', '".$row_tourp['typ']."', '".$row_tourp['utyp']."', '".$row_tourpp['infotitel']."', '".$row_tourp['Norm']."', '".$row_tourp['Pakete']."') "); } //---------------------- Erscheinungstag speichern elseif(isset($_POST['datesave'])) { $tmp = $GLOBALS['mysql']->query("SELECT * FROM touren WHERE typ=7"); while($row = $tmp->fetch_assoc()) { if($row['utyp']==1) { $teilen = explode(".",$_POST['datumland']); $GLOBALS['mysql']->insert("UPDATE tourenliste SET tag='".$teilen[0]."' WHERE tour='".$row['id']."' and kw='".$kw."' and jahr='".$jahr."'"); $GLOBALS['mysql']->insert("UPDATE tourenliste SET monat='".$teilen[1]."' WHERE tour='".$row['id']."' and kw='".$kw."' and jahr='".$jahr."'"); $GLOBALS['mysql']->insert("UPDATE tourenliste SET jahr='".$teilen[2]."',logid='".time()."' WHERE tour='".$row['id']."' and kw='".$kw."' and jahr='".$jahr."'"); $template->assign('datumland', $datumland); } else { $teilen = explode(".",$_POST['datumstadt']); $GLOBALS['mysql']->insert("UPDATE tourenliste SET tag='".$teilen[0]."' WHERE tour='".$row['id']."' and kw='".$kw."' and jahr='".$jahr."'"); $GLOBALS['mysql']->insert("UPDATE tourenliste SET monat='".$teilen[1]."' WHERE tour='".$row['id']."' and kw='".$kw."' and jahr='".$jahr."'"); $GLOBALS['mysql']->insert("UPDATE tourenliste SET jahr='".$teilen[2]."',logid='".time()."' WHERE tour='".$row['id']."' and kw='".$kw."' and jahr='".$jahr."'"); $template->assign('datumstadt',$datumstadt); } } $success[]='Der Rundschau-Abholtag wurde geändert.'; $template->assign('success', $success); } //------------------------ speicherbutten elseif(isset($_POST['datasave'])) { foreach($_POST['list'] as $row) { // echo $row['tid'].' <- ID