X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fjackpot_functions.php;h=a8964e07baee0f17c26d79b61e00d358c882b73f;hp=fbe450bc27108df7b557efb2cd8ae17b206bf742;hb=99966a712b3b3d8b521524762e153353d1d20bd4;hpb=0f3a135204757cc8750262871c8e62c42300acb4 diff --git a/inc/libs/jackpot_functions.php b/inc/libs/jackpot_functions.php index fbe450bc27..a8964e07ba 100644 --- a/inc/libs/jackpot_functions.php +++ b/inc/libs/jackpot_functions.php @@ -16,8 +16,8 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2013 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 * @@ -47,19 +47,19 @@ function getJackpotPoints () { $data['points'] = '0.00000'; // Read them - $result = SQL_QUERY("SELECT `points` FROM `{?_MYSQL_PREFIX?}_jackpot` WHERE `ok`='ok' LIMIT 1", __FUNCTION__, __LINE__); + $result = sqlQuery("SELECT `points` FROM `{?_MYSQL_PREFIX?}_jackpot` WHERE `ok`='ok' LIMIT 1", __FUNCTION__, __LINE__); - // Do we have an entry? - if (SQL_HASZERONUMS($result)) { + // Is there an entry? + if (ifSqlHasZeroNums($result)) { // No, so create line - SQL_QUERY("INSERT INTO `{?_MYSQL_PREFIX?}_jackpot` (`ok`,`points`) VALUES ('ok','0.00000')", __FUNCTION__, __LINE__); + sqlQuery("INSERT INTO `{?_MYSQL_PREFIX?}_jackpot` (`ok`, `points`) VALUES ('ok','0.00000')", __FUNCTION__, __LINE__); } else { // Read the line - $data = SQL_FETCHARRAY($result); + $data = sqlFetchArray($result); } // Free result - SQL_FREERESULT($result); + sqlFreeResult($result); // Return them return $data['points']; @@ -71,14 +71,14 @@ function addPointsToJackpot ($points) { $jackpot = getJackpotPoints(); // Update points - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_jackpot` SET `points`=`points`+%s WHERE `ok`='ok' LIMIT 1", + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_jackpot` SET `points`=`points`+%s WHERE `ok`='ok' LIMIT 1", array($points), __FUNCTION__, __LINE__); } // Subtracts points from the jackpot function subtractPointsFromJackpot ($points) { // First failed - $ret = false; + $ret = FALSE; // Get jackpot points for dummy $jackpot = getJackpotPoints(); @@ -86,13 +86,13 @@ function subtractPointsFromJackpot ($points) { // Enougth points i jackpot? if ($jackpot >= $points) { // Update points when there are enougth points in jackpot - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_jackpot` SET `points`=`points`-%s WHERE `ok`='ok' LIMIT 1", + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_jackpot` SET `points`=`points`-%s WHERE `ok`='ok' LIMIT 1", array($points), __FUNCTION__, __LINE__); - $ret = (!SQL_HASZEROAFFECTED()); + $ret = (!ifSqlHasZeroAffectedRows()); } // END - if // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); // Return the result return $ret;