X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fmodules%2Fadmin%2Fwhat-del_holiday.php;h=71455b15efe2d8fbcee62bf56d600f1a76da66b9;hb=ba764b4060d3d82fc59e1bd72f68d0a4bb51f723;hp=55b4d6159e3644b69de2a0735e1db9badf3c2112;hpb=30ae22f62ae87c53a56baf0d134569ba91011111;p=mailer.git diff --git a/inc/modules/admin/what-del_holiday.php b/inc/modules/admin/what-del_holiday.php index 55b4d6159e..71455b15ef 100644 --- a/inc/modules/admin/what-del_holiday.php +++ b/inc/modules/admin/what-del_holiday.php @@ -14,12 +14,10 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * 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 * @@ -40,19 +38,19 @@ // Some security stuff... if ((!defined('__SECURITY')) || (!isAdmin())) { die(); -} +} // END - if // Add description as navigation point -addMenuDescription('admin', __FILE__); +addYouAreHereLink('admin', __FILE__); // Shall I delete selected holidays??? if (ifPostContainsSelections()) { // Delete multiple holiday requests (for list_holiday) - $cnt = '0'; - foreach (postRequestParameter('sel') as $id => $sel) { + $count = '0'; + foreach (postRequestElement('sel') as $id => $sel) { // Get the userid $result = SQL_QUERY_ESC("SELECT - `userid`, `holiday_start`, `holiday_end` + `userid`,`holiday_start`,`holiday_end` FROM `{?_MYSQL_PREFIX?}_user_holidays` WHERE @@ -60,8 +58,7 @@ WHERE 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` @@ -70,7 +67,7 @@ SET `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 @@ -80,31 +77,34 @@ WHERE 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); - $cnt++; - } - } - loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_HOLIDAY_MULTI_DEL', $cnt)); -} elseif (isGetRequestParameterSet('userid')) { + $message = loadEmailTemplate('member_holiday_removed', $content, $content['userid']); + sendEmail($content['userid'], '{--ADMIN_HOLIDAY_REMOVED_SUBJECT--}', $message); + $count++; + } // END - if + + // Free result + SQL_FREERESULT($result); + } // END - foreach + + // Display final message + displayMessage('{%message,ADMIN_HOLIDAY_MULTI_DELETE=' . $count . '%}'); +} elseif (isGetRequestElementSet('userid')) { // Set default message $message = '{--ADMIN_HOLIDAY_SINGLE_404--}'; // 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 `userid`=%s LIMIT 1", - array(bigintval(getRequestParameter('userid'))), __FILE__, __LINE__); + array(bigintval(getRequestElement('userid'))), __FILE__, __LINE__); if (SQL_NUMROWS($result_load) == 1) { // Load data $content = SQL_FETCHARRAY($result_load); @@ -114,11 +114,11 @@ LIMIT 1", `{?_MYSQL_PREFIX?}_user_holidays` WHERE `userid`=%s -LIMIT 1", array(bigintval(getRequestParameter('userid'))), __FILE__, __LINE__); +LIMIT 1", array(bigintval(getRequestElement('userid'))), __FILE__, __LINE__); // Send email to user - $message = loadEmailTemplate('member_holiday_removed', $content, getRequestParameter('userid')); - sendEmail(getRequestParameter('userid'), '{--ADMIN_HOLIDAY_REMOVED_SUBJECT--}', $message); + $message = loadEmailTemplate('member_holiday_removed', $content, getRequestElement('userid')); + sendEmail(getRequestElement('userid'), '{--ADMIN_HOLIDAY_REMOVED_SUBJECT--}', $message); // Set message $message = '{--ADMIN_HOLIDAY_SINGLE_DELETED--}'; @@ -128,10 +128,10 @@ LIMIT 1", array(bigintval(getRequestParameter('userid'))), __FILE__, __LINE__); SQL_FREERESULT($result_load); // Output message - loadTemplate('admin_settings_saved', false, $message); + displayMessage($message); } else { - // Please call me over other scripts... ;) - loadTemplate('admin_settings_saved', false, '{--HOLIDAY_NO_DIRECT_CALL--}'); + // Add member selection box + addMemberSelectionBox(); } // [EOF]