1
<?php
2
/**
3
 *   File functions:
4
 *   Game staff list
5
 *
6
 *   @name                 : stafflist.php                            
7
 *   @copyright            : (C) 2006 Vallheru Team based on Gamers-Fusion ver 2.5
8
 *   @author               : thindil <thindil@users.sourceforge.net>
9
 *   @version              : 1.2
10
 *   @since                : 15.07.2006
11
 *
12
 */
13
14
//
15
//
16
//       This program is free software; you can redistribute it and/or modify
17
//   it under the terms of the GNU General Public License as published by
18
//   the Free Software Foundation; either version 2 of the License, or
19
//   (at your option) any later version.
20
//
21
//   This program is distributed in the hope that it will be useful,
22
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
23
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
//   GNU General Public License for more details.
25
//
26
//   You should have received a copy of the GNU General Public License
27
//   along with this program; if not, write to the Free Software
28
//   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
29
//
30
// $Id: stafflist.php 483 2006-07-15 08:30:20Z thindil $
31
32
$title = "Sala audiencyjna";
33
$title1 = $title;
34
require_once("includes/head.php");
35
36
/**
37
* Get the localization for game
38
*/
39
require_once("languages/".$player -> lang."/stafflist.php");
40
41
if ($player -> location != 'Altara' && $player -> location != 'Ardulith') 
42
{
43
    error (ERROR);
44
}
45
46
$arrStafflist = array(array(array(),
47
                            array()),
48
                      array(array(),
49
                            array()),
50
                      array(array(),
51
                            array()),
52
                      array(array(),
53
                            array()),
54
                      array(array(),
55
                            array()),
56
                      array(array(),
57
                            array()),
58
                      array(array(),
59
                            array()),
60
                      array(array(),
61
                            array()),
62
                      array(array(),
63
                            array()));
64
$arrKey = array(0, 0, 0, 0, 0, 0, 0, 0, 0);
65
$arrNames = array('Admin', 'Staff', 'Karczmarka', 'Bibliotekarz', 'Marszałek Rady', 'Poseł', 'Redaktor', 'Rycerz', 'Dama'); 
66
$objStafflist = $db -> Execute("SELECT `id`, `user`, `rank` FROM `players` WHERE `rank`='Admin' OR `rank`='Staff' OR `rank`='Karczmarka' OR `rank`='Bibliotekarz' OR `rank`='Marszałek Rady' OR `rank`='Poseł' OR `rank`='Redaktor' OR `rank`='Rycerz' OR `rank`='Dama'") or die("Błąd!");
67
while (!$objStafflist -> EOF)
68
{
69
    $intKey = array_search($objStafflist -> fields['rank'], $arrNames);
70
    $intKey2 = $arrKey[$intKey];
71
    $arrStafflist[$intKey][0][$intKey2] = $objStafflist -> fields['id'];
72
    $arrStafflist[$intKey][1][$intKey2] = $objStafflist -> fields['user'];
73
    $arrKey[$intKey] = $intKey2 + 1;
74
    $objStafflist -> MoveNext();
75
}
76
$objStafflist -> Close();
77
$arrSecnames = array(SEC_NAME1, SEC_NAME2, SEC_NAME3, SEC_NAME4, SEC_NAME5);
78
$arrRanks = array(KINGS, STAFF, INNKEEP, LIBRARIANS, M_COUNT, COUNT, REDACTOR, KNIGHTS, LADIES);
79
80
/**
81
* Assign variables to template and display page
82
*/
83
$smarty -> assign(array("Listinfo" => LIST_INFO,
84
                        "Secnames" => $arrSecnames,
85
                        "Stafflist" => $arrStafflist,
86
                        "Ranknames" => $arrRanks,
87
                        "Sec3desc" => SEC3_DESC,
88
                        "Sec3desc2" => SEC3_DESC2,
89
                        "Pllocation" => $player -> location));
90
$smarty -> display ('stafflist.tpl');
91
92
require_once("includes/foot.php");
93
?>