Jump to content
Relja12

Rank progress

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@Relja12 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

Edited by CarlosEduardo2409

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

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>

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...