lopik mysql_query SELECT image time FROM bonus WHERE time tm and typ a

 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
$lopik = mysql_query("SELECT image,time FROM `bonus` WHERE `time` > ".$tm." and `typ`!='1' and `usr` = ".$user['id']."");
echo'<div class="float-right">';
While($bonik = mysql_fetch_array($lopik)){
echo'<img src="/images/bonus/'.$bonik['image'].'.png" width="15" height="15">';
if($bonik['image']==14){
$recharge = $bonik['time'] - $tm;
$hours = floor($recharge / 3600);
if($hours > 0 && $hours < 10){
$h = '0'.$hours.'';
} elseif($hours >= 10){
$h = $hours;
} else {
$h = 00;
}
$minutes = floor($recharge / 60) % 60;
if($minutes > 0 && $minutes < 10){
$m = '0'.$minutes.'';
} elseif ($minutes >= 10){
$m = $minutes;
} else {
$m = 00;
}
$seconds = $recharge - $minutes*60 - $hours*3600;
if($seconds > 0 && $seconds < 10){
$s='0'.$seconds.'';
} elseif ($seconds >= 10){
$s = $seconds;
} else {
$s = 00;
}
if($h == 0){
echo''.$m.':'.$s.' ';
} else {
echo''.$h.':'.$m.':'.$s.' ';
}
}
}
echo'</div>';