]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/earning_functions.php
Heacy rewrite/cleanup:
[mailer.git] / inc / libs / earning_functions.php
index a1bb9a79f74048f3cf3d1fd00acc67111eb89349..fb2e847bdde2249893f324acc431e10405ce70bd 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * 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 *
@@ -103,7 +103,7 @@ function doMemberEarning ($earningId, $dailyAmount, $isActive = 'Y') {
 // Insert member earning entry
 function insertMemberEarning ($earningId, $dailyAmount, $isActive = 'Y') {
        // Insert the record
-       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_earning` (`earning_id`, `earning_userid`, `earning_daily_amount`, `earning_active`) VALUES(%s,%s,%s,'%s')",
+       sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_user_earning` (`earning_id`, `earning_userid`, `earning_daily_amount`, `earning_active`) VALUES(%s,%s,%s,'%s')",
                array(
                        bigintval($earningId),
                        getMemberId(),
@@ -113,7 +113,7 @@ function insertMemberEarning ($earningId, $dailyAmount, $isActive = 'Y') {
 
        // Prepare content
        $content = array(
-               'insert_id'    => SQL_INSERTID(),
+               'insert_id'    => getSqlInsertId(),
                'earning_id'   => bigintval($earningId),
                'daily_amount' => bigintval($dailyAmount),
                'is_active'    => $isActive
@@ -129,7 +129,7 @@ function insertMemberEarning ($earningId, $dailyAmount, $isActive = 'Y') {
        sendAdminNotification('{--ADMIN_EARNING_INSERTED_SUBJECT--}', 'admin_earning_added', $content, getMemberId());
 
        // Return status
-       return ($content['insert_id'] > 0);
+       return isValidId($content['insert_id']);
 }
 
 // Update a given earning amount
@@ -144,7 +144,7 @@ function updateMemberEarning ($earningId, $dailyAmount, $isActive = 'Y') {
        } // END - if
 
        // Update database record
-       SQL_QUERY_ESC("UPDATE
+       sqlQueryEscaped("UPDATE
        `{?_MYSQL_PREFIX?}_user_earning`
 SET
        `earning_daily_amount`=%s,
@@ -161,7 +161,7 @@ LIMIT 1", array(
        ), __FUNCTION__, __LINE__);
 
        // Determine whether something has changed
-       $status = (!SQL_HASZEROAFFECTED());
+       $status = (!ifSqlHasZeroAffectedRows());
 
        // Has the record changed?
        if ($status === TRUE) {