X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_rallyes.php;h=88207882415018499c5e262a5bdb5f4aa48e2cb3;hb=1410e014d23f244e73d3a7916a61c2473416bab9;hp=65cf9f270d6ecba6aacfa69343325ad6289ebf25;hpb=acfb401fcf545c211ed51b8644d0965e35fdad07;p=mailer.git diff --git a/inc/modules/admin/what-list_rallyes.php b/inc/modules/admin/what-list_rallyes.php index 65cf9f270d..8820788241 100644 --- a/inc/modules/admin/what-list_rallyes.php +++ b/inc/modules/admin/what-list_rallyes.php @@ -14,11 +14,9 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -43,7 +41,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { } // END - if // Add description as navigation point -addMenuDescription('admin', __FILE__); +addYouAreHereLink('admin', __FILE__); // Init message $message = ''; @@ -104,7 +102,7 @@ if (isGetRequestParameterSet('rallye')) { runFilterChain('run_sqls'); } elseif (isFormSent('remove')) { // Delete rallyes - if (countPostSelection() > 0) { + if (ifPostContainsSelections()) { // Init SQLs initSqls(); @@ -130,7 +128,7 @@ if (isGetRequestParameterSet('rallye')) { } } elseif (isFormSent('change')) { // Change rallye - if (countSelection(postRequestParameter('title')) > 0) { + if (ifPostContainsSelections('title')) { // Init SQLs initSqls(); @@ -179,7 +177,7 @@ LIMIT 1", if (isFormSent('edit')) { // Check for selections - if (countPostSelection() > 0) { + if (ifPostContainsSelections()) { // Make all selected and deactivated rallyes editable $OUT = ''; foreach (postRequestParameter('sel') as $id => $selected) { @@ -226,7 +224,7 @@ LIMIT 1", loadTemplate('admin_edit_rallyes', false, $OUT); } else { // Nothing selected to edit - loadTemplate('admin_settings_saved', false, '{--RALLYE_NO_RALLYES_SELECTED--}'); + displayMessage('{--RALLYE_NO_RALLYES_SELECTED--}'); } } elseif ((getRequestParameter('sub') == 'users') && (getRequestParameter('rallye') > 0)) { // List users and their refs before start and current @@ -239,19 +237,22 @@ WHERE ORDER BY `userid` ASC", array(bigintval(getRequestParameter('rallye'))), __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) { + if (!SQL_HASZERONUMS($result)) { $OUT = ''; $content['rallye'] = getRequestParameter('rallye'); while ($row = SQL_FETCHARRAY($result)) { // Check for referal count - $cnt = getReferalRallyeRefsCount($row['userid'], $row['refs']); + $count = getReferalRallyeRefsCount($row['userid'], $row['refs']); // Init variables $bl = ''; $br = ''; // Output row - if (($row['curr_points'] > 0) && ($cnt > 0)) { $bl = ''; $br = ''; } + if (($row['curr_points'] > 0) && ($count > 0)) { + $bl = ''; + $br = ''; + } // END - if // Get user points $points = countSumTotalData($row['userid'], 'user_points', 'points', 'userid', false, " AND `ref_depth`=1 LIMIT 1"); @@ -262,8 +263,8 @@ ORDER BY 'userid' => $row['userid'], 'bold_l' => $bl , 'bold_r' => $br , - 'rews' => $row['refs'], - 'cnt' => $cnt, + 'refs' => $row['refs'], + 'cnt' => $count, 'opoints' => ($points - $row['curr_points']), ); @@ -282,7 +283,7 @@ ORDER BY loadTemplate('admin_list_rallye_usr', false, $content); } else { // No entries found? - loadTemplate('admin_settings_saved', false, '{--RALLYE_ADMIN_USERS_404--}'); + displayMessage('{--RALLYE_ADMIN_USERS_404--}'); } } else { // Start listing rallyes @@ -295,13 +296,10 @@ ORDER BY `start_time` DESC", __FILE__, __LINE__); // Records found? - if (SQL_NUMROWS($result) > 0) { + if (!SQL_HASZERONUMS($result)) { // List found rallyes $OUT = ''; while ($data = SQL_FETCHARRAY($result)) { - // Load admin login - $data['login'] = getAdminLogin($data['admin_id']); - // Count joined userids $users = countSumTotalData($data['id'], 'rallye_users', 'id', 'rallye_id', true); @@ -311,14 +309,10 @@ ORDER BY $users = '' . $users . ''; } // END - if - // Alter some variables - if (empty($data['login'])) $data['login'] = '???'; - // Transfer data into array for the template $row = array( - 'select' => '', + 'select' => '', 'admin_id' => $data['admin_id'], - 'login' => $data['login'], 'id' => $data['id'], 'title' => $data['title'], 'template' => $data['template'], @@ -390,7 +384,7 @@ ORDER BY loadTemplate('admin_list_rallyes', false, $content); } else { // No rallyes setup so far - loadTemplate('admin_settings_saved', false, '{--RALLYE_NO_RALLYES_SETUP--}'); + displayMessage('{--RALLYE_NO_RALLYES_SETUP--}'); } }