// Add description as navigation point
addYouAreHereLink('admin', __FILE__);
-// Convert 'rate' if set
-if (isPostRequestElementSet('rate')) {
- convertCommaToDotInPostData('rate');
-} // END - if
-
+// Do we add an entry?
if ((isFormSent('add')) && (isPostRequestElementSet('title')) && (postRequestElement('rate') > 0)) {
// Add new payout type
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE type='%s' LIMIT 1",
$id = bigintval($id);
// Edit only if something is entered
- if ((isPostRequestElementSet('title', $id)) && (postRequestElement('rate', $id) > 0)) {
+ if ((isPostRequestElementSet('type', $id)) && (postRequestElement('rate', $id) > 0)) {
// Update entry
addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_payout_types` SET
`type`='%s',
convertCommaToDot(postRequestElement('rate', $id)),
convertCommaToDot(postRequestElement('min_points' , $id)),
postRequestElement('allow_url', $id),
- bigintval($id)
+ $id
),__FILE__, __LINE__, false));
}
}
}
// Wrapper for elements in $_POST
-function postRequestElement ($element, $subElement=null) {
+function postRequestElement ($element, $subElement = NULL) {
// By default no element is there
$value = NULL;
if (isset($GLOBALS['cache_request']['post'][$element][$subElement])) {
// Then use it
$value = $GLOBALS['cache_request']['post'][$element][$subElement];
+ //* DEBUG: */ print $element.'/'.$subElement.'='.$value.'<br />';
} elseif (isPostRequestElementSet($element)) {
// Then use it
$value = $GLOBALS['raw_request']['post'][$element];
if ((!is_null($subElement)) && (isPostRequestElementSet($element, $subElement))) {
// Then use this
$value = SQL_ESCAPE($value[$subElement]);
+ //* DEBUG: */ print 'sub!<br />';
} elseif (!is_array($value)) {
// Escape it here
$value = SQL_ESCAPE($value);
+ //* DEBUG: */ print 'no-array!<br />';
}
// Set it in cache
+ //* DEBUG: */ print $element.'/'.$subElement.'='.$value.'<br />';
+ //* DEBUG: */ print('<pre>'.print_r($_POST,true).'</pre>');
$GLOBALS['cache_request']['post'][$element][$subElement] = $value;
} // END - if
}
// Checks if an element in $_POST exists
-function isPostRequestElementSet ($element, $subElement=null) {
+function isPostRequestElementSet ($element, $subElement = NULL) {
if (is_null($subElement)) {
return ((isset($GLOBALS['raw_request']['post'][$element])) && (('' . $GLOBALS['raw_request']['post'][$element] . '') != ''));
} else {