bonusik mysql_query SELECT id image time FROM bonus WHERE time _SERVER

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