New naming convention applied to many functions, see #118 for details
[mailer.git] / inc / modules / admin / what-add_rallye.php
index 2e18ce09b537a79492ee8f0b945cc653ffd2bdeb..7ee5f72fbec4c619c5b92eb0c36710043b180c78 100644 (file)
@@ -59,7 +59,7 @@ if (IS_FORM_SENT()) {
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_rallye_data` (admin_id, title, descr, template, start_time, end_time, auto_add_new_user, is_active, send_notify)
 VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
  array(
-       GET_CURRENT_ADMIN_ID(),
+       getCurrentAdminId(),
        REQUEST_POST('title'),
        REQUEST_POST('descr'),
        REQUEST_POST('template'),
@@ -71,14 +71,14 @@ VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
 ), __FILE__, __LINE__);
 
                // Load ID
-               $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE start_time='%s' AND end_time='%s' AND `title`='%s' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE start_time='%s' AND end_time='%s' AND `title`='%s' LIMIT 1",
                 array($START, $END, REQUEST_POST('title')), __FILE__, __LINE__);
                list($id) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
 
                if (!empty($id)) {
                        // Reload to prices...
-                       LOAD_URL('modules.php?module=admin&what=config_rallye_prices&rallye='.$id);
+                       redirectToUrl('modules.php?module=admin&what=config_rallye_prices&rallye='.$id);
                } else {
                        // Problem detected...
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_PROBLEM_CREATE'));
@@ -93,9 +93,9 @@ VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
 }
 
 // Prepare some constants for the template
-define('_AUTO_ADD_OPTIONS', ADD_OPTION_LINES('/ARRAY/', array('Y','N'), array(YES, NO )));
-define('_ACTIVE_OPTIONS'  , ADD_OPTION_LINES('/ARRAY/', array('N','Y'), array(NO , YES)));
-define('_NOTIFY_OPTIONS'  , ADD_OPTION_LINES('/ARRAY/', array('Y','N'), array(YES, NO )));
+define('_AUTO_ADD_OPTIONS', generateOptionList('/ARRAY/', array('Y','N'), array(YES, NO )));
+define('_ACTIVE_OPTIONS'  , generateOptionList('/ARRAY/', array('N','Y'), array(NO , YES)));
+define('_NOTIFY_OPTIONS'  , generateOptionList('/ARRAY/', array('Y','N'), array(YES, NO )));
 
 // Starting day
 define('_START_SEC'  , ADD_SELECTION('sec'  , '0'              , 'start'));