Relja12
February 20, 2018, 10:45pm
1
Hey guys!
I have a problem when coding this:
\<li class="list-group-item"\> \<b\>Rank Progress\</b\> \<div style="width: 80%;display: inline;" class="progress-group"\> \<span class="progress-number"\>XX%\</span\> \<div class="progress sm"\> \<div class="progress-bar progress-bar-blue-light" style="width: XX%"\>\</div\> \</div\> \</div\> \</li\>
I want to add code to display precentage to next rank and progress bar with it. Does someone have an idea? I would appreciate any help!
Thanks,
Relja
Relja12
February 21, 2018, 9:47pm
3
Hey web541,
Thank you for getting back to me. But as I am new to coding all those stuff, I dont understand what they want to say. If you could specify what do I have to edit in my code or is it even possible to use it?
Thank you again,
Relja
Try this
\<li class="list-group-item"\> \<b\>Rank Progress\</b\> \<?php $percentage = ($pilot\_hours/$nextrank-\>minhours) \* 100; ?\> \<?php $round = round($percentage); ?\> \<div style="width: 80%;display: inline;" class="progress-group"\> \<span class="progress-number"\>\<?php echo $round ?\>% Completed\</span\> \<div class="progress sm"\> \<div class="progress-bar progress-bar-blue-light" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style='width: ", \<?php echo $round ?\>, "%'\>\</div\> \</div\> \</div\> \</li\>
Code by: Alp Yeni
Relja12
February 21, 2018, 10:36pm
5
Hi Carlos,
First of all, thank you for your response. Now, I get this in place where progress bar should be:
Rank Progress //Calculate percentage to next rank. // Round percentage because xxx.x% is not good for CSS. 4% Completed // Progress bar percentage // Create progress bar // Progress bar inner
Please, refresh the page, and get the code again.
Relja12
February 21, 2018, 10:47pm
7
Okay, now the code works but for some reason progress bar is missing. Any idea?
Try this:
\<li class="list-group-item"\> \<b\>Rank Progress\</b\> \<?php $percentage = ($pilot\_hours/$nextrank-\>minhours) \* 100; ?\> \<?php $round = round($percentage); ?\> \<div style="width: 80%;display: inline;" class="progress-group"\> \<span class="progress-number"\>\<?php echo $round ?\>% Completed\</span\> \<div class="progress sm"\> \<?php echo "\<div class='progress-bar progress-bar-blue-light' role='progressbar' aria-valuenow='60' aria-valuemin='0' aria-valuemax='100' style='width: ", $round, "%'\>\</div\>"; // Progress bar inner ?\> \</div\> \</div\> \</li\>
1 Like
Relja12
February 21, 2018, 10:53pm
9
Now it works perfectly fine! Thank you very much Carlos!
Best regards,
Relja