function getMedal if this- res if this- res my_rate medal null if this

 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
<?
function getMedal()
{
if ($this->res) {
if ($this->res['my_rate'] < 3) {
$medal = null;
}
if ($this->res['my_rate'] >= 3 && $this->res['my_rate'] < 6) {
$medal = ' <img src="/style/m/b.png" alt="" class="icon"/>';
} else {
if ($this->res['my_rate'] >= 6 && $this->res['my_rate'] < 12) {
$medal = ' <img src="/style/m/s.png" alt="" class="icon"/>';
} else {
if ($this->res['my_rate'] >= 12 && $this->res['my_rate'] < 24) {
$medal = ' <img src="/style/m/z.png" alt="" class="icon"/>';
} else {
if ($this->res['my_rate'] >= 24 && $this->res['my_rate'] < 48) {
$medal = ' <img src="/img/star_bronze.png" alt="" class="icon"/>';
} else {
if ($this->res['my_rate'] >= 48 && $this->res['my_rate'] < 92) {
$medal = ' <img src="/img/star_silver.png" alt="" class="icon"/>';
} else {
if ($this->res['my_rate'] >= 92 && $this->res['my_rate'] < 150) {
$medal = ' <img src="/img/star_gold.png" alt="" class="icon"/>';
} else {
if ($this->res['my_rate'] >= 150 && $this->res['my_rate'] < 200) {
$medal = ' <img src="/img/crown_bronze.png" alt="" class="icon"/>';
} else {
if ($this->res['my_rate'] >= 200 && $this->res['my_rate'] < 250) {
$medal = ' <img src="/img/crown_silver.png" alt="" class="icon"/>';
} else {
if ($this->res['my_rate'] >= 250 && $this->res['my_rate'] < 300) {
$medal = ' <img src="/img/crown.png" alt="" class="icon"/>';
} else {
if ($this->res['my_rate'] >= 300) {
$medal = ' <img src="/img/crown.png" alt="" class="icon"/>';
}
//if ($this->res['id'] == 1) {
//$medal = ' <img src="/img/box.png" alt="" class="icon"/>';
//}
}
}
}
}
}
}
}
}
}
return $medal;
} else {
return '';
}
}