} else { $requete = "UPDATE " . PREFIX_DB . "cotisations\n SET " . substr($update_string, 1) . "\n WHERE id_cotis=" . $contribution['id_cotis']; if (db_execute($DB, $requete, $error_detected)) { // to allow the string to be extracted for translation $foo = _T("Contribution updated"); // logging dblog('Contribution updated', strtoupper($login), $requete); } } // dynamic fields set_all_dynamic_fields($DB, 'contrib', $contribution['id_cotis'], $contribution['dyn']); // update deadline if ($cotis_extension) { $date_fin = get_echeance($DB, $contribution['id_adh']); if ($date_fin != "") { $date_fin_update = date_text2db($DB, implode("/", $date_fin)); } else { $date_fin_update = "NULL"; } $requete = "UPDATE " . PREFIX_DB . "adherents\n\t\t\t\t\t\tSET date_echeance=" . $date_fin_update . "\n\t\t\t\t\t\tWHERE id_adh=" . $contribution['id_adh']; $DB->Execute($requete); } if (count($error_detected) == 0) { if ($missing_amount > 0) { $url = 'ajouter_contribution.php?trans_id=' . $contribution['trans_id'] . '&id_adh=' . $contribution['id_adh']; } else { $url = 'gestion_contributions.php?id_adh=' . $contribution['id_adh']; } header('location: ' . $url); } }
$value = ''; } // fill up the transaction structure $transaction[$key] = htmlentities(stripslashes($value), ENT_QUOTES); // now, check validity if ($value != "") { switch ($key) { case 'trans_desc': if ($value == '') { $error_detected[] = _T("- Empty transaction description!"); } $value = $DB->qstr($value, get_magic_quotes_gpc()); break; case 'trans_date': if (preg_match("@^[0-9]{2}/[0-9]{2}/[0-9]{4}\$@", $value, $result)) { $value = date_text2db($DB, $value); if ($value == "") { $error_detected[] = _T("- Non valid date!") . " ({$key})"; } } else { $error_detected[] = _T("- Wrong date format (dd/mm/yyyy)!") . " ({$key})"; } break; } } if ($key != 'trans_id' && ($key != 'id_adh' || $value > 0)) { $update_string .= ", " . $key . "=" . $value; $insert_string_fields .= ", " . $key; $insert_string_values .= ", " . $value; } }