// Activate / deactivate
switch (getRequestElement('activate')) {
case '1': // Activate
- addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `is_active`='Y' WHERE `id`=%s AND `is_active`='N' LIMIT 1",
+ addSql(sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `is_active`='Y' WHERE `id`=%s AND `is_active`='N' LIMIT 1",
array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, FALSE)
);
break;
case '0': // Deactivate
- addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `is_active`='N' WHERE `id`=%s AND `is_active`='Y' LIMIT 1",
+ addSql(sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `is_active`='N' WHERE `id`=%s AND `is_active`='Y' LIMIT 1",
array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, FALSE)
);
break;
// Automatic notification
switch (getRequestElement('notify')) {
case '1': // Activate
- addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `send_notify`='Y' WHERE `id`=%s AND `send_notify`='N' LIMIT 1",
+ addSql(sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `send_notify`='Y' WHERE `id`=%s AND `send_notify`='N' LIMIT 1",
array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, FALSE)
);
break;
case '0': // Deactivate
- addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `send_notify`='N' WHERE `id`=%s AND `send_notify`='Y' LIMIT 1",
+ addSql(sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `send_notify`='N' WHERE `id`=%s AND `send_notify`='Y' LIMIT 1",
array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, FALSE)
);
break;
// Automatic adding of new members
switch (getRequestElement('auto')) {
case '1': // Activate
- addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `auto_add_new_user`='Y' WHERE `id`=%s AND `auto_add_new_user`='N' LIMIT 1",
+ addSql(sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `auto_add_new_user`='Y' WHERE `id`=%s AND `auto_add_new_user`='N' LIMIT 1",
array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, FALSE)
);
break;
case '0': // Deactivate
- addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `auto_add_new_user`='N' WHERE `id`=%s AND `auto_add_new_user`='Y' LIMIT 1",
+ addSql(sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `auto_add_new_user`='N' WHERE `id`=%s AND `auto_add_new_user`='Y' LIMIT 1",
array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__, FALSE)
);
break;
// Delete selected rallyes and all it's data
foreach (postRequestElement('sel') as $id => $selected) {
// Remove selected rallye entirely...
- addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE `id`=%s LIMIT 1",
+ addSql(sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__, FALSE));
- addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s",
+ addSql(sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s",
array(bigintval($id)), __FILE__, __LINE__, FALSE));
- addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_users` WHERE `rallye_id`=%s",
+ addSql(sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_users` WHERE `rallye_id`=%s",
array(bigintval($id)), __FILE__, __LINE__, FALSE));
} // END - foreach
$END = mktime(postRequestElement('end_time_ho', $id) , postRequestElement('end_time_mi', $id) , 0, postRequestElement('end_time_mo', $id) , postRequestElement('end_time_da', $id) , postRequestElement('end_time_ye', $id) );
// Update entry
- addSql(SQL_QUERY_ESC("UPDATE
+ addSql(sqlQueryEscaped("UPDATE
`{?_MYSQL_PREFIX?}_rallye_data`
SET
`title`='%s',
// Then set it
$mode = 'delete';
} // END - if
-
+
// Check for selections
if (ifPostContainsSelections()) {
// Make all selected and deactivated rallyes editable
$OUT = '';
foreach (postRequestElement('sel') as $id => $selected) {
// Load rallye basic data
- $result = SQL_QUERY_ESC("SELECT
+ $result = sqlQueryEscaped("SELECT
`title`,
`descr`,
`template`,
array(bigintval($id)), __FILE__, __LINE__);
// Fetch an array
- $content = SQL_FETCHARRAY($result);
+ $content = sqlFetchArray($result);
// Free result
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
// Only for editing ...
if ($mode == 'edit') {
}
} elseif ((getRequestElement('sub') == 'users') && (getRequestElement('rallye_id') > 0)) {
// List users and their refs before start and current
- $result = SQL_QUERY_ESC("SELECT
+ $result = sqlQueryEscaped("SELECT
`userid`,
`refs`,
`curr_points`
ORDER BY
`userid` ASC",
array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__);
- if (!SQL_HASZERONUMS($result)) {
+ if (!ifSqlHasZeroNums($result)) {
$OUT = '';
$content['rallye_id'] = bigintval(getRequestElement('rallye_id'));
- while ($row = SQL_FETCHARRAY($result)) {
+ while ($row = sqlFetchArray($result)) {
// Check for referral count
$count = getReferralRallyeRefsCount($row['userid'], $row['refs']);
$content['rallye_id'] = bigintval(getRequestElement('rallye_id'));
// Free memory
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
// Load template
loadTemplate('admin_list_rallye_usr', FALSE, $content);
}
} else {
// Start listing rallyes
- $result = SQL_QUERY("SELECT
+ $result = sqlQuery("SELECT
`id` AS `rallye_id`,
`admin_id`,
`title`,
`start_time` DESC", __FILE__, __LINE__);
// Records found?
- if (!SQL_HASZERONUMS($result)) {
+ if (!ifSqlHasZeroNums($result)) {
// List found rallyes
$OUT = '';
- while ($data = SQL_FETCHARRAY($result)) {
+ while ($data = sqlFetchArray($result)) {
// Count joined userids
$users = countSumTotalData($data['rallye_id'], 'rallye_users', 'rallye_id', 'rallye_id', TRUE);
} // END - while
// Free memory
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
// Remember rows in array
$content['rows'] = $OUT;