]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-holiday.php
Updated copyright notice as there are changes in this year
[mailer.git] / inc / modules / member / what-holiday.php
index 713119e5b66c8a0f718283ed586d64433e939093..a18cde4e14bfae13166c59e9f9a19493bd13668a 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -109,12 +109,12 @@ SQL_FREERESULT($result2);
 
 if (isFormSent()) {
        // Check holiday request...
-       $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')  );
+       $content['holiday_start'] = mktime(0, 0, 0, postRequestElement('start_mo'), postRequestElement('start_da'), postRequestElement('start_ye'));
+       $content['holiday_end']   = mktime(0, 0, 0, postRequestElement('end_mo')  , postRequestElement('end_da')  , postRequestElement('end_ye')  );
 
        // Test both values
-       $TEST = $content['holiday_end'] - $START;
-       if (($TEST < 0) || ($TEST > (getOneDay() * getConfig('holiday_max'))) || ($START < time()) || ($content['holiday_end'] < time())) {
+       $TEST = $content['holiday_end'] - $content['holiday_start'];
+       if (($TEST < 0) || ($TEST > (getOneDay() * getConfig('holiday_max'))) || ($content['holiday_start'] < time()) || ($content['holiday_end'] < time())) {
                // Time test failed
                unsetPostRequestElement('ok');
        } else {
@@ -122,7 +122,7 @@ if (isFormSent()) {
                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_start'],
                                $content['holiday_end'],
                                postRequestElement('comments')
                        ), __FILE__, __LINE__);