X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-add_rallye.php;h=d5d1e97066ed3cbcf8bfe3f1cee489673d824735;hb=bfbf712685680761babfd9ea059a224a4aa244bf;hp=2d08ad826b490bb98c551f29feba7ca0007a3a79;hpb=e1653405d28923c78b2e292125306ccf61138f24;p=mailer.git diff --git a/inc/modules/admin/what-add_rallye.php b/inc/modules/admin/what-add_rallye.php index 2d08ad826b..d5d1e97066 100644 --- a/inc/modules/admin/what-add_rallye.php +++ b/inc/modules/admin/what-add_rallye.php @@ -32,13 +32,13 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point -ADD_DESCR("admin", basename(__FILE__)); +ADD_DESCR("admin", __FILE__); if (isset($_POST['ok'])) { @@ -53,10 +53,10 @@ if (isset($_POST['ok'])) if (SQL_NUMROWS($result) == 0) { // Ok, start and end time did not overlap - $result = 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')", + 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_ADMIN_ID($_COOKIE['admin_login']), + GET_CURRENT_ADMIN_ID(), $_POST['title'], $_POST['descr'], $_POST['template'], @@ -76,7 +76,7 @@ VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", if (!empty($id)) { // Reload to prices... - LOAD_URL(URL."/modules.php?module=admin&what=config_rallye_prices&rallye=".$id); + LOAD_URL("modules.php?module=admin&what=config_rallye_prices&rallye=".$id); } else { @@ -95,9 +95,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', 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 ))); // Starting day define('_START_SEC' , ADD_SELECTION("sec" , "0" , "start")); @@ -108,9 +108,9 @@ define('_START_MONTH', ADD_SELECTION("month", date("m", time()), "start")); define('_START_YEAR' , ADD_SELECTION("year" , date('Y', time()), "start")); // Calcualte ending date -$D = date("d", time() + (ONE_DAY * 7)); -$M = date("m", time() + (ONE_DAY * 7)); -$Y = date('Y', time() + (ONE_DAY * 7)); +$D = date("d", time() + (getConfig('one_day') * 7)); +$M = date("m", time() + (getConfig('one_day') * 7)); +$Y = date('Y', time() + (getConfig('one_day') * 7)); // Ending day define('_END_SEC' , ADD_SELECTION("sec" , "0" , "end")); @@ -121,7 +121,7 @@ define('_END_MONTH', ADD_SELECTION("month", $M , "end")); define('_END_YEAR' , ADD_SELECTION("year" , $Y , "end")); // Transfer (maybe found) templates into constant for the template -define ('_TEMPLATES', RALLYE_TEMPLATE_SELECTION()); +define('_TEMPLATES', RALLYE_TEMPLATE_SELECTION()); // Load template LOAD_TEMPLATE("admin_add_rallye");