-
- // Remove entry and reload URL
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
-SET holiday_active='N'
-WHERE userid=%d LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
- LOAD_URL("modules.php?module=login&what=holiday");
- return;
- }
- break;
-
- case 'N': // Display activation form
- // Starting day
- define('_START_DAY' , ADD_SELECTION("day" , date("d", (time() + ONE_DAY)), "start"));
- define('_START_MONTH', ADD_SELECTION("month", date("m", (time() + ONE_DAY)), "start"));
- define('_START_YEAR' , ADD_SELECTION("year" , date('Y', (time() + ONE_DAY)), "start"));
-
- // Calcualte ending date
- $D = date("d", time() + ONE_DAY + (ONE_DAY * $_CONFIG['holiday_max']));
- $M = date("m", time() + ONE_DAY + (ONE_DAY * $_CONFIG['holiday_max']));
- $Y = date('Y', time() + ONE_DAY + (ONE_DAY * $_CONFIG['holiday_max']));
-
- // Ending day
- define('_END_DAY' , ADD_SELECTION("day" , $D, "end"));
- define('_END_MONTH', ADD_SELECTION("month", $M, "end"));
- define('_END_YEAR' , ADD_SELECTION("year" , $Y, "end"));
-
- // Copy value from configuration
- define('__HOLIDAY_MAX', $_CONFIG['holiday_max']);
-
- // Output form
- LOAD_TEMPLATE("member_holiday_form");
- break;
- }
- }
- else
- {
+ break;
+
+ case 'N': // Display activation form
+ // Cache timestamps
+ $startingStamp = time() + getOneDay();
+ $endingStamp = $startingStamp + (getOneDay() * getConfig('holiday_max'));
+
+ // Starting day
+ $content['start_day'] = addSelectionBox('da', getDay($startingStamp) , 'start');
+ $content['start_month'] = addSelectionBox('mo', getMonth($startingStamp), 'start');
+ $content['start_year'] = addSelectionBox('ye', getYear($startingStamp) , 'start');
+
+ // Ending day
+ $content['end_day'] = addSelectionBox('da', getDay($endingStamp) , 'end');
+ $content['end_month'] = addSelectionBox('mo', getMonth($endingStamp), 'end');
+ $content['end_year'] = addSelectionBox('ye', getYear($endingStamp) , 'end');
+
+ // Output form
+ loadTemplate('member_holiday_form', FALSE, $content);
+ break;
+ } // END - switch
+ } else {