X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-edit_sponsor.php;h=17b73bffd9a1919cf90febcd3dcdaba450be524d;hb=2272afc569a7b308e6c34a2d28457495e6b2483b;hp=88625c21bac22317cb1e70ca0d8f352d1fa3f0c2;hpb=5c2b2ca5b6829690b9f3bbfa55d896e40a71b8dd;p=mailer.git
diff --git a/inc/modules/admin/what-edit_sponsor.php b/inc/modules/admin/what-edit_sponsor.php
index 88625c21ba..17b73bffd9 100644
--- a/inc/modules/admin/what-edit_sponsor.php
+++ b/inc/modules/admin/what-edit_sponsor.php
@@ -14,11 +14,9 @@
* $Date:: $ *
* $Tag:: 0.2.1-FINAL $ *
* $Author:: $ *
- * Needs to be in all Files and every File needs "svn propset *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009, 2010 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -40,40 +38,28 @@
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
-addMenuDescription('admin', __FILE__);
+addYouAreHereLink('admin', __FILE__);
if ((isGetRequestParameterSet('id')) && (isGetRequestParameterSet('mode'))) {
// Check for selected sponsor
$result_main = SQL_QUERY_ESC("SELECT
- `company`, `position`, `gender`, `surname`, `family`,
+ `id`, `company`, `position`, `gender`, `surname`, `family`,
`street_nr1`, `street_nr2`, `zip`, `city`, `country`,
`phone`, `fax`, `cell`, `email`, `url`, `tax_ident`,
`receive_warnings`, `warning_interval`
FROM
`{?_MYSQL_PREFIX?}_sponsor_data`
WHERE
- `id`='%s'
+ `id`=%s
LIMIT 1",
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(getRequestParameter('id'));
-
- // Init gender
- foreach (array('m', 'f', 'c') as $gender) {
- $content['gender_' . $gender] = '';
- } // END - foreach
-
- // Check for gender selection
- $content['gender_' . strtolower($content['gender'])] = ' selected="selected"';
-
// Warning because low points
$content['receive_warnings'] = addSelectionBox('yn', $content['receive_warnings'], 'receive_warning');
$content['warning_interval'] = createTimeSelections($content['warning_interval'], 'warning_interval', 'MWDh');
@@ -92,12 +78,12 @@ LIMIT 1",
$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",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `points_amount`=`points_amount`+%s WHERE `id`=%s LIMIT 1",
array($points, bigintval(getRequestParameter('id'))), __FILE__, __LINE__);
// Remember points /reason for the template
$content['points'] = $points;
- $content['reason'] = secureString(postRequestParameter('reason'));
+ $content['reason'] = postRequestParameter('reason');
// Send email
$message = loadEmailTemplate('sponsor_add_points', $content);
@@ -105,7 +91,7 @@ LIMIT 1",
$message = '{--ADMIN_SPONSOR_POINTS_ADDED--}';
} else {
// No points entered to add!
- $message = '{--ADMIN_SPONSPOR_NO_POINTS_TO_ADD--}';
+ $message = '{--ADMIN_SPONSOR_NO_POINTS_TO_ADD--}';
}
break;
@@ -115,12 +101,12 @@ LIMIT 1",
$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",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `points_used`=`points_used`+%s WHERE `id`=%s LIMIT 1",
array($points, bigintval(getRequestParameter('id'))), __FILE__, __LINE__);
// Remember points /reason for the template
$content['points'] = $points;
- $content['reason'] = secureString(postRequestParameter('reason'));
+ $content['reason'] = postRequestParameter('reason');
// Send email
$message = loadEmailTemplate('sponsor_sub_points', $content);
@@ -128,7 +114,7 @@ LIMIT 1",
$message = '{--ADMIN_SPONSOR_POINTS_SUBTRACTED--}';
} else {
// No points entered to add!
- $message = '{--ADMIN_SPONSPOR_NO_POINTS_TO_SUBTRACT--}';
+ $message = '{--ADMIN_SPONSOR_NO_POINTS_TO_SUBTRACT--}';
}
break;
@@ -143,14 +129,14 @@ LIMIT 1",
// Convert time selection
$DATA = array(); $id = 'warning_interval_ye'; $skip = false;
- convertSelectionsToTimestamp(postRequestArray(), $DATA, $id, $skip);
+ convertSelectionsToEpocheTime(postRequestArray(), $DATA, $id, $skip);
// Save the sponsor
handleSponsorRequest(postRequestArray());
// Convert some data for the email template
- postRequestParameter('gender' , translateGender(postRequestParameter('gender')));
- postRequestParameter('warning_interval', createFancyTime(postRequestParameter('warning_interval')));
+ postRequestParameter('gender' , '{%pipe,translateComma=' . postRequestParameter('gender') . '%}');
+ postRequestParameter('warning_interval', '{%pipe,createFancyTime=' . postRequestParameter('warning_interval') . '%}');
if ($PASS === false) setPostRequestParameter('pass1', '{--SPONSOR_PASS_UNCHANGED--}');
@@ -161,34 +147,34 @@ LIMIT 1",
default: // Unknown mode
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", getRequestParameter('mode')));
- $message = getMaskedMessage('ADMIN_SPONSOR_INVALID_MODE', getRequestParameter('mode'));
+ $message = '{%message,ADMIN_SPONSOR_INVALID_MODE=' . getRequestParameter('mode') . '%}';
break;
}
if (!empty($message)) {
// Output message
- loadTemplate('admin_settings_saved', false, $message);
+ displayMessage($message);
} // END - if
} elseif (isFileReadable(sprintf("%stemplates/%s/html/admin/%s.tpl", getPath(), getLanguage(), $TPL))) {
// Create mailto link
- $content['contact'] = '' . $content['surname'] . ' ' . $content['family'] . '';
+ $content['contact'] = '' . $content['surname'] . ' ' . $content['family'] . '';
// Load mode template
- loadTemplate($TPL);
+ loadTemplate($TPL, false, $content);
} else {
- // Template not found!
- loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_MODUS_TPL_404', getRequestParameter('mode')));
+ // Template not found
+ displayMessage('{%message,ADMIN_SPONSOR_MODUS_TPL_404', getRequestParameter('mode') . '%}');
}
} else {
- // Sponsor not found!
- loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestParameter('id'))));
+ // Sponsor not found
+ displayMessage('{%message,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, '{--ADMIN_CALL_NOT_DIRECTLY--}');
+ displayMessage('{--ADMIN_CALL_NOT_DIRECTLY--}');
}
// [EOF]