-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclassi_dettaglio_competenze_OLD.php
160 lines (148 loc) · 3.5 KB
/
classi_dettaglio_competenze_OLD.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
$query="
SELECT *
FROM srd35_equipment
WHERE family='Armor and Shields' OR family='Weapons'
";
$result=mysql_query($query);
$combatGear=array(
"weapons"=>array(
"simple"=>array(
"unarmed"=>array(),
"melee_light"=>array(),
"melee_onehanded"=>array(),
"melee_twohanded"=>array(),
"ranged"=>array(),
),
"martial"=>array(
"melee_light"=>array(),
"melee_onehanded"=>array(),
"melee_twohanded"=>array(),
"ranged"=>array(),
),
"exotic"=>array(
"melee_light"=>array(),
"melee_onehanded"=>array(),
"melee_twohanded"=>array(),
"ranged"=>array(),
),
),
"armors_and_shields"=>array(
"armors"=>array(
"light"=>array(),
"medium"=>array(),
"heavy"=>array(),
),
"shields"=>array(),
"extras"=>array(),
)
);
while($row=mysql_fetch_assoc($result)){
$keys=array();
switch($row[category]){
case"Simple Weapons": $keys[]="weapons";$keys[]="simple"; break;
case"Martial Weapons": $keys[]="weapons";$keys[]="martial"; break;
case"Exotic Weapons": $keys[]="weapons";$keys[]="exotic"; break;
case"Armor": $keys[]="armors_and_shields"; break;
}
switch($row[subcategory]){
case"Unarmed Attacks": $keys[]="unarmed"; break;
case"Light Melee Weapons": $keys[]="melee_light"; break;
case"One-Handed Melee Weapons": $keys[]="melee_onehanded"; break;
case"Two-Handed Melee Weapons": $keys[]="melee_twohanded"; break;
case"Ranged Weapons": $keys[]="ranged"; break;
case"Ammunition": $keys[]="ranged"; break;
case"Light armor": $keys[]="armors";$keys[]="light"; break;
case"Medium armor": $keys[]="armors";$keys[]="medium"; break;
case"Heavy armor": $keys[]="armors";$keys[]="heavy"; break;
case"Shields": $keys[]="shields"; break;
case"Extras": $keys[]="extras"; break;
}
$rif=&$combatGear;
foreach($keys as $k)if(isset($rif[$k]))$rif=&$rif[$k];
$rif[$row[id]]=$row;
}
$BODY.='<style>
.combatGear UL{
margin:0 0 0 1em;padding:0;list-style:none;
}
.combatGear .col{
width:30%;margin-left:1em;
}
.combatGear H3{
margin-top:0;
}
.combatGear LABEL{
display:block;
}
.combatGear LABEL:hover{background:#eee;}
</style>';
foreach($combatGear as $famk=>$famv){
$BODY.='<h2>'.$famk.'</h2>';
$BODY.='<div class="row combatGear">';
foreach($famv as $catk=>$catv){
$BODY.='<div class="col">';
$BODY.='<h3>';
$BODY.='<label>';
$BODY.='<input type="checkbox">';
$BODY.=' ';
$BODY.=$catk;
$BODY.='</label>';
$BODY.='</h3>';
foreach($catv as $subk=>$subv){
$firstchildskey=$subk;
break;
}
if(is_numeric($firstchildskey))$BODY.='<ul>';
foreach($catv as $subk=>$subv){
if(!is_numeric($subk)){
$BODY.='<label>';
$BODY.='<input type="checkbox">';
$BODY.=' ';
$BODY.='<em>'.$subk.'</em>';
$BODY.='</label>';
$BODY.='<ul>';
foreach($subv as $id=>$item){
$BODY.='<li>';
$BODY.='<label>';
$BODY.='<input type="checkbox">';
$BODY.=' ';
$BODY.=$item['name_'.$_MEPHIT[lang]];
$BODY.='</label>';
$BODY.='</li>';
}
$BODY.='</ul>';
}else{
$BODY.='<li>'.$subv['name_'.$_MEPHIT[lang]].'</li>';
}
}
if(is_numeric($firstchildskey))$BODY.='</ul>';
$BODY.='</div>';
}
$BODY.='</div>';
}
$BODY.='<div id="theProficiencies">';
$BODY.='</div>';
/*
family
Armor and Shields
Weapons
category
Simple Weapons
Martial Weapons
Exotic Weapons
Armor
subcategory
Unarmed Attacks
Light Melee Weapons
One-Handed Melee Weapons
Two-Handed Melee Weapons
Ranged Weapons
Ammunition
Light armor
Medium armor
Heavy armor
Shields
Extras
*/
?>