// Ap Funktion
function ap ($buchungssumme,$fuer,$typ) {
global $db_prefix;
$config = mysql_fetch_array(db_query("SELECT `ap_wert`, `art` FROM mss_apaddon_ap WHERE `bereich` = '".$typ."' LIMIT 1"));
if ($config['art'] == '1') {
$apwert = $buchungssumme/100*$config['ap_wert'];
} else {
$apwert = $config['ap_wert'];
}
db_query ("UPDATE ".$db_prefix."_kontodaten SET `t_ap` = `t_ap` + ".$apwert." WHERE `uid`='".$fuer."' LIMIT 1");
db_query ("UPDATE ".$db_prefix."_kontodaten SET `g_ap` = `g_ap` + ".$apwert." WHERE `uid`='".$fuer."' LIMIT 1");
}