// Activate / deactivate
switch (REQUEST_GET('activate'))
{
- case '1': // Activate
- ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='Y' WHERE `id`=%s AND is_active='N' LIMIT 1");
- break;
+ case '1': // Activate
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='Y' WHERE `id`=%s AND is_active='N' LIMIT 1");
+ break;
- case '0': // Deactivate
- ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='N' WHERE `id`=%s AND is_active='Y' LIMIT 1");
- break;
+ case '0': // Deactivate
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='N' WHERE `id`=%s AND is_active='Y' LIMIT 1");
+ break;
}
} elseif (REQUEST_ISSET_GET(('notify'))) {
// Automatic notification
switch (REQUEST_GET('notify'))
{
- case '1': // Activate
- ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='Y' WHERE `id`=%s AND send_notify='N' LIMIT 1");
- break;
+ case '1': // Activate
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='Y' WHERE `id`=%s AND send_notify='N' LIMIT 1");
+ break;
- case '0': // Deactivate
- ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='N' WHERE `id`=%s AND send_notify='Y' LIMIT 1");
- break;
+ case '0': // Deactivate
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='N' WHERE `id`=%s AND send_notify='Y' LIMIT 1");
+ break;
}
} elseif (REQUEST_ISSET_GET(('auto'))) {
// Automatic adding of new members
switch (REQUEST_GET('auto'))
{
- case '1': // Activate
- ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='Y' WHERE `id`=%s AND auto_add_new_user='N' LIMIT 1");
- break;
+ case '1': // Activate
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='Y' WHERE `id`=%s AND auto_add_new_user='N' LIMIT 1");
+ break;
- case '0': // Deactivate
- ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='N' WHERE `id`=%s AND auto_add_new_user='Y' LIMIT 1");
- break;
+ case '0': // Deactivate
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='N' WHERE `id`=%s AND auto_add_new_user='Y' LIMIT 1");
+ break;
}
}
foreach (REQUEST_POST('sel') as $id => $selected) {
// Remove selected rallye entirely...
ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE `id`=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__, false));
+ array(bigintval($id)), __FILE__, __LINE__, false));
ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s",
- array(bigintval($id)), __FILE__, __LINE__, false));
+ array(bigintval($id)), __FILE__, __LINE__, false));
ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s",
- array(bigintval($id)), __FILE__, __LINE__, false));
+ array(bigintval($id)), __FILE__, __LINE__, false));
} // END - foreach
// Run SQLS
min_users='%s',
min_prices='%s'
WHERE `id`='".$id."' LIMIT 1",
- array(
- $title,
- REQUEST_POST('descr', $id),
- REQUEST_POST('templ', $id),
- bigintval($START),
- bigintval($END),
- bigintval(REQUEST_POST('min_users', $id)),
- bigintval(REQUEST_POST('min_prices', $id)),
- $id
- ), __FILE__, __LINE__, false));
+ array(
+ $title,
+ REQUEST_POST('descr', $id),
+ REQUEST_POST('templ', $id),
+ bigintval($START),
+ bigintval($END),
+ bigintval(REQUEST_POST('min_users', $id)),
+ bigintval(REQUEST_POST('min_prices', $id)),
+ $id
+ ), __FILE__, __LINE__, false));
}
// Run SQLS
FROM `{!_MYSQL_PREFIX!}_rallye_data`
WHERE `id`=%s
LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
+ array(bigintval($id)), __FILE__, __LINE__);
// Fetch an array
$content = SQL_FETCHARRAY($result);
} elseif ((REQUEST_GET('sub') == 'users') && (REQUEST_GET('rallye') > 0)) {
// List users and their refs before start and current
$result = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s ORDER BY `userid` ASC",
- array(bigintval(REQUEST_GET('rallye'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('rallye'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
$OUT = ''; $SW = 2;
// @TODO Rewrite this constant
$result = SQL_QUERY("SELECT id, admin_id, title, descr, template, start_time, end_time, auto_add_new_user, is_active, send_notify, notified, min_users, min_prices
FROM `{!_MYSQL_PREFIX!}_rallye_data`
ORDER BY start_time DESC",
- __FILE__, __LINE__);
+ __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// List found rallyes
$OUT = ''; $SW = 2;
// Is the rallye active or not?
switch ($content['is_active'])
{
- case 'Y':
- // Rallye is active so do not edit it!
- $content['select'] = "<div class=\"big\">".$content['id']."</div>";
- $content['active_title'] = getMessage('RALLYE_DEACTIVATE_NOW');
- $content['active'] = 0;
- break;
-
- case 'N':
- $content['active_title'] = getMessage('RALLYE_ACTIVATE_NOW');
- $content['active'] = '1';
- break;
+ case 'Y':
+ // Rallye is active so do not edit it!
+ $content['select'] = "<div class=\"big\">".$content['id']."</div>";
+ $content['active_title'] = getMessage('RALLYE_DEACTIVATE_NOW');
+ $content['active'] = 0;
+ break;
+
+ case 'N':
+ $content['active_title'] = getMessage('RALLYE_ACTIVATE_NOW');
+ $content['active'] = '1';
+ break;
}
// Notification to members?
switch ($content['send_notify'])
{
- case 'Y':
- $content['notify_title'] = getMessage('RALLYE_STOP_NOTIFY_NOW');
- $content['notify'] = 0;
- break;
-
- case 'N':
- $content['notify_title'] = getMessage('RALLYE_START_NOTIFY_NOW');
- $content['notify'] = '1';
- break;
+ case 'Y':
+ $content['notify_title'] = getMessage('RALLYE_STOP_NOTIFY_NOW');
+ $content['notify'] = 0;
+ break;
+
+ case 'N':
+ $content['notify_title'] = getMessage('RALLYE_START_NOTIFY_NOW');
+ $content['notify'] = '1';
+ break;
}
// Auto-add of new joined members?
switch ($content['auto_add_new_user'])
{
- case 'Y':
- $content['auto_title'] = getMessage('RALLYE_STOP_AUTO_ADD_NOW');
- $content['auto'] = 0;
- break;
-
- case 'N':
- $content['auto_title'] = getMessage('RALLYE_START_AUTO_ADD_NOW');
- $content['auto'] = '1';
- break;
+ case 'Y':
+ $content['auto_title'] = getMessage('RALLYE_STOP_AUTO_ADD_NOW');
+ $content['auto'] = 0;
+ break;
+
+ case 'N':
+ $content['auto_title'] = getMessage('RALLYE_START_AUTO_ADD_NOW');
+ $content['auto'] = '1';
+ break;
}
// Output row