1
<?php
2
/**
3
 *   File functions:
4
 *   Show players minerals, herbs, gold and maps
5
 *
6
 *   @name                 : zloto.php
7
 *   @copyright            : (C) 2004,2005,2006 Vallheru Team based on Gamers-Fusion ver 2.5
8
 *   @author               : thindil <thindil@users.sourceforge.net>
9
 *   @version              : 1.0
10
 *   @since                : 24.01.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: zloto.php 566 2006-09-13 09:31:08Z thindil $
31
32
$title = "Zasoby";
33
require_once("includes/head.php");
34
35
/**
36
* Get the localization for game
37
*/
38
require_once("languages/".$player -> lang."/zloto.php");
39
40
$gr1 = $db -> Execute("SELECT id, nutari, illani, illanias, dynallca, illani_seeds, illanias_seeds, nutari_seeds, dynallca_seeds FROM herbs WHERE gracz=".$player -> id);
41
$ref = $db -> Execute("SELECT refs FROM players WHERE id=".$player -> id);
42
$ref = $ref -> fields['refs'];
43
$smarty -> assign(array("Refs" => $ref,
44
    "Maps" => $player -> maps,
45
    "Gold" => $player -> credits,
46
    "Bank" => $player -> bank,
47
    "Mithril" => $player -> platinum,
48
    "Itemsinfo" => ITEMS_INFO,
49
    "Goldinhands" => GOLD_IN_HANDS,
50
    "Goldinbank" => GOLD_IN_BANK2,
51
    "Tmithril" => T_MITHRIL,
52
    "Trefs" => T_REFS,
53
    "Tmaps" => T_MAPS,
54
    "Min1" => MIN1,
55
    "Min2" => MIN2,
56
    "Min3" => MIN3,
57
    "Min4" => MIN4,
58
    "Min5" => MIN5,
59
    "Min6" => MIN6,
60
    "Min7" => MIN7,
61
    "Min8" => MIN8,
62
    "Min9" => MIN9,
63
    "Min10" => MIN10,
64
    "Min11" => MIN11,
65
    "Min12" => MIN12,
66
    "Min13" => MIN13,
67
    "Ore1" => ORE1,
68
    "Ore2" => ORE2,
69
    "Ore3" => ORE3,
70
    "Ore4" => ORE4,
71
    "Herb1" => HERB1,
72
    "Herb2" => HERB2,
73
    "Herb3" => HERB3,
74
    "Herb4" => HERB4,
75
    "Seeds1" => SEEDS1,
76
    "Seeds2" => SEEDS2,
77
    "Seeds3" => SEEDS3,
78
    "Seeds4" => SEEDS4,
79
    "Minerals" => MINERALS,
80
    "Money" => MONEY,
81
    "Lumber" => LUMBER,
82
    "Seeds" => SEEDS,
83
    "Herbs" => HERBS));
84
85
if ($gr1 -> fields['id'])
86
{
87
    $smarty -> assign(array("Illani" => $gr1 -> fields['illani'],
88
                            "Illanias" => $gr1 -> fields['illanias'],
89
                            "Nutari" => $gr1 -> fields['nutari'],
90
                            "Dynallca" => $gr1 -> fields['dynallca'],
91
                            "Ilaniseeds" => $gr1 -> fields['illani_seeds'],
92
                            "Illaniasseeds" => $gr1 -> fields['illanias_seeds'],
93
                            "Nutariseeds" => $gr1 -> fields['nutari_seeds'],
94
                            "Dynallcaseeds" => $gr1 -> fields['dynallca_seeds']));
95
}
96
    else
97
{
98
    $smarty -> assign(array("Illani" => 0,
99
                            "Illanias" => 0,
100
                            "Nutari" => 0,
101
                            "Dynallca" => 0,
102
                            "Ilaniseeds" => 0,
103
                            "Illaniasseeds" => 0,
104
                            "Nutariseeds" => 0,
105
                            "Dynallcaseeds" => 0));
106
}
107
108
$objOres = $db -> Execute("SELECT owner, copperore, zincore, tinore, ironore, coal, copper, bronze, brass, iron, steel, pine, hazel, yew, elm, crystal, adamantium, meteor FROM minerals WHERE owner=".$player -> id) or die($db -> ErrorMsg());
109
if ($objOres -> fields['owner'])
110
{
111
    $smarty -> assign(array("Copperore" => $objOres -> fields['copperore'],
112
        "Zincore" => $objOres -> fields['zincore'],
113
        "Tinore" => $objOres -> fields['tinore'],
114
        "Ironore" => $objOres -> fields['ironore'],
115
        "Coal" => $objOres -> fields['coal'],
116
        "Copper" => $objOres -> fields['copper'],
117
        "Iron" => $objOres -> fields['iron'],
118
        "Bronze" => $objOres -> fields['bronze'],
119
        "Brass" => $objOres -> fields['brass'],
120
        "Steel" => $objOres -> fields['steel'],
121
        "Pine" => $objOres -> fields['pine'],
122
        "Hazel" => $objOres -> fields['hazel'],
123
        "Yew" => $objOres -> fields['yew'],
124
        "Elm" => $objOres -> fields['elm'],
125
        "Crystal" => $objOres -> fields['crystal'],
126
        "Adamantium" => $objOres -> fields['adamantium'],
127
        "Meteor" => $objOres -> fields['meteor']));
128
}
129
    else
130
{
131
    $smarty -> assign(array("Copperore" => 0,
132
        "Zincore" => 0,
133
        "Tinore" => 0,
134
        "Ironore" => 0,
135
        "Coal" => 0,
136
        "Copper" => 0,
137
        "Iron" => 0,
138
        "Bronze" => 0,
139
        "Brass" => 0,
140
        "Steel" => 0,
141
        "Pine" => 0,
142
        "Hazel" => 0,
143
        "Yew" => 0,
144
        "Elm" => 0,
145
        "Crystal" => 0,
146
        "Adamantium" => 0,
147
        "Meteor" => 0));
148
}
149
$objOres -> Close();
150
151
$smarty -> display ('zloto.tpl');
152
153
require_once("includes/foot.php");
154
?>