-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfonctions.php
More file actions
executable file
·157 lines (110 loc) · 3.91 KB
/
fonctions.php
File metadata and controls
executable file
·157 lines (110 loc) · 3.91 KB
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
<?php
function get_map_name($map_name){
// $map_img_name = get_map_info($map_name)["nom_img"];
include "./maplist.php";
return $maps[$map_name];
}
function liste_map(){
$dir = "./maps";
$liste_maps = scandir($dir);
return ($liste_maps);
}
function single_cree_liste_map($cookiemap){
// $liste_map_tab = liste_map();
include "maplist.php";
//require "ini.php";
$reglage = new reglage();
$langage = $reglage->langage;
$liste_map_tab = $maps[$langage];
if(!isset($liste_map_tab)){
$liste_map_tab = $maps['EN_en'];
}
$selected = '';
foreach ($liste_map_tab as $k => $v) {
// if ($map != '.' && $map != '..') {
$cmd_map = $k;
$map_name = $v[0];
$nbj = $v[1];
$style= ' style="background:url(\'./css/icones/'. $nbj .'.jpg\') no-repeat #29573A; " ';
if ($cmd_map == $cookiemap) {
$selected = ' selected="selected" ';
}
echo '<option
class="map_name"
onmouseover="document.getElementById(\'imgmap\').src = \'./maps/\' +
this.value + \'.jpg\';
document.getElementById(\'meta_map\').innerHTML = modifierInterface.afficherMetaMap(this.value,\''.$langage.'\');"' . $style . $selected . ' id="' . $cmd_map . '"'
. ' value="' . $cmd_map . ''
. '">'. $map_name .'</option>';
$selected = '';
$style = '';
// }
}
}
function cree_list_equipes($cookieequipe){
for($i=1;$i<11;$i++){
$selected = "";
if($cookieequipe == $i){
$selected = ' selected="selected" ';
}
echo '<option '.$selected.' value="'.$i.'">'.$i.' vs '.$i.'</option> ';
}
}
function random_map($langage){
include "maplist.php";
if(!isset($maps[$langage])){
$langage = 'EN_en';
}
$nb_maps = count($maps[$langage]);
$random_nb = rand(0,$nb_maps);
$i=0;
foreach($maps[$langage] as $map_key => $map_name){
if($i == $random_nb){
return $map_key;
}
$i++;
}
}
function cree_select($select_ID, $label_tab, $cookie){
$option_liste = '<!-- Liste des options pour '. $select_ID . '-->';
// $label_tab = [0 => "Automatique", 1 => "Manuel"];
foreach($label_tab as $value => $label){
if($cookie == $value){
$selected = ' selected="selected" ';
}
$option_liste.= '<option value='.$value.' '. $selected . '>' . $label . '</option>';
$selected = '';
}
return $option_liste;
}
function cree_liste_income_rate($mode, $cookie){
$expression = new expressions();
$income_rate_tab = [
$expression->aucun,
$expression->tres_faible,
$expression->faible,
$expression->moyen,
$expression->eleve,
$expression->tres_eleve];
$liste_income = '';
$i=0;
if($mode == 4) {
foreach ($income_rate_tab as $income_rate) {
$selected = '';
if ($cookie == $i) {
$selected = ' selected="selected" ';
}
$liste_income .= '<option ' . $selected . ' value=' . $i . '>' . $income_rate . '</option>';
$i++;
}
} else {
foreach ($income_rate_tab as $income_rate) {
$selected = '';
if ($cookie == $i) {
$selected = ' selected="selected" ';
}
$liste_income .= '<option ' . $selected . ' value=' . $i . '>' . $income_rate . '</option>';
$i++; }
}
echo $liste_income;
}