// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
// Shall I delete selected holidays???
-if (countPostSelection() > 0) {
+if (ifPostContainsSelections()) {
// Delete multiple holiday requests (for list_holiday)
$cnt = '0';
foreach (postRequestParameter('sel') as $id => $sel) {
LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data and free memory
- list($userid, $start, $end) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
+ $content = SQL_FETCHARRAY($result);
// Update user's account
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data`
`holiday_activated`=0
WHERE
`userid`=%s
-LIMIT 1", array(bigintval($userid)), __FILE__, __LINE__);
+LIMIT 1", array(bigintval($content['userid'])), __FILE__, __LINE__);
// Remove holiday
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM
LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
// Prepare loaded data for the
- $content = array(
- 'start' => generateDateTime($start, 3),
- 'end' => generateDateTime($end , 3)
- );
+ $content['holiday_start'] = generateDateTime($content['holiday_start'], 3);
+ $content['holiday_end'] = generateDateTime($content['holiday_end'] , 3);
// Send email to user
- $message = loadEmailTemplate('member_holiday_removed', $content, $userid);
- sendEmail($userid, '{--ADMIN_HOLIDAY_REMOVED_SUBJECT--}', $message);
+ $message = loadEmailTemplate('member_holiday_removed', $content, $content['userid']);
+ sendEmail($content['userid'], '{--ADMIN_HOLIDAY_REMOVED_SUBJECT--}', $message);
$cnt++;
- }
- }
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+ } // END - foreach
loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_HOLIDAY_MULTI_DEL', $cnt));
} elseif (isGetRequestParameterSet('userid')) {
// Set default message
// Fetch data
$result_load = SQL_QUERY_ESC("SELECT
- `holiday_start` AS start, `holiday_end` AS end
+ `holiday_start` AS start, `holiday_end` AS `end`
FROM
`{?_MYSQL_PREFIX?}_user_holidays`
WHERE