Registered Member #1559 Joined: Sat Mar 06 2010, 01:45PM Posts: 34
| I have created a modified version of the page users but you need to have the authentication "( $priv_raids OR ($phpraid_config['enable_five_man'] AND $priv_profile) ".
<?php
/***************************************************************************
* user_signups.php
* -------------------
* begin : Saturday, Jan 16, 2005
* copyright : (C) 2007-2008 Douglas Wagner
* email : <a rel='external' href='javascript:window.location="mai"+"lto:"+"douglasw"+"@"+"wagnerweb.org";self.close();' onmouseover='window.status="mai"+"lto:"+"douglasw"+"@"+"wagnerweb.org"; return true;' onmouseout='window.status="";return true;'>- Send E-Mail -</a>
*
* $Id: users.php,v 2.0 2008/03/08 15:28:46 psotfx Exp $
*
***************************************************************************/
/***************************************************************************
*
* WoW Raid Manager - Raid Management Software for World of Warcraft
* Copyright (C) 2007-2008 Douglas Wagner
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
****************************************************************************/
// commons
define("IN_PHPRAID", true);
require_once('./common.php');
// page authentication
if ($phpraid_config['enable_five_man'])
{
define("PAGE_LVL","profile");
}
else
{
define("PAGE_LVL","raids");
}
require_once("includes/authentication.php");
// Set the Guild Server for the Page.
$server = $phpraid_config['guild_server'];
/*************************************************************
* Setup Record Output Information for Data Table
*************************************************************/
// Set StartRecord for Page
if(!isset($_GET['Base']) || !is_numeric($_GET['Base']))
$startRecord = 1;
else
$startRecord = scrub_input($_GET['Base']);
// Set Sort Field for Page
if(!isset($_GET['Sort'])||$_GET['Sort']=='')
{
$sortField="";
$initSort=FALSE;
}
else
{
$sortField = scrub_input($_GET['Sort']);
$initSort=TRUE;
}
// Set Sort Descending Mark
if(!isset($_GET['SortDescending']) || !is_numeric($_GET['SortDescending']))
$sortDesc = 0;
else
$sortDesc = scrub_input($_GET['SortDescending']);
$pageURL = 'user_signups.php?';
/**************************************************************
* End Record Output Setup for Data Table
**************************************************************/
$user_signups = array();
// get a list of all users and assign permissions accordingly
$sql = "
SELECT *,
(COUNT(".$phpraid_config['db_prefix']."signups.char_id)) as 'total'
FROM ".$phpraid_config['db_prefix']."chars
LEFT JOIN ".$phpraid_config['db_prefix']."signups
ON ".$phpraid_config['db_prefix']."signups.char_id=".$phpraid_config['db_prefix']."chars.char_id
LEFT JOIN ".$phpraid_config['db_prefix']."profile
ON ".$phpraid_config['db_prefix']."chars.profile_id=".$phpraid_config['db_prefix']."profile.profile_id
GROUP BY name
ORDER BY name ASC
";
$result = $db_raid->sql_query($sql) or print_error($sql, mysql_error(), 1);
$sql2 = "
SELECT *,
SUM(IF(queue=1,1,0)) AS 'queue',
SUM(IF(cancel=1,1,0)) AS 'cancel',
SUM(IF(queue=cancel,1,0)) AS 'onraid'
FROM ".$phpraid_config['db_prefix']."chars
LEFT JOIN ".$phpraid_config['db_prefix']."signups
ON ".$phpraid_config['db_prefix']."signups.char_id=".$phpraid_config['db_prefix']."chars.char_id
LEFT JOIN ".$phpraid_config['db_prefix']."profile
ON ".$phpraid_config['db_prefix']."chars.profile_id=".$phpraid_config['db_prefix']."profile.profile_id
GROUP BY name
ORDER BY name ASC
";
$result2 = $db_raid->sql_query($sql2) or print_error($sql2, mysql_error(), 1);
while(($data = $db_raid->sql_fetchrow($result, true)) and ($data2 = $db_raid->sql_fetchrow($result2, true)))
{
$charname = '<!-- ' . mb_strtolower($data['name'], "UTF-8") . ' -->'.$data['name'].'';
$usersname = '<!-- ' . mb_strtolower($data['username'], "UTF-8") . ' -->'.$data['username'].'';
array_push($user_signups,
array(
'ID'=>$data['profile_id'],
'Charname'=>$charname,
'Username'=>$usersname,
'Free text'=>$data['free'],
'Cancel'=>$data2['cancel'],
'Queue'=>$data2['queue'],
'Onraid'=>$data2['onraid'],
'Total'=>$data['total']));
}
/**************************************************************
* Code to setup for a Dynamic Table Create: users1 View.
**************************************************************/
$viewName = 'user_signups1';
//Setup Columns
$user_signups_headers = array();
$record_count_array = array();
$user_signups_headers = getVisibleColumns($viewName);
//Get Record Counts
$users_record_count_array = getRecordCounts($user_signups, $raid_headers, $startRecord);
//Get the Jump Menu and pass it down
$usersJumpMenu = getPageNavigation($user_signups, $startRecord, $pageURL, $sortField, $sortDesc);
//Setup Default Data Sort from Headers Table
if (!$initSort)
foreach ($user_signups_headers as $column_rec)
if ($column_rec['default_sort'])
$sortField = $column_rec['column_name'];
//Setup Data
$user_signups = paginateSortAndFormat($user_signups, $sortField, $sortDesc, $startRecord, $viewName);
/****************************************************************
* Data Assign for Template.
****************************************************************/
$wrmsmarty->assign('user_signups_data', $user_signups);
$wrmsmarty->assign('user_signups_jump_menu', $usersJumpMenu);
$wrmsmarty->assign('column_name', $user_signups_headers);
$wrmsmarty->assign('users_record_counts', $users_record_count_array);
$wrmsmarty->assign('header_data',
array(
'template_name'=>$phpraid_config['template'],
'user_signups_header' => $phprlang['user_signups_header'],
'new_raids_header' => $phprlang['raids_new'],
'sort_url_base' => $pageURL,
'sort_descending' => $sortDesc,
'sort_text' => $phprlang['sort_text'],
)
);
require_once('includes/page_header.php');
$wrmsmarty->display('user_signups.html');
require_once('includes/page_footer.php');
?>
I could not figure out how to get it to be able to sort by a given date range. Now showing on a list from all raids are on the calendar.
Is there perhaps someone who can help with this?
I've attached a picture of how it looks. Image: http://www.wowraidmanager.net/e107_files/public/1274907868_1559_FT4970_user_signups_.jpg
[ Edited Tue Jul 20 2010, 09:42AM ] |