]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-holiday.php
www is out-dated
[mailer.git] / inc / modules / member / what-holiday.php
index c5d648bd9ae0bf04a27332de185f8c452a9f2671..5f00eeecbd7addac8e99c44f0626a65f957f5fc2 100644 (file)
@@ -17,7 +17,7 @@
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -86,8 +86,8 @@ if ((SQL_NUMROWS($result1) == 1) || (SQL_NUMROWS($result2) == 1)) {
 
        if ((($content['timestamp'] + getConfig('holiday_lock')) > time()) || (($content['timestamp_ordered'] + getConfig('holiday_lock')) > time())) {
                // Mail order is to close away!
-               unsetPostRequestParameter('ok');
-               unsetPostRequestParameter('stop');
+               unsetPostRequestElement('ok');
+               unsetPostRequestElement('stop');
 
                if (($content['timestamp'] + getConfig('holiday_lock')) > time()) {
                        // Mail found in pool
@@ -109,18 +109,18 @@ SQL_FREERESULT($result2);
 
 if (isFormSent()) {
        // Check holiday request...
-       $START = mktime(0, 0, 0, postRequestParameter('start_month'), postRequestParameter('start_day'), postRequestParameter('start_year'));
-       $content['holiday_end']   = mktime(0, 0, 0, postRequestParameter('end_month')  , postRequestParameter('end_day')  , postRequestParameter('end_year')  );
+       $START = mktime(0, 0, 0, postRequestElement('start_month'), postRequestElement('start_day'), postRequestElement('start_year'));
+       $content['holiday_end']   = mktime(0, 0, 0, postRequestElement('end_month')  , postRequestElement('end_day')  , postRequestElement('end_year')  );
 
        // Test both values
        $TEST = $content['holiday_end'] - $START;
        if (($TEST < 0) || ($TEST > (getOneDay() * getConfig('holiday_max'))) || ($START < time()) || ($content['holiday_end'] < time())) {
                // Time test failed
-               unsetPostRequestParameter('ok');
+               unsetPostRequestElement('ok');
        } else {
                // Everything went okay so let's store his request and send mails
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_holidays` (`userid`, `holiday_start`, `holiday_end`, `comments`) VALUES ('%s','%s','%s','%s')",
-                       array(getMemberId(), $START, $content['holiday_end'], postRequestParameter('comments')), __FILE__, __LINE__);
+               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_holidays` (`userid`,`holiday_start`,`holiday_end`,`comments`) VALUES ('%s','%s','%s','%s')",
+                       array(getMemberId(), $START, $content['holiday_end'], postRequestElement('comments')), __FILE__, __LINE__);
 
                // Activate holiday system
                SQL_QUERY_ESC("UPDATE
@@ -133,13 +133,13 @@ LIMIT 1",
                        array(getMemberId()), __FILE__, __LINE__);
 
                // Prepare constants
-               $content['start_day']   = bigintval(postRequestParameter('start_day'));
-               $content['start_month'] = $GLOBALS['month_descr'][postRequestParameter('start_month')];
-               $content['start_year']  = bigintval(postRequestParameter('start_year'));
-               $content['end_day']     = bigintval(postRequestParameter('end_day'));
-               $content['end_month']   = $GLOBALS['month_descr'][postRequestParameter('end_month')];
-               $content['end_year']    = bigintval(postRequestParameter('end_year'));
-               $content['comments']    = postRequestParameter('comments');
+               $content['start_day']   = bigintval(postRequestElement('start_day'));
+               $content['start_month'] = $GLOBALS['month_descr'][postRequestElement('start_month')];
+               $content['start_year']  = bigintval(postRequestElement('start_year'));
+               $content['end_day']     = bigintval(postRequestElement('end_day'));
+               $content['end_month']   = $GLOBALS['month_descr'][postRequestElement('end_month')];
+               $content['end_year']    = bigintval(postRequestElement('end_year'));
+               $content['comments']    = postRequestElement('comments');
 
                // Send mail to member
                $message = loadEmailTemplate('member_holiday_request', $content, getMemberId());
@@ -157,10 +157,10 @@ LIMIT 1",
 } // END - if
 
 // Holiday shall be ended now
-if (isPostRequestParameterSet('stop')) {
+if (isPostRequestElementSet('stop')) {
        // Okay, end the holiday here...
        $result = SQL_QUERY_ESC("SELECT
-       `holiday_active`, `holiday_activated`
+       `holiday_active`,`holiday_activated`
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
@@ -175,7 +175,7 @@ LIMIT 1", array(getMemberId()), __FILE__, __LINE__);
                if (($content['holiday_active'] == 'Y') && (($content['holiday_activated'] + getConfig('holiday_lock')) < time())) {
                        // Load data
                        $result2 = SQL_QUERY_ESC("SELECT
-       `holiday_start`, `holiday_end`
+       `holiday_start`,`holiday_end`
 FROM
        `{?_MYSQL_PREFIX?}_user_holidays`
 WHERE
@@ -208,7 +208,7 @@ LIMIT 1",
                                        array(getMemberId()), __FILE__, __LINE__);
 
                                // Send email to admin
-                               sendAdminNotification('{--ADMIN_HOLIDAY_DEAC_SUBJECT--}', 'admin_holiday_deactivated', $content, getMemberId());
+                               sendAdminNotification('{--ADMIN_HOLIDAY_DEACTIVATED_SUBJECT--}', 'admin_holiday_deactivated', $content, getMemberId());
 
                                // Display message to user
                                displayMessage('{--MEMBER_HOLIDAY_DEACTIVATED_NOW--}');
@@ -233,10 +233,10 @@ LIMIT 1",
 } // END - if
 
 // If something is wrong or link in menu is just clicked display form
-if ((!isFormSent()) && (!isPostRequestParameterSet('stop'))) {
+if ((!isFormSent()) && (!isPostRequestElementSet('stop'))) {
        // Check if user is in holiday...
        $result = SQL_QUERY_ESC("SELECT
-       `holiday_active`, `holiday_activated`
+       `holiday_active`,`holiday_activated`
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
@@ -252,7 +252,7 @@ LIMIT 1", array(getMemberId()), __FILE__, __LINE__);
                        case 'Y': // Display deactivation form
                                // Load starting and ending date
                                $result = SQL_QUERY_ESC("SELECT
-       `holiday_start`, `holiday_end`
+       `holiday_start`,`holiday_end`
 FROM
        `{?_MYSQL_PREFIX?}_user_holidays`
 WHERE