X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-holiday.php;h=1980e7548f6234399f929397f26e98f107e10d8a;hp=a18cde4e14bfae13166c59e9f9a19493bd13668a;hb=155492a5b96cec674846973a8524238b0365a848;hpb=da5c63bacddced77a951cbe7b223f314885a6c87 diff --git a/inc/modules/member/what-holiday.php b/inc/modules/member/what-holiday.php index a18cde4e14..1980e7548f 100644 --- a/inc/modules/member/what-holiday.php +++ b/inc/modules/member/what-holiday.php @@ -54,7 +54,7 @@ if ((!isExtensionActive('holiday')) && (!isAdmin())) { $content = array(); // Check for running mail orders in pool -$result1 = SQL_QUERY_ESC("SELECT +$result1 = sqlQueryEscaped("SELECT `timestamp` FROM `{?_MYSQL_PREFIX?}_pool` @@ -65,7 +65,7 @@ ORDER BY LIMIT 1", array(getMemberId()), __FILE__, __LINE__); // Check for sent mail orders in stats -$result2 = SQL_QUERY_ESC("SELECT +$result2 = sqlQueryEscaped("SELECT `timestamp_ordered` FROM `{?_MYSQL_PREFIX?}_user_stats` @@ -75,10 +75,10 @@ ORDER BY `timestamp_ordered` DESC LIMIT 1", array(getMemberId()), __FILE__, __LINE__); -if ((SQL_NUMROWS($result1) == 1) || (SQL_NUMROWS($result2) == 1)) { +if ((sqlNumRows($result1) == 1) || (sqlNumRows($result2) == 1)) { // Mail order found - $content = merge_array($content, SQL_FETCHARRAY($result1)); - $content = merge_array($content, SQL_FETCHARRAY($result2)); + $content = merge_array($content, sqlFetchArray($result1)); + $content = merge_array($content, sqlFetchArray($result2)); // Fix missing entries if (empty($content['timestamp'])) $content['timestamp'] = '0'; @@ -104,8 +104,8 @@ if ((SQL_NUMROWS($result1) == 1) || (SQL_NUMROWS($result2) == 1)) { } // END - if // Free memory -SQL_FREERESULT($result1); -SQL_FREERESULT($result2); +sqlFreeResult($result1); +sqlFreeResult($result2); if (isFormSent()) { // Check holiday request... @@ -119,7 +119,7 @@ if (isFormSent()) { unsetPostRequestElement('ok'); } else { // Everything went okay so let's store his request and send mails - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_holidays` (`userid`, `holiday_start`, `holiday_end`, `comments`) VALUES ('%s','%s','%s','%s')", + sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_user_holidays` (`userid`, `holiday_start`, `holiday_end`, `comments`) VALUES ('%s','%s','%s','%s')", array( getMemberId(), $content['holiday_start'], @@ -128,7 +128,7 @@ if (isFormSent()) { ), __FILE__, __LINE__); // Activate holiday system - SQL_QUERY_ESC("UPDATE + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `holiday_active`='N', @@ -165,7 +165,7 @@ LIMIT 1", // Holiday shall be ended now if (isPostRequestElementSet('stop')) { // Okay, end the holiday here... - $result = SQL_QUERY_ESC("SELECT + $result = sqlQueryEscaped("SELECT `holiday_active`, `holiday_activated` FROM @@ -175,13 +175,13 @@ WHERE LIMIT 1", array(getMemberId()), __FILE__, __LINE__); // Is there an entry? - if (SQL_NUMROWS($result) == 1) { + if (sqlNumRows($result) == 1) { // Merge arrays - $content = merge_array($content, SQL_FETCHARRAY($result)); + $content = merge_array($content, sqlFetchArray($result)); if (($content['holiday_active'] == 'Y') && (($content['holiday_activated'] + getHolidayLock()) < time())) { // Load data - $result2 = SQL_QUERY_ESC("SELECT + $result2 = sqlQueryEscaped("SELECT `holiday_start`, `holiday_end` FROM @@ -189,16 +189,16 @@ FROM WHERE `userid`=%s LIMIT 1", array(getMemberId()), __FILE__, __LINE__); - if (SQL_NUMROWS($result2) == 1) { + if (sqlNumRows($result2) == 1) { // Data was found so merge it - $content = merge_array($content, SQL_FETCHARRAY($result2)); + $content = merge_array($content, sqlFetchArray($result2)); // Prepare it for the template $content['start'] = generateDateTime($content['holiday_start'], 3); $content['end'] = generateDateTime($content['holiday_end'] , 3); // Deactivate it now - SQL_QUERY_ESC("UPDATE + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `holiday_active`='N', @@ -209,7 +209,7 @@ LIMIT 1", array(getMemberId()), __FILE__, __LINE__); // Remove entry - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM + sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_holidays` WHERE `userid`=%s @@ -227,7 +227,7 @@ LIMIT 1", } // Free result - SQL_FREERESULT($result2); + sqlFreeResult($result2); } elseif ($content['holiday_active'] == 'Y') { // To fast! displayMessage('{--MEMBER_HOLIDAY_LOCKED--}'); @@ -238,13 +238,13 @@ LIMIT 1", } // Free result - SQL_FREERESULT($result); + sqlFreeResult($result); } // END - if // If something is wrong or link in menu is just clicked display form if ((!isFormSent()) && (!isPostRequestElementSet('stop'))) { // Check if user is in holiday... - $result = SQL_QUERY_ESC("SELECT + $result = sqlQueryEscaped("SELECT `holiday_active`, `holiday_activated` FROM @@ -252,8 +252,8 @@ FROM WHERE `userid`=%s LIMIT 1", array(getMemberId()), __FILE__, __LINE__); - $content = SQL_FETCHARRAY($result); - SQL_FREERESULT($result); + $content = sqlFetchArray($result); + sqlFreeResult($result); // Check for lock if (($content['holiday_activated'] + getHolidayLock()) < time()) { @@ -261,7 +261,7 @@ LIMIT 1", array(getMemberId()), __FILE__, __LINE__); switch ($content['holiday_active']) { case 'Y': // Display deactivation form // Load starting and ending date - $result = SQL_QUERY_ESC("SELECT + $result = sqlQueryEscaped("SELECT `holiday_start`, `holiday_end` FROM @@ -269,9 +269,9 @@ FROM WHERE `userid`=%s LIMIT 1", array(getMemberId()), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) { + if (sqlNumRows($result) == 1) { // Data was found so merge it - $content = merge_array($content, SQL_FETCHARRAY($result)); + $content = merge_array($content, sqlFetchArray($result)); // Prepare it for the template $content['start'] = generateDateTime($content['holiday_start'] , 3); @@ -282,10 +282,10 @@ LIMIT 1", array(getMemberId()), __FILE__, __LINE__); loadTemplate('member_holiday_deactivate', FALSE, $content); } else { // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); // Remove entry and reload URL - SQL_QUERY_ESC("UPDATE + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `holiday_active`='N' @@ -298,7 +298,7 @@ LIMIT 1", } // Free result - SQL_FREERESULT($result); + sqlFreeResult($result); break; case 'N': // Display activation form