if (isFormSent()) {
// Generate timestamps
- $START = mktime(postRequestElement('start_time_hour'), postRequestElement('start_time_min'), 0, postRequestElement('start_time_month'), postRequestElement('start_time_day'), postRequestElement('start_time_year'));
- $END = mktime(postRequestElement('end_time_hour') , postRequestElement('end_time_min') , 0, postRequestElement('end_time_month') , postRequestElement('end_time_day') , postRequestElement('end_time_year') );
+ $START = mktime(postRequestElement('start_time_ho'), postRequestElement('start_time_mi'), 0, postRequestElement('start_time_mo'), postRequestElement('start_time_da'), postRequestElement('start_time_ye'));
+ $END = mktime(postRequestElement('end_time_ho') , postRequestElement('end_time_mi') , 0, postRequestElement('end_time_mo') , postRequestElement('end_time_da') , postRequestElement('end_time_ye') );
// Is there already a rallye running?
$result = SQL_QUERY_ESC("SELECT `id`, `admin_id` FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE (`start_time` <= %s AND `end_time` >= %s) OR (`start_time` >= %s AND `start_time` <= %s) LIMIT 1",
if (isFormSent('save_config')) {
// Test timestamp
- $STAMP = mktime(0, 0, 0, bigintval(postRequestElement('month')), bigintval(postRequestElement('day')), bigintval(postRequestElement('year')));
+ $STAMP = mktime(0, 0, 0, bigintval(postRequestElement('mo')), bigintval(postRequestElement('da')), bigintval(postRequestElement('ye')));
if ($STAMP > time()) {
// Date is in the future!
unsetPostRequestElement('ok');
} else {
// Remove entries
- unsetPostRequestElement('day');
- unsetPostRequestElement('month');
- unsetPostRequestElement('year');
+ unsetPostRequestElement('da');
+ unsetPostRequestElement('mo');
+ unsetPostRequestElement('ye');
// Remember timestamp
setPostRequestElement('mt_start', $STAMP);
$id = bigintval($id);
// Generate timestamps
- $START = mktime(postRequestElement('start_time_hour', $id), postRequestElement('start_time_min', $id), 0, postRequestElement('start_time_month', $id), postRequestElement('start_time_day', $id), postRequestElement('start_time_year', $id));
- $END = mktime(postRequestElement('end_time_hour', $id) , postRequestElement('end_time_min', $id) , 0, postRequestElement('end_time_month', $id) , postRequestElement('end_time_day', $id) , postRequestElement('end_time_year', $id) );
+ $START = mktime(postRequestElement('start_time_ho', $id), postRequestElement('start_time_mi', $id), 0, postRequestElement('start_time_mo', $id), postRequestElement('start_time_da', $id), postRequestElement('start_time_ye', $id));
+ $END = mktime(postRequestElement('end_time_ho', $id) , postRequestElement('end_time_mi', $id) , 0, postRequestElement('end_time_mo', $id) , postRequestElement('end_time_da', $id) , postRequestElement('end_time_ye', $id) );
// Update entry
addSql(SQL_QUERY_ESC("UPDATE
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 {
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__);