]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_rallyes.php
HTML->XHTML preparation (still *A LOT* to convert
[mailer.git] / inc / modules / admin / what-list_rallyes.php
index d4e61658fa286837de54baa8440820531e89ed66..554efeaefe9ec6c743440bbce6bbbc2ce2ec5be8 100644 (file)
@@ -38,7 +38,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 }
 
 // Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
+ADD_DESCR("admin", __FILE__);
 
 if (empty($_GET['sub'])) $_GET['sub'] = "";
 $MSG = "";
@@ -108,12 +108,12 @@ if (isset($_GET['rallye']))
                foreach ($_POST['sel'] as $id => $sel)
                {
                        // Remove selected rallye entirely...
-                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_data WHERE id=%s LIMIT 1",
-                        array(bigintval($id)), __FILE__, __LINE__);
-                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s",
-                        array(bigintval($id)), __FILE__, __LINE__);
-                       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s",
-                        array(bigintval($id)), __FILE__, __LINE__);
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_data WHERE id=%s LIMIT 1",
+                               array(bigintval($id)), __FILE__, __LINE__);
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s",
+                               array(bigintval($id)), __FILE__, __LINE__);
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s",
+                               array(bigintval($id)), __FILE__, __LINE__);
                }
 
                // Output message
@@ -142,7 +142,7 @@ if (isset($_GET['rallye']))
                        $END   = mktime($_POST['end_hour'][$id]  , $_POST['end_min'][$id]  , $_POST['end_sec'][$id]  , $_POST['end_month'][$id]  , $_POST['end_day'][$id]  , $_POST['end_year'][$id]  );
 
                        // Update entry
-                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_rallye_data SET
+                       SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_rallye_data SET
 title='%s',
 descr='%s',
 template='%s',
@@ -228,22 +228,23 @@ if (isset($_POST['edit']))
                define('__RALLYE_VALUE', $_GET['rallye']);
                while (list($uid, $old, $opoints) = SQL_FETCHROW($result))
                {
-                       // Check for referral count
+                       // Check for referal count
                        $cnt = RALLYE_GET_REFCOUNT($uid, $old);
 
                        // Output row
                        $Bl = ""; $Br = "";
-                       if (($opoints > 0) && ($cnt > 0)) { $Bl = "<STRONG>"; $Br = "</STRONG>"; }
+                       if (($opoints > 0) && ($cnt > 0)) { $Bl = "<strong>"; $Br = "</strong>"; }
                        if (($old > 0) || ($cnt > 0))
                        {
-                               // Insert link to referral list
+                               // Insert link to referal list
                                //* DEBUG: */ echo "-".$uid."/".$cnt."/".$old."-<br />";
                                $cnt = ADMIN_USER_PROFILE_LINK($uid, $cnt, "list_refs");
                                $old = ADMIN_USER_PROFILE_LINK($uid, $old, "list_refs");
                        }
 
                        // Get user points
-                       $points = GET_TOTAL_DATA($uid, "user_points", "points")  - GET_TOTAL_DATA($uid, "user_data", "used_points");
+                       $points = GET_TOTAL_DATA($uid, "user_points", "points", "userid", false, " AND ref_depth=1 LIMIT 1");
+                       //* DEBUG: */ echo basename(__FILE__).":uid={$uid},points={$points},opoints={$opoints}<br />\n";
                        $content = array(
                                'sw'      => $SW ,
                                'uid'     => $uid,
@@ -299,7 +300,7 @@ ORDER BY start_time DESC",
                        if ($joined > 0)
                        {
                                // List joined users
-                               $joined = "<A href=\"".URL."/modules.php?module=admin&amp;what=list_rallyes&amp;sub=users&amp;rallye=".$id."\" title=\"".RALLYE_LIST_USERS."\">".$joined."</A>";
+                               $joined = "<a href=\"".URL."/modules.php?module=admin&amp;what=list_rallyes&amp;sub=users&amp;rallye=".$id."\" title=\"".RALLYE_LIST_USERS."\">".$joined."</a>";
                        }
 
                        // Alter some variables
@@ -337,14 +338,14 @@ ORDER BY start_time DESC",
                        // Is the rallye active or not?
                        switch ($active)
                        {
-                       case 'Y':
+                       case "Y":
                                // Rallye is active so do not edit it!
-                               $content['select'] = "<STRONG class=\"big\">".$id."</STRONG>";
+                               $content['select'] = "<div class=\"big\">".$id."</strong>";
                                $content['active_title'] = RALLYE_DEACTIVATE_NOW;
                                $content['active'] = 0;
                                break;
 
-                       case 'N':
+                       case "N":
                                $content['active_title'] = RALLYE_ACTIVATE_NOW;
                                $content['active'] = "1";
                                break;
@@ -353,12 +354,12 @@ ORDER BY start_time DESC",
                        // Notification to members?
                        switch ($notify)
                        {
-                       case 'Y':
+                       case "Y":
                                $content['notify_title'] = RALLYE_STOP_NOTIFY_NOW;
                                $content['notify'] = 0;
                                break;
 
-                       case 'N':
+                       case "N":
                                $content['notify_title'] = RALLYE_START_NOTIFY_NOW;
                                $content['notify'] = "1";
                                break;
@@ -367,12 +368,12 @@ ORDER BY start_time DESC",
                        // Auto-add of new joined members?
                        switch ($auto_add)
                        {
-                       case 'Y':
+                       case "Y":
                                $content['auto_title'] = RALLYE_STOP_AUTO_ADD_NOW;
                                $content['auto'] = 0;
                                break;
 
-                       case 'N':
+                       case "N":
                                $content['auto_title'] = RALLYE_START_AUTO_ADD_NOW;
                                $content['auto'] = "1";
                                break;