-
Notifications
You must be signed in to change notification settings - Fork 0
/
listevents.php
137 lines (111 loc) · 4.67 KB
/
listevents.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/******************************
* EQdkp
* Copyright 2002-2003
* Licensed under the GNU GPL. See COPYING for full terms.
* ------------------
* listevents.php
* Began: Fri December 20 2002
*
* $Id: listevents.php 5152 2009-07-03 13:50:19Z ghoschdi $
*
******************************/
define('EQDKP_INC', true);
$eqdkp_root_path = './';
include_once($eqdkp_root_path . 'common.php');
if($conf_plus['pk_noEvents'] == 1) { redirect('viewnews.php');}
$user->check_auth('u_event_list');
$sort_order = array(
0 => array('event_name', 'event_name desc'),
1 => array('event_value desc', 'event_value')
);
$current_order = switch_order($sort_order);
$total_events = $db->query_first('SELECT count(*) FROM ' . EVENTS_TABLE);
$start = $in->get('start', 0);
$sql = 'SELECT event_id, event_name, event_value
FROM ' . EVENTS_TABLE . '
ORDER BY '.$current_order['sql']. '
LIMIT '.$start.','.$user->data['user_elimit'];
if ( !($events_result = $db->query($sql)) )
{
message_die('Could not obtain event information', '', __FILE__, __LINE__, $sql);
}
while ( $event = $db->fetch_record($events_result) )
{
$event_icon = getEventIcon($event['event_name']);
$tpl->assign_block_vars('events_row', array(
'ROW_CLASS' => $eqdkp->switch_row_class(),
'U_VIEW_EVENT' => 'viewevent.php'.$SID . '&' . URI_EVENT . '='.$event['event_id'],
'NAME' => $event_icon.stripslashes($event['event_name']),
'VALUE' => runden($event['event_value']),
'COLOR' => color_item($event['event_value']),
)
);
}
$db->free_result($events_result);
#########
if($conf_plus['pk_multidkp'] == 1)
{
$sql = 'SELECT multidkp_name, multidkp_disc, multidkp_id
FROM ' . MULTIDKP_TABLE . '
WHERE multidkp_name IS NOT NULL'
;
$total_multi = $db->query_first('SELECT count(*) FROM ' . MULTIDKP_TABLE . ' WHERE multidkp_name IS NOT NULL');
$listmulti_footcount = sprintf($user->lang['multi_footcount'], $total_multi, $user->data['user_alimit']);
if ( !($multi_result = $db->query($sql)) )
{
message_die('Could not obtain MultiDKP information', '', __FILE__, __LINE__, $sql);
}
while ( $multi = $db->fetch_record($multi_result) )
{
$sql_events = 'SELECT multidkp2event_multi_id, multidkp2event_eventname
FROM ' . MULTIDKP2EVENTS_TABLE
.' WHERE multidkp2event_multi_id ='.$db->sql_escape($multi['multidkp_id']);
if ( !($multi2event_results = $db->query($sql_events)) )
{
message_die('Could not obta in MultiDKP -> Event information', '', __FILE__, __LINE__, $sql_events);
}
$multi2event = '' ;
while ( $a_multi = $db->fetch_record($multi2event_results) )
{ // gehe alle Events durch, die einem Konto zugewiesen wurden
$multi2event .= $a_multi['multidkp2event_eventname'].' , ' ;
}
# komma am ende entfernen
$multi2event = preg_replace('# \, $#', '', $multi2event);
$tpl->assign_block_vars('multi_row', array(
'ROW_CLASS' => $eqdkp->switch_row_class(),
#'U_ADD_ADMULTI' => (( $s_group_adj ) ? 'addmulti.php' : 'addmulti.php') . $SID.'&' . URI_ADJUSTMENT . '='.$multi['multidkp_id'],
'U_NAME' => $multi['multidkp_name'],
'U_DISC' => $multi['multidkp_disc'],
'U_EVENTS' => $multi2event,
)
);
}
$tpl->assign_vars(array(
'IS_MULTIDKP' => ( $conf_plus['pk_multidkp'] == 1 )? true : false,
'L_MULTI' => $user->lang['Multi_Accs'],
'L_NAME' => $user->lang['Multi_kontoname_short'],
'L_DISC' => $user->lang['Multi_discr'],
'L_EVENTS' => $user->lang['Multi_events'],
'LISTMULTI_FOOTCOUNT' => $listmulti_footcount)
);
$db->free_result($adj_result);
}
############
$tpl->assign_vars(array(
'L_EVETNS' =>$user->lang['menu_events'],
'L_NAME' => $user->lang['name'],
'L_VALUE' => $user->lang['value'],
'O_NAME' => $current_order['uri'][0],
'O_VALUE' => $current_order['uri'][1],
'U_LIST_EVENTS' => 'listevents.php'.$SID.'&',
'START' => $start,
'LISTEVENTS_FOOTCOUNT' => sprintf($user->lang['listevents_footcount'], $total_events, $user->data['user_elimit']),
'EVENT_PAGINATION' => generate_pagination('listevents.php'.$SID.'&o='.$current_order['uri']['current'], $total_events, $user->data['user_elimit'], $start))
);
$eqdkp->set_vars(array(
'page_title' => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['listevents_title'],
'template_file' => 'listevents.html',
'display' => true)
);
?>