]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-add_rallye.php
Fix for fatal error and naming convention applied
[mailer.git] / inc / modules / admin / what-add_rallye.php
index 2e18ce09b537a79492ee8f0b945cc653ffd2bdeb..4ad03f5172bf75f83becae8061862985839c145b 100644 (file)
@@ -45,7 +45,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-if (IS_FORM_SENT()) {
+if (isFormSent()) {
        // Generate timestamps
        $START = mktime(REQUEST_POST('start_hour'), REQUEST_POST('start_min'), REQUEST_POST('start_sec'), REQUEST_POST('start_month'), REQUEST_POST('start_day'), REQUEST_POST('start_year'));
        $END   = mktime(REQUEST_POST('end_hour')  , REQUEST_POST('end_min')  , REQUEST_POST('end_sec')  , REQUEST_POST('end_month')  , REQUEST_POST('end_day')  , REQUEST_POST('end_year')  );
@@ -58,27 +58,27 @@ if (IS_FORM_SENT()) {
                // Ok, start and end time did not overlap
                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(),
-       REQUEST_POST('title'),
-       REQUEST_POST('descr'),
-       REQUEST_POST('template'),
-       $START,
-       $END,
-       REQUEST_POST('auto_add'),
-       REQUEST_POST('active'),
-       REQUEST_POST('notify'),
-), __FILE__, __LINE__);
                      array(
+                               getCurrentAdminId(),
+                               REQUEST_POST('title'),
+                               REQUEST_POST('descr'),
+                               REQUEST_POST('template'),
+                               $START,
+                               $END,
+                               REQUEST_POST('auto_add'),
+                               REQUEST_POST('active'),
+                               REQUEST_POST('notify'),
+                       ), __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",
-                array($START, $END, REQUEST_POST('title')), __FILE__, __LINE__);
+               $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'));