Ejemplo n.º 1
0
 /**
  * @return bool
  */
 private function dkplisting(viewNavigation $Navigation)
 {
     global $user, $config, $template;
     if ($config['bbdkp_epgp'] == '1') {
         $this->memberlist = $this->PointsController->listEPGPaccounts($this->start, true);
     } else {
         $this->memberlist = $this->PointsController->listdkpaccounts($this->start, true);
     }
     if (count($this->memberlist[0]) == 0) {
         $output = array('S_DISPLAY_STANDINGS' => true);
         $template->assign_vars($output);
         return;
     }
     //all time guild raidcount
     $Guild_raidcount = $this->Raids->raidcount($this->PointsController->dkpsys_id, 0, 0, 1, true, $this->PointsController->guild_id);
     $current_order = $this->memberlist[1];
     $lines = $this->memberlist[2];
     // all accounts
     $membersids = array();
     if ($lines > 0) {
         foreach ($this->memberlist[0] as $member_id => $dkp) {
             $dkp['ATTENDANCE'] = $Guild_raidcount > 0 ? number_format($dkp['RAIDCOUNT'] / $Guild_raidcount, 4) * 100 : 0;
             $template->assign_block_vars('members_row', $dkp);
             $membersids[$member_id] = 1;
         }
         if ($this->PointsController->member_filter != '') {
             $pagination = generate_pagination(append_sid($this->u_listmemberdkp, "i=dkp_mdkp&mode=mm_listmemberdkp&member_name=" . $this->PointsController->member_filter . "&o=" . $current_order['uri']['current']), $lines, $config['bbdkp_user_llimit'], $this->start, true, 'start');
         } else {
             $pagination = generate_pagination(append_sid($this->u_listmemberdkp, "i=dkp_mdkp&mode=mm_listmemberdkp&o=" . $current_order['uri']['current']), $lines, $config['bbdkp_user_llimit'], $this->start, true, 'start');
         }
     }
     $output = array('IDLIST' => implode(",", $membersids), 'BUTTON_NAME' => $user->lang['DELETE'], 'BUTTON_VALUE' => $user->lang['DELETE_SELECTED_MEMBERS'], 'O_NAME' => $this->u_listmemberdkp . "&o=" . $current_order['uri'][1], 'O_RANK' => $this->u_listmemberdkp . "&o=" . $current_order['uri'][2], 'O_LEVEL' => $this->u_listmemberdkp . "&o=" . $current_order['uri'][3], 'O_CLASS' => $this->u_listmemberdkp . "&o=" . $current_order['uri'][4], 'O_RAIDVALUE' => $this->u_listmemberdkp . "&o=" . $current_order['uri'][5], 'O_ADJUSTMENT' => $this->u_listmemberdkp . "&o=" . $current_order['uri'][10], 'O_SPENT' => $this->u_listmemberdkp . "&o=" . $current_order['uri'][12], 'O_LASTRAID' => $this->u_listmemberdkp . "&o=" . $current_order['uri'][17], 'O_RAIDCOUNT' => $this->u_listmemberdkp . "&o=" . $current_order['uri'][18], 'S_SHOWZS' => $config['bbdkp_zerosum'] == '1' ? true : false, 'S_SHOWDECAY' => $config['bbdkp_decay'] == '1' ? true : false, 'S_SHOWEPGP' => $config['bbdkp_epgp'] == '1' ? true : false, 'S_SHOWTIME' => $config['bbdkp_timebased'] == '1' ? true : false, 'U_LIST_MEMBERDKP' => $this->u_listmemberdkp, 'S_NOTMM' => false, 'S_DISPLAY_STANDINGS' => true, 'LISTMEMBERS_FOOTCOUNT' => sprintf($user->lang['LISTMEMBERS_FOOTCOUNT'], $lines), 'DKPSYS' => $Navigation->getDkpsysId(), 'DKPSYSNAME' => $Navigation->getDkpsysName(), 'DKPPAGINATION' => $pagination, 'MEMBER_NAME' => $this->PointsController->member_filter);
     if ($config['bbdkp_timebased'] == 1) {
         $output['O_TIMEBONUS'] = $this->u_listmemberdkp . "&o=" . $current_order['uri'][6];
     }
     if ($config['bbdkp_zerosum'] == 1) {
         $output['O_ZSBONUS'] = $this->u_listmemberdkp . "&o=" . $current_order['uri'][7];
     }
     if ($config['bbdkp_decay'] == 1) {
         $output['O_RDECAY'] = $this->u_listmemberdkp . "&o=" . $current_order['uri'][9];
         $output['O_IDECAY'] = $this->u_listmemberdkp . "&o=" . $current_order['uri'][13];
     }
     if ($config['bbdkp_epgp'] == 1) {
         $output['O_EP'] = $this->u_listmemberdkp . "&o=" . $current_order['uri'][11];
         $output['O_GP'] = $this->u_listmemberdkp . "&o=" . $current_order['uri'][14];
         $output['O_PR'] = $this->u_listmemberdkp . "&o=" . $current_order['uri'][15];
     } else {
         $output['O_EARNED'] = $this->u_listmemberdkp . "&o=" . $current_order['uri'][8];
         $output['O_CURRENT'] = $this->u_listmemberdkp . "&o=" . $current_order['uri'][16];
     }
     $template->assign_vars($output);
 }
Ejemplo n.º 2
0
 /**
  * list dkp points per pool and member
  */
 private function list_memberdkp()
 {
     global $user, $template, $config, $phpbb_admin_path, $phpEx;
     $pagination = '';
     // guild dropdown
     $submit = isset($_POST['member_guild_id']) ? true : false;
     $Guild = new \bbdkp\controller\guilds\Guilds();
     $guildlist = $Guild->guildlist(1);
     if ($submit) {
         $Guild->guildid = request_var('member_guild_id', 0);
     } else {
         foreach ($guildlist as $g) {
             $Guild->guildid = $g['id'];
             $Guild->name = $g['name'];
             if ($Guild->guildid == 0 && $Guild->name == 'Guildless') {
                 trigger_error('ERROR_NOGUILD', E_USER_WARNING);
             }
             break;
         }
     }
     foreach ($guildlist as $g) {
         $template->assign_block_vars('guild_row', array('VALUE' => $g['id'], 'SELECTED' => $g['id'] == $Guild->guildid ? ' selected="selected"' : '', 'OPTION' => !empty($g['name']) ? $g['name'] : '(None)'));
     }
     $this->PointsController->guild_id = $Guild->guildid;
     $this->PointsController->show_inactive = false;
     /* dkp pool */
     $this->PointsController->query_by_pool = true;
     $this->PointsController->dkpsys_id = 0;
     if (isset($_GET[URI_DKPSYS]) or isset($_POST[URI_DKPSYS])) {
         //user clicked on add raid from event editscreen
         $this->PointsController->dkpsys_id = request_var(URI_DKPSYS, 0);
     }
     if ($this->PointsController->dkpsys_id == 0) {
         if (count((array) $this->PointsController->dkpsys) == 0) {
             trigger_error('ERROR_NOPOOLS', E_USER_WARNING);
         }
         //get default dkp pool
         foreach ($this->PointsController->dkpsys as $pool) {
             if ($pool['default'] == 'Y') {
                 $this->PointsController->dkpsys_id = $pool['id'];
                 break;
             }
         }
         //if still 0 then get first one
         if ($this->PointsController->dkpsys_id == 0) {
             foreach ($this->PointsController->dkpsys as $pool) {
                 $this->PointsController->dkpsys_id = $pool['id'];
                 break;
             }
         }
     }
     foreach ($this->PointsController->dkpsys as $pool) {
         $template->assign_block_vars('dkpsys_row', array('VALUE' => $pool['id'], 'SELECTED' => $pool['id'] == $this->PointsController->dkpsys_id ? ' selected="selected"' : '', 'OPTION' => !empty($pool['name']) ? $pool['name'] : '(None)'));
     }
     /***  end drop-down query ***/
     $start = request_var('start', 0, false);
     $this->PointsController->member_filter = utf8_normalize_nfc(request_var('member_name', '', true));
     if ($this->PointsController->member_filter != '') {
         $this->PointsController->query_by_name = true;
     }
     if ($config['bbdkp_epgp'] == '1') {
         $memberlist = $this->PointsController->listEPGPaccounts($start, true);
     } else {
         $memberlist = $this->PointsController->listdkpaccounts($start, true);
     }
     $current_order = $memberlist[1];
     $lines = $memberlist[2];
     // all accounts
     $membersids = array();
     if ($lines > 0) {
         foreach ($memberlist[0] as $member_id => $dkp) {
             $template->assign_block_vars('members_row', $dkp);
             $membersids[$member_id] = 1;
         }
         if ($this->PointsController->query_by_name == true) {
             $pagination = generate_pagination(append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp_mdkp&mode=mm_listmemberdkp&member_name=" . $this->PointsController->member_filter . "&o=" . $current_order['uri']['current']), $lines, $config['bbdkp_user_llimit'], $start, true, 'start');
         } else {
             $pagination = generate_pagination(append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp_mdkp&mode=mm_listmemberdkp&o=" . $current_order['uri']['current']), $lines, $config['bbdkp_user_llimit'], $start, true, 'start');
         }
     }
     /***  Labels  ***/
     $footcount_text = sprintf($user->lang['LISTMEMBERS_FOOTCOUNT'], $lines);
     $output = array('IDLIST' => implode(",", $membersids), 'F_MEMBERS' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp_mdkp&mode=mm_listmemberdkp&") . '&mode=mm_editmemberdkp', 'L_TITLE' => $user->lang['ACP_DKP_LISTMEMBERDKP'], 'L_EXPLAIN' => $user->lang['ACP_MM_LISTMEMBERDKP_EXPLAIN'], 'BUTTON_NAME' => 'delete', 'BUTTON_VALUE' => $user->lang['DELETE_SELECTED_MEMBERS'], 'O_NAME' => $current_order['uri'][1], 'O_RANK' => $current_order['uri'][2], 'O_LEVEL' => $current_order['uri'][3], 'O_CLASS' => $current_order['uri'][4], 'O_RAIDVALUE' => $current_order['uri'][5], 'O_ADJUSTMENT' => $current_order['uri'][10], 'O_SPENT' => $current_order['uri'][12], 'O_LASTRAID' => $current_order['uri'][17], 'S_SHOWZS' => $config['bbdkp_zerosum'] == '1' ? true : false, 'S_SHOWDECAY' => $config['bbdkp_decay'] == '1' ? true : false, 'S_SHOWEPGP' => $config['bbdkp_epgp'] == '1' ? true : false, 'S_SHOWTIME' => $config['bbdkp_timebased'] == '1' ? true : false, 'U_LIST_MEMBERDKP' => append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp_mdkp&" . URI_DKPSYS . "=" . $this->PointsController->dkpsys_id . "&mode=mm_listmemberdkp") . '&mod=list&', 'S_NOTMM' => false, 'LISTMEMBERS_FOOTCOUNT' => $footcount_text, 'DKPSYS' => $this->PointsController->dkpsys_id, 'DKPSYSNAME' => $this->PointsController->dkpsys[$this->PointsController->dkpsys_id]['name'], 'PAGINATION' => $pagination, 'MEMBER_NAME' => $this->PointsController->member_filter);
     if ($config['bbdkp_timebased'] == 1) {
         $output['O_TIMEBONUS'] = $current_order['uri'][6];
     }
     if ($config['bbdkp_zerosum'] == 1) {
         $output['O_ZSBONUS'] = $current_order['uri'][7];
     }
     if ($config['bbdkp_decay'] == 1) {
         $output['O_RDECAY'] = $current_order['uri'][9];
         $output['O_IDECAY'] = $current_order['uri'][13];
     }
     if ($config['bbdkp_epgp'] == 1) {
         $output['O_EP'] = $current_order['uri'][11];
         $output['O_GP'] = $current_order['uri'][14];
         $output['O_PR'] = $current_order['uri'][15];
     } else {
         $output['O_EARNED'] = $current_order['uri'][8];
         $output['O_CURRENT'] = $current_order['uri'][16];
     }
     $template->assign_vars($output);
 }