X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_rallyes.php;h=c4344ab7fe1cf49bfc8fdf45379bb847021822b6;hb=98b92ea5ba992a63304091fa1b57f477befffc22;hp=81cc4ae8aeb05aba9c2f840438632f87eae34dff;hpb=f2aeaab0cd313b2eeb151642455ed558f6b186dc;p=mailer.git diff --git a/inc/modules/admin/what-list_rallyes.php b/inc/modules/admin/what-list_rallyes.php index 81cc4ae8ae..c4344ab7fe 100644 --- a/inc/modules/admin/what-list_rallyes.php +++ b/inc/modules/admin/what-list_rallyes.php @@ -104,7 +104,7 @@ if (isGetRequestParameterSet('rallye')) { runFilterChain('run_sqls'); } elseif (isFormSent('remove')) { // Delete rallyes - if (countPostSelection() > 0) { + if (ifPostContainsSelections()) { // Init SQLs initSqls(); @@ -130,7 +130,7 @@ if (isGetRequestParameterSet('rallye')) { } } elseif (isFormSent('change')) { // Change rallye - if (countSelection(postRequestParameter('title')) > 0) { + if (ifPostContainsSelections('title')) { // Init SQLs initSqls(); @@ -179,9 +179,9 @@ LIMIT 1", if (isFormSent('edit')) { // Check for selections - if (countPostSelection() > 0) { + if (ifPostContainsSelections()) { // Make all selected and deactivated rallyes editable - $OUT = ''; $SW = 2; + $OUT = ''; foreach (postRequestParameter('sel') as $id => $selected) { // Load rallye basic data $result = SQL_QUERY_ESC("SELECT @@ -199,31 +199,27 @@ LIMIT 1", SQL_FREERESULT($result); // Starting day - $content['s_sec'] = addSelectionBox('sec' , date('s', $content['start_time']), 'start', $id); - $content['s_min'] = addSelectionBox('min' , date('i', $content['start_time']), 'start', $id); - $content['s_hour'] = addSelectionBox('hour' , date('G', $content['start_time']), 'start', $id); - $content['s_day'] = addSelectionBox('day' , date('d', $content['start_time']), 'start', $id); - $content['s_month'] = addSelectionBox('month', date('m', $content['start_time']), 'start', $id); - $content['s_year'] = addSelectionBox('year' , date('Y', $content['start_time']), 'start', $id); + $content['s_sec'] = addSelectionBox('sec' , getSecond($content['start_time']) , 'start', $id); + $content['s_min'] = addSelectionBox('min' , getMinute($content['start_time']) , 'start', $id); + $content['s_hour'] = addSelectionBox('hour' , getShortHour($content['start_time']), 'start', $id); + $content['s_day'] = addSelectionBox('day' , getDay($content['start_time']) , 'start', $id); + $content['s_month'] = addSelectionBox('month', getMonth($content['start_time']) , 'start', $id); + $content['s_year'] = addSelectionBox('year' , getYear($content['start_time']) , 'start', $id); // Ending day - $content['e_sec'] = addSelectionBox('sec' , date('s', $content['end_time']) , 'end' , $id); - $content['e_min'] = addSelectionBox('min' , date('i', $content['end_time']) , 'end' , $id); - $content['e_hour'] = addSelectionBox('hour' , date('G', $content['end_time']) , 'end' , $id); - $content['e_day'] = addSelectionBox('day' , date('d', $content['end_time']) , 'end' , $id); - $content['e_month'] = addSelectionBox('month', date('m', $content['end_time']) , 'end' , $id); - $content['e_year'] = addSelectionBox('year' , date('Y', $content['end_time']) , 'end' , $id); + $content['e_sec'] = addSelectionBox('sec' , getSecond($content['end_time']) , 'end' , $id); + $content['e_min'] = addSelectionBox('min' , getMinute($content['end_time']) , 'end' , $id); + $content['e_hour'] = addSelectionBox('hour' , getShortHour($content['end_time']) , 'end' , $id); + $content['e_day'] = addSelectionBox('day' , getDay($content['end_time']) , 'end' , $id); + $content['e_month'] = addSelectionBox('month', getMonth($content['end_time']) , 'end' , $id); + $content['e_year'] = addSelectionBox('year' , getYear($content['end_time']) , 'end' , $id); // Remember other values $content['templ'] = addReferalRallyeTemplateSelection('templ['.$id.']', $content['template']); - $content['sw'] = $SW; $content['id'] = $id; // Output row $OUT .= loadTemplate('admin_edit_rallyes_row', true, $content); - - // Color switching - $SW = 3 - $SW; } // END - foreach // Load final template @@ -243,8 +239,8 @@ WHERE ORDER BY `userid` ASC", array(bigintval(getRequestParameter('rallye'))), __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) { - $OUT = ''; $SW = 2; + if (!SQL_HASZERONUMS($result)) { + $OUT = ''; $content['rallye'] = getRequestParameter('rallye'); while ($row = SQL_FETCHARRAY($result)) { // Check for referal count @@ -255,7 +251,10 @@ ORDER BY $br = ''; // Output row - if (($row['curr_points'] > 0) && ($cnt > 0)) { $bl = ''; $br = ''; } + if (($row['curr_points'] > 0) && ($cnt > 0)) { + $bl = ''; + $br = ''; + } // END - if // Get user points $points = countSumTotalData($row['userid'], 'user_points', 'points', 'userid', false, " AND `ref_depth`=1 LIMIT 1"); @@ -263,18 +262,16 @@ ORDER BY // Prepare content $row = array( - 'sw' => $SW , 'userid' => $row['userid'], 'bold_l' => $bl , 'bold_r' => $br , - 'rews' => $row['refs'], + 'refs' => $row['refs'], 'cnt' => $cnt, 'opoints' => ($points - $row['curr_points']), ); // Load row template and switch color $OUT .= loadTemplate('admin_list_rallye_usr_row', true, $row); - $SW = 3 - $SW; } // END - while // Remember rows @@ -301,9 +298,9 @@ ORDER BY `start_time` DESC", __FILE__, __LINE__); // Records found? - if (SQL_NUMROWS($result) > 0) { + if (!SQL_HASZERONUMS($result)) { // List found rallyes - $OUT = ''; $SW = 2; + $OUT = ''; while ($data = SQL_FETCHARRAY($result)) { // Load admin login $data['login'] = getAdminLogin($data['admin_id']); @@ -319,8 +316,6 @@ ORDER BY // Alter some variables if (empty($data['login'])) $data['login'] = '???'; - if (empty($data['template'])) $data['template'] = '---'; - if (empty($data['descr'])) $data['descr'] = '---'; // Transfer data into array for the template $row = array( @@ -328,7 +323,6 @@ ORDER BY 'admin_id' => $data['admin_id'], 'login' => $data['login'], 'id' => $data['id'], - 'sw' => $SW, 'title' => $data['title'], 'template' => $data['template'], 'users_content' => $users, @@ -387,7 +381,6 @@ ORDER BY // Output row $OUT .= loadTemplate('admin_list_rallyes_row', true, $row); - $SW = 3 - $SW; } // END - while // Free memory