* svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-if ((isGetRequestElementSet('id')) && (isGetRequestElementSet('mode'))) {
+if ((isGetRequestParameterSet('id')) && (isGetRequestParameterSet('mode'))) {
// Check for selected sponsor
$result_main = SQL_QUERY_ESC("SELECT
`company`, `position`, `gender`, `surname`, `family`,
WHERE
`id`='%s'
LIMIT 1",
- array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
+ array(bigintval(getRequestParameter('id'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result_main) == 1) {
// Load sponsor details
$content = SQL_FETCHARRAY($result_main);
// Prepare all data for the template
// Sponsor's id
- $content['id'] = bigintval(getRequestElement('id'));
+ $content['id'] = bigintval(getRequestParameter('id'));
// Init gender
foreach (array('m', 'f', 'c') as $gender) {
// Warning because low points
$content['receive_warnings'] = addSelectionBox('yn', $content['receive_warnings'], 'receive_warning');
- $content['interval'] = createTimeSelections($content['warning_interval'], 'warning_interval', 'MWDh');
+ $content['warning_interval'] = createTimeSelections($content['warning_interval'], 'warning_interval', 'MWDh');
// Init variables here
- $TPL = sprintf("admin_edit_sponsor_%s", getRequestElement('mode'));
+ $TPL = sprintf("admin_edit_sponsor_%s", getRequestParameter('mode'));
initSqls();
// Sponsor was found
- if ((isFormSent()) || (isPostRequestElementSet('edit'))) {
+ if ((isFormSent()) || (isFormSent('edit'))) {
// Perform action on mode
- switch (getRequestElement('mode')) {
+ switch (getRequestParameter('mode')) {
case 'add_points': // Add points
- if (bigintval(postRequestElement('points')) > 0) {
+ if (bigintval(postRequestParameter('points')) > 0) {
// Replace german decimal comma with computer's decimal dot
- $points = bigintval(convertCommaToDot(postRequestElement('points')));
+ $points = bigintval(convertCommaToDot(postRequestParameter('points')));
// Add points to account
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `points_amount`=`points_amount`+%s WHERE `id`='%s' LIMIT 1",
- array($points, bigintval(getRequestElement('id'))), __FILE__, __LINE__);
+ array($points, bigintval(getRequestParameter('id'))), __FILE__, __LINE__);
// Remember points /reason for the template
- $content['points'] = translateComma($points);
- $content['reason'] = secureString(postRequestElement('reason'));
+ $content['points'] = $points;
+ $content['reason'] = secureString(postRequestParameter('reason'));
// Send email
$message = loadEmailTemplate('sponsor_add_points', $content);
- sendEmail($content['email'], getMessage('ADMIN_SPONSOR_ADD_POINTS_SUBJ'), $message);
- $message = getMessage('ADMIN_SPONSOR_POINTS_ADDED');
+ sendEmail($content['email'], '{--ADMIN_SPONSOR_ADD_POINTS_SUBJECT--}', $message);
+ $message = '{--ADMIN_SPONSOR_POINTS_ADDED--}';
} else {
// No points entered to add!
- $message = getMessage('ADMIN_SPONSPOR_NO_POINTS_TO_ADD');
+ $message = '{--ADMIN_SPONSPOR_NO_POINTS_TO_ADD--}';
}
break;
case 'sub_points': // Subtract points
- if (bigintval(postRequestElement('points')) > 0) {
+ if (bigintval(postRequestParameter('points')) > 0) {
// Replace german decimal comma with computer's decimal dot
- $points = bigintval(convertCommaToDot(postRequestElement('points')));
+ $points = bigintval(convertCommaToDot(postRequestParameter('points')));
// Add points to account
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `points_used`=`points_used`+%s WHERE `id`='%s' LIMIT 1",
- array($points, bigintval(getRequestElement('id'))), __FILE__, __LINE__);
+ array($points, bigintval(getRequestParameter('id'))), __FILE__, __LINE__);
// Remember points /reason for the template
- $content['points'] = translateComma($points);
- $content['reason'] = secureString(postRequestElement('reason'));
+ $content['points'] = $points;
+ $content['reason'] = secureString(postRequestParameter('reason'));
// Send email
$message = loadEmailTemplate('sponsor_sub_points', $content);
- sendEmail($content['email'], getMessage('ADMIN_SPONSOR_SUB_POINTS_SUBJ'), $message);
- $message = getMessage('ADMIN_SPONSOR_POINTS_SUBTRACTED');
+ sendEmail($content['email'], '{--ADMIN_SPONSOR_SUB_POINTS_SUBJECT--}', $message);
+ $message = '{--ADMIN_SPONSOR_POINTS_SUBTRACTED--}';
} else {
// No points entered to add!
- $message = getMessage('ADMIN_SPONSPOR_NO_POINTS_TO_SUBTRACT');
+ $message = '{--ADMIN_SPONSPOR_NO_POINTS_TO_SUBTRACT--}';
}
break;
case 'edit': // Edit sponsor account
$PASS = true;
- if ((postRequestElement('pass1') != postRequestElement('pass2')) || ((!isPostRequestElementSet('pass1')) && (!isPostRequestElementSet('pass1')))) {
+ if ((postRequestParameter('pass1') != postRequestParameter('pass2')) || ((!isPostRequestParameterSet('pass1')) && (!isPostRequestParameterSet('pass1')))) {
// Remove passwords
- unsetPostRequestElement('pass1');
- unsetPostRequestElement('pass2');
+ unsetPostRequestParameter('pass1');
+ unsetPostRequestParameter('pass2');
$PASS = false;
} // END - if
handlSponsorRequest(postRequestArray());
// Convert some data for the email template
- postRequestElement('gender' , translateGender(postRequestElement('gender')));
- postRequestElement('warning_interval', createFancyTime(postRequestElement('warning_interval')));
+ postRequestParameter('gender' , translateGender(postRequestParameter('gender')));
+ postRequestParameter('warning_interval', createFancyTime(postRequestParameter('warning_interval')));
- if ($PASS === false) setRequestPostElement('pass1', getMessage('SPONSOR_PASS_UNCHANGED'));
+ if ($PASS === false) setPostRequestParameter('pass1', '{--SPONSOR_PASS_UNCHANGED--}');
// Load email template and send the mail away
$message = loadEmailTemplate('admin_sponsor_edit', postRequestArray(), false);
- sendEmail(postRequestElement('email'), getMessage('ADMIN_SPONSOR_EDIT_SUBJECT'), $message);
+ sendEmail(postRequestParameter('email'), '{--ADMIN_SPONSOR_EDIT_SUBJECT--}', $message);
break;
default: // Unknown mode
- logDebugMessage(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", getRequestElement('mode')));
- $message = sprintf(getMessage('ADMIN_SPONSOR_INVALID_MODE'), getRequestElement('mode'));
+ logDebugMessage(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", getRequestParameter('mode')));
+ $message = getMaskedMessage('ADMIN_SPONSOR_INVALID_MODE', getRequestParameter('mode'));
break;
}
// Output message
loadTemplate('admin_settings_saved', false, $message);
} // END - if
- } elseif (isFileReadable(sprintf("%stemplates/%s/html/admin/%s.tpl", getConfig('PATH'), getLanguage(), $TPL))) {
+ } elseif (isFileReadable(sprintf("%stemplates/%s/html/admin/%s.tpl", getPath(), getLanguage(), $TPL))) {
// Create mailto link
- $content['contact'] = "<a href=\"" . generateEmailLink($content['email'], 'sponsor_data') . "\">" . $content['surname'] . " " . $content['family'] . "</a>";
+ $content['contact'] = '<a href="' . generateEmailLink($content['email'], 'sponsor_data') . '">' . $content['surname'] . ' ' . $content['family'] . '</a>';
// Load mode template
loadTemplate($TPL);
} else {
// Template not found!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_MODUS_TPL_404'), getRequestElement('mode')));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_MODUS_TPL_404', getRequestParameter('mode')));
}
} else {
// Sponsor not found!
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_404'), bigintval(getRequestElement('id'))));
+ loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestParameter('id'))));
}
// Free result
SQL_FREERESULT($result_main);
} else {
// Not called by what-list_sponsor.php
- loadTemplate('admin_settings_saved', false, getMessage('ADMIN_CALL_NOT_DIRECTLY'));
+ loadTemplate('admin_settings_saved', false, '{--ADMIN_CALL_NOT_DIRECTLY--}');
}
// [EOF]