Example #1
0
 $bestellung_new->updateamum = date('Y-m-d H:i:s');
 $bestellung_new->updatevon = $user;
 $bestellung_new->zahlungstyp_kurzbz = $_POST['filter_zahlungstyp'];
 $bestellung_new->kostenstelle_id = $_POST['filter_kst'];
 if (isset($_POST['filter_projekt'])) {
     // Projekt zu Bestellung speichern
     $bestellung_new->saveProjektToBestellung($bestellung_new->bestellung_id, $_REQUEST['filter_projekt']);
 }
 // wenn sich kostenstelle geƤndert hat, neue bestellnummer generieren
 if ($bestellung_new->kostenstelle_id != $bestellung_old->kostenstelle_id && !$status->isStatiVorhanden($bestellung_id, 'Bestellung')) {
     $bestellung_new->bestell_nr = $bestellung_new->createBestellNr($bestellung_new->kostenstelle_id);
 }
 $tags = explode(";", $_POST['tags']);
 $help_tags = new tags();
 $help_tags->bestellung_id = $bestellung_id;
 $help_tags->deleteBestellungTag($tags);
 foreach ($tags as $bestelltags) {
     $tag_bestellung = new tags();
     $tag_bestellung->tag = trim($bestelltags);
     $tag_bestellung->bestellung_id = $bestellung_id;
     $tag_bestellung->insertvon = $user;
     $tag_bestellung->insertamum = date('Y-m-d H:i:s');
     if (!$tag_bestellung->TagExists()) {
         $tag_bestellung->saveTag();
         $tag_bestellung->saveBestellungTag();
     } else {
         if (!$tag_bestellung->BestellungTagExists()) {
             $tag_bestellung->saveBestellungTag();
         }
     }
 }