]> git.mxchange.org Git - mailer.git/blobdiff - doubler.php
Code cleanups, ext-booking continued:
[mailer.git] / doubler.php
index 403009eb184a3b140e8a02000a1ec06889a40f2d..16aceb6e3eaf93baa3566f8987054c89159d4308 100644 (file)
@@ -98,12 +98,13 @@ if (isFormSent()) {
                        // So let's continue with probing his points amount
                        if (($points - getConfig('doubler_left') - postRequestParameter('points') * getConfig('doubler_charge') / 100) >= 0) {
                                // Enough points are left so let's continue with the doubling process
-                               // Create doubling "account" width *DOUBLED* points
-                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES ('%s','%s','%s','".detectRemoteAddr()."', UNIX_TIMESTAMP(), 'N','N')",
+                               // Create doubling "account" with *DOUBLED* points
+                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(), 'N','N')",
                                        array(
                                                getUserData('userid'),
                                                makeDatabaseUserId(determineReferalId()),
-                                               bigintval(postRequestParameter('points') * 2)
+                                               bigintval(postRequestParameter('points') * 2),
+                                               detectRemoteAddr()
                                        ), __FILE__, __LINE__);
 
                                // Subtract entered points
@@ -117,10 +118,11 @@ if (isFormSent()) {
                                // Add second line for the referal but only when userid != refid
                                if ((isValidUserId(determineReferalId())) && (determineReferalId() != getUserData('userid'))) {
                                        // Okay add a refid line and apply refid percents
-                                       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES ('%s',0,'%s','".detectRemoteAddr()."',UNIX_TIMESTAMP(),'N','Y')",
+                                       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES (%s,0,%s,'%s',UNIX_TIMESTAMP(),'N','Y')",
                                                array(
                                                        makeDatabaseUserId(determineReferalId()),
-                                                       bigintval(postRequestParameter('points') * 2 * getConfig('doubler_ref') / 100)
+                                                       (postRequestParameter('points') * 2 * getConfig('doubler_ref') / 100),
+                                                       detectRemoteAddr()
                                                ), __FILE__, __LINE__);
 
                                        // And that's why we don't want to you more than one referal level of doubler-points. ^^^