My progress bars are always showing 100% that everything is full even when I hover over them its everything is 100/100 this is what I have as of now
energy = 100 & maxenergy = 100(when there full)
right now its energy = 50 & maxenergy = 100(there still showing 100% full)
/*energy bars*/
.bar_a{
border: 1px solid #4CAf50;
padding: 2px;
width: 150px;
height: 10;
background-color: #ffffff;
border-radius: 6px;
}
.bar_b{
font-size: 10px;
height: 10;
background-color: #4CAF50;
}
for the php values I have
$is = $db->query("SELECT `u`.*, `us`.* FROM `users` AS `u` INNER JOIN `userstats` AS `us` ON `u`.`userid`=`us`.`userid` WHERE `u`.`userid` = {$userid} LIMIT 1"); $ir = $db->fetch_row($is);
$enperc = min((int) ($ir['energy'] / $ir['maxenergy'] * 100), 100);
$enopp = 100 - $enperc;
and for the rest of the php as in the bars them self
<a title = "Refill Your energy!" href="creditrader?spend=energy"><b>Energy</b></a>
<div class="bar_a" title="Energy: '.$ir['energy'].'/'.$ir['maxenergy'].' ('.$enperc.'%)">
<div class="bar_b" style="width: '.$enperc.'%;" title="Energy: '.$ir['energy'].'/'.$ir['maxenergy'].' ('.$enperc.'%)" align="center">'.$ir['energy'].'/'.$ir['maxenergy'].'('.$enperc.'%)</div>
</div>
I have 4 different bars that's one of the 4 and they are all having the same issue one of them are even in the negatives and its still showing 100/100 (100%)
</div>