Some PHP help

Scorpion Ghost

Elite Member
Executive VIP
Jr. VIP
Joined
Mar 22, 2013
Messages
9,144
Reaction score
10,489
So we have this code:

PHP:
<?php
    global $user_ID;
    $revenues = ae_credit_balance_info($user_ID);
    $total_earned = mje_format_price($revenues['working']->balance + $revenues['available']->balance +$revenues['freezable']->balance);
?>

<div class="revenues box-shadow">
    <div class="title"><?php _e('Balance', 'enginethemes'); ?> - <span class="sub"><a href="javascript:void(0)" class="topup-user-show"><?php _e( 'Top-up History', 'enginethemes' ); ?></a></span></div>

   
    <?php echo apply_filters('revenue_total_balance',$content="", $total_earned);  ?>
   
    <?php echo apply_filters('revenue_withdraw_spent',$content="", $revenues['withdrew_text'], $revenues['checkout_text']);  ?>
</div>

And it creates this:

321222.PNG


If we turn it into this code:

PHP:
<?php
    global $user_ID;
    $revenues = ae_credit_balance_info($user_ID);
    $total_earned = mje_format_price($revenues['working']->balance + $revenues['available']->balance +$revenues['freezable']->balance);
?>

<div class="revenues box-shadow">
    <div class="title"><?php _e('Balance', 'enginethemes'); ?> - <span class="sub"><a href="javascript:void(0)" class="topup-user-show"><?php _e( 'Top-up History', 'enginethemes' ); ?></a></span></div>
   
   
    <?php echo apply_filters('revenue_withdraw_spent',$content="", $revenues['withdrew_text'], $revenues['checkout_text']);  ?>
</div>

It makes this:

888.PNG


Looks good. But what I would like is for "WITHDRAWN: $0.00" to become "Total Balance: $45.00"

Maybe it's simple or maybe it's complicated. It feels simple, but then every damn thing I tried either removes something or just breaks half the page. The fact that there's no "WITHDRAWN" text anywhere in the PHP file makes me think that entire thing gets created from someplace else, and that makes it complicated then.

Can anyone help?
 
You to need create a database for PHP to pull the data from OP.Learn MySQL and learn some SQL to create the queries for the database.
 
Well so I used notepad++ to search all the files for WITHDRAWN, and found it:

PHP:
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 withdrew-text">
                        <span class="total-currency"><?php _e('WITHDRAWN:', 'enginethemes');?></span>
                        <span class="mje-price-text"> <?php echo $withdrew_text; ?></span>
                    </div>

Changed it to this:

PHP:
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 withdrew-text">
                        <span class="total-currency"><?php _e('Available Funds:', 'enginethemes');?></span>
                        <span class="mje-price-text"> <?php echo $withdrew_text; ?></span>
                    </div>

We got:

777.PNG


Okay, one step closer.

But I still can't figure out how to call the actual AVAILABLE FUNDS amount there.

I tried this:

PHP:
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 withdrew-text">
                        <span class="total-currency"><?php _e('Available Funds:', 'enginethemes');?></span>
                        <span class="mje-price-text"> <?php echo $total_earned; ?></span>
                    </div>

Fail

666.PNG
 
You to need create a database for PHP to pull the data from OP.Learn MySQL and learn some SQL to create the queries for the database.

With all due respect bro, I really don't think all that is necessary in this case. Sounds like a bit overkill :D
 
I did it!

PHP:
<?php
    global $user_ID;
    $revenues = ae_credit_balance_info($user_ID);
    $total_earned = mje_format_price($revenues['working']->balance + $revenues['available']->balance +$revenues['freezable']->balance);
?>

<div class="revenues box-shadow">
    <div class="title"><?php _e('Balance', 'enginethemes'); ?> - <span class="sub"><a href="javascript:void(0)" class="topup-user-show"><?php _e( 'Top-up History', 'enginethemes' ); ?></a></span></div>
    
    

<?php echo apply_filters('revenue_withdraw_spent',$content="", $revenues['available_text'], $revenues['checkout_text']);  ?>

</div>

I also used my CSS expertise (haha expertise funny :p ), and now we have this:

coool.PNG


And you guys get an F for helping out ahahahaa :p
 
Back
Top