<?php
/************************************************************************
- * MXChange v0.2.1 Start: 07/03/2004 *
+ * Mailer v0.2.1-FINAL Start: 07/03/2004 *
* ================ Last change: 08/22/2004 *
* *
* -------------------------------------------------------------------- *
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s AND `price_level`='%s' LIMIT 1",
array(bigintval(getRequestElement('rallye')), bigintval(postRequestElement('level'))), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 0) {
+ if (SQL_NUMROWS($result) == '0') {
// Ok, new price level entered!
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_rallye_prices` (rallye_id, price_level, points, info)
VALUES ('%s','%s','%s','%s')",
}
} elseif (isPostRequestElementSet('remove')) {
// Check if at last one line is selected
- $SEL = countPostSelection();
- if ($SEL > 0) {
+ if (countPostSelection() > 0) {
// Delete selected entries
foreach (postRequestElement('sel') as $id => $sel) {
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
$id = bigintval($id);
// Update entry
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_prices` SET rallye_id=%s, price_`level`='%s', points='%s', info='%s' WHERE `id`=%s LIMIT 1",
- array(
- postRequestElement('rallye_id', $id),
- bigintval($level),
- postRequestElement('points', $id),
- postRequestElement('infos', $id),
- $id
- ), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE
+ `{?_MYSQL_PREFIX?}_rallye_prices`
+SET
+ `rallye_id`=%s,
+ `price_level`=%d,
+ `points`=%s,
+ `info`='%s'
+WHERE
+ `id`=%s
+LIMIT 1",
+ array(
+ postRequestElement('rallye_id', $id),
+ bigintval($level),
+ postRequestElement('points', $id),
+ postRequestElement('infos', $id),
+ $id
+ ), __FILE__, __LINE__);
}
// Output message
if (isPostRequestElementSet('edit')) {
// Check if at last one line is selected
- $SEL = countPostSelection();
- if ($SEL > 0) {
+ if (countPostSelection() > 0) {
// Make selected editable
$OUT = ''; $SW = 2;
foreach (postRequestElement('sel') as $id => $sel) {
$content = array(
'sw' => $SW,
'id' => $id,
- 'rallyes' => generateOptionList("rallye_data", 'id', "title", $rallye),
+ 'rallyes' => generateOptionList('rallye_data', 'id', 'title', $rallye),
'level' => $level,
'points' => $points,
'infos' => $infos,
}
} elseif (isPostRequestElementSet('del')) {
// Check if at last one line is selected
- $SEL = countPostSelection();
- if ($SEL > 0) {
+ if (countPostSelection() > 0) {
// List all prices
$OUT = ''; $SW = 2;
foreach (postRequestElement('sel') as $id => $sel) {
// Load data to selected rallye
- $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `rallye_id`, `price_level`, `points`, `info` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
list($rallye, $level, $points, $infos) = SQL_FETCHROW($result);
SQL_FREERESULT($result);