session_start(); $username = $_SESSION['username']; $page = $_SERVER[ 'SCRIPT_NAME' ] ; $page = explode("/", $page); $kat = $page[2]; $page = $page[3]; include("../includes/_config-mm.php"); $con = mysql_connect($db_host,$db_login_vvw,$db_pass_vvw); mysql_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'", $con); if($action == "DEL") { mysql_db_query($db_name_vvw,"delete from rr_bill_positions where posid = '$posid' "); } if($action == "UPD") { if($anzahl == "") { $anzahl=1; } $poseinzelpreis = ereg_replace(",", ".", $poseinzelpreis); mysql_db_query($db_name_vvw,"update rr_bill_positions SET anzahl='$anzahl', posbeschreibung='$posbeschreibung', poseinzelpreis='$poseinzelpreis', mwst_satz='$ustsatz' where posid = '$posid' "); } if($action == "Position speichern") { if($poseinzelpreisnetto <> "" && $poseinzelpreis == "") { $poseinzelpreisnetto = ereg_replace(",", ".", $poseinzelpreisnetto); if( date("Y") < "2007") { $poseinzelpreis = $poseinzelpreisnetto*1.16; } if( date("Y") > "2006") { $poseinzelpreis = $poseinzelpreisnetto*1.19; } } $poseinzelpreis = ereg_replace(",", ".", $poseinzelpreis); $poseinzelpreis = sprintf('%01.2f' , $poseinzelpreis); if($anzahl == "") { $anzahl=1; } $pos_insert = mysql_db_query($db_name_vvw,"insert into rr_bill_positions (bill_id,posid,posnr,anzahl,posbeschreibung,poseinzelpreis,mwst_satz) VALUES ('$bill_id','','0','$anzahl','$posbeschreibung','$poseinzelpreis','$ustsatz')"); } if($action == "edit_cnee") { mysql_db_query($db_name_vvw,"update rr_bills set contact_id = '$contact_id' where bill_id = '$bill_id'"); $alert = "Rechnungsempfänger erfolgreich geändert!"; } if($action == "bruttonettomwst") { $query = "update rr_bills set netto='$_REQUEST[netto]', mwst='$_REQUEST[mwst]', brutto='$_REQUEST[brutto]' where bill_id = '$_REQUEST[bill_id]'"; mysql_db_query($db_name_vvw, $query); $alert = "Beträge gespeichert"; } ?>