コード例 #1
0
        ?>
</td>
					<td>
						<?php 
        if (!empty($order->payment_type)) {
            echo $order->payment_type . "<br />";
        }
        ?>
						<?php 
        if (!empty($order->accountnumber)) {
            ?>
							<?php 
            echo $order->cardtype;
            ?>
: x<?php 
            echo last4($order->accountnumber);
            ?>
<br/>
						<?php 
        }
        ?>
						<?php 
        if (!empty($order->billing->name)) {
            ?>
								<?php 
            echo $order->billing->name;
            ?>
<br/>
						<?php 
        }
        ?>
コード例 #2
0
ファイル: orders.php プロジェクト: Jtgadbois/Pedadida
							<td><a href="admin.php?page=pmpro-orders&order=<?php echo $order->id?>"><?php echo $order->code;?></a></td>
							<td>
								<?php $order->getUser(); ?>		
								<?php if(!empty($order->user)) { ?>
									<a href="user-edit.php?user_id=<?php echo $order->user->ID?>"><?php echo $order->user->user_login?></a>
								<?php } else { ?>
									[deleted]
								<?php } ?>
							</td>						
							<?php do_action("pmpro_orders_extra_cols_body", $order);?>
							<td><?php echo $order->membership_id;?></td>
							<td><?php echo $pmpro_currency_symbol . $order->total;?></td>
							<td>
								<?php if(!empty($order->payment_type)) echo $order->payment_type . "<br />";?>
								<?php if(!empty($order->accountnumber)) { ?>
									<?php echo $order->cardtype;?>: x<?php echo last4($order->accountnumber);?><br />
								<?php } ?>
								<?php if(!empty($order->billing->street)) { ?>
									<?php echo $order->billing->street; ?><br />																		
									<?php if( $order->billing->city &&  $order->billing->state) { ?>
										<?php echo  $order->billing->city?>, <?php echo  $order->billing->state?> <?php echo  $order->billing->zip?>  <?php if(!empty( $order->billing->country)) echo  $order->billing->country?><br />												
									<?php } ?>
								<?php } ?>
								<?php if(!empty($order->billing->phone)) echo formatPhone($order->billing->phone);?>
							</td>
							<td><?php echo $order->gateway;?><?php if($order->gateway_environment == "test") echo "(test)";?></td>
							<td>
								Payment: <?php if(!empty($order->payment_transaction_id)) echo $order->payment_transaction_id; else echo "N/A";?>
								<br />
								Subscription: <?php if(!empty($order->subscription_transaction_id)) echo $order->subscription_transaction_id; else echo "N/A";?>	
							</td>
コード例 #3
0
				</td>
				<?php 
    }
    ?>
				<td>
					<?php 
    if ($pmpro_invoice->accountnumber) {
        ?>
						<?php 
        echo $pmpro_invoice->cardtype;
        ?>
 <?php 
        _e('ending in', 'pmpro');
        ?>
 <?php 
        echo last4($pmpro_invoice->accountnumber);
        ?>
<br />
						<small><?php 
        _e('Expiration', 'pmpro');
        ?>
: <?php 
        echo $pmpro_invoice->expirationmonth;
        ?>
/<?php 
        echo $pmpro_invoice->expirationyear;
        ?>
</small>
					<?php 
    } elseif ($pmpro_invoice->payment_type) {
        ?>
コード例 #4
0
ファイル: account.php プロジェクト: kaiifalcutela/eatdk
        }
        ?>
					
					<?php 
        if (!empty($AccountNumber)) {
            ?>
					<p>
						<strong><?php 
            _e("Payment Method", "pmpro");
            ?>
</strong><br />
						<?php 
            echo $CardType;
            ?>
: <?php 
            echo last4($AccountNumber);
            ?>
 (<?php 
            echo $ExpirationMonth;
            ?>
/<?php 
            echo $ExpirationYear;
            ?>
)
					</p>
					<?php 
        }
        ?>
					
					<?php 
        if (isset($ssorder->status) && $ssorder->status == "success" && (isset($ssorder->gateway) && in_array($ssorder->gateway, array("authorizenet", "paypal", "stripe", "braintree", "payflow", "cybersource")))) {
コード例 #5
0
ファイル: invoice.php プロジェクト: Jtgadbois/Pedadida
		</thead>
		<tbody>
			<tr>
				<?php if(!empty($pmpro_invoice->billing->name)) { ?>
				<td>
					<?php echo $pmpro_invoice->billing->name?><br />
					<?php echo $pmpro_invoice->billing->street?><br />						
					<?php if($pmpro_invoice->billing->city && $pmpro_invoice->billing->state) { ?>
						<?php echo $pmpro_invoice->billing->city?>, <?php echo $pmpro_invoice->billing->state?> <?php echo $pmpro_invoice->billing->zip?> <?php echo $pmpro_invoice->billing->country?><br />												
					<?php } ?>
					<?php echo formatPhone($pmpro_invoice->billing->phone)?>
				</td>
				<?php } ?>
				<td>
					<?php if($pmpro_invoice->accountnumber) { ?>
						<?php echo $pmpro_invoice->cardtype?> ending in <?php echo last4($pmpro_invoice->accountnumber)?><br />
						<small>Expiration: <?php echo $pmpro_invoice->expirationmonth?>/<?php echo $pmpro_invoice->expirationyear?></small>
					<?php } elseif($pmpro_invoice->payment_type) { ?>
						<?php echo $pmpro_invoice->payment_type?>
					<?php } ?>
				</td>
				<td><?php echo $pmpro_invoice->membership_level->name?></td>					
				<td align="center">
					<?php if($pmpro_invoice->total != '0.00') { ?>
						<?php if(!empty($pmpro_invoice->tax)) { ?>
							Subtotal: <?php echo $pmpro_currency_symbol?><?php echo number_format($pmpro_invoice->subtotal, 2);?><br />
							Tax: <?php echo $pmpro_currency_symbol?><?php echo number_format($pmpro_invoice->tax, 2);?><br />
							<?php if(!empty($pmpro_invoice->couponamount)) { ?>
								Coupon: (<?php echo $pmpro_currency_symbol?><?php echo number_format($pmpro_invoice->couponamount, 2);?>)<br />
							<?php } ?>
							<strong>Total: <?php echo $pmpro_currency_symbol?><?php echo number_format($pmpro_invoice->total, 2)?></strong>
コード例 #6
0
function billing_content_func($atts)
{
    global $wpdb, $pmpro_msg, $pmpro_msgt, $pmpro_levels, $current_user, $levels;
    //-> If a member is logged in, show them some info here (1. past invoices. 2. billing information with button to update.)
    if ($current_user->membership_level->ID) {
        if ($pmpro_msg) {
            ?>
            <div class="pmpro_message <?php 
            echo $pmpro_msgt;
            ?>
"><?php 
            echo $pmpro_msg;
            ?>
</div>
            <?php 
        }
        ?>
	
        <div class="row billing-content">
            <div class="col-md-8 col-sm-8 col-sm-offset-3 col-md-offset-3">
                <!-- BEGIN CONTENT-->
                <div id="pmpro_account">		
                    <div id="pmpro_account-membership" class="pmpro_box-first">

                        <?php 
        //wpex_logo();
        ?>
                        <!--
                        <div class="clear clearfix"></div>
                        <br/>
                        -->
                        <?php 
        $level = $current_user->membership_level->name;
        ?>
                        <p><?php 
        _e("Membership status: <strong>" . $level . "</strong>", "pmpro");
        ?>
</p>
                        <?php 
        //die(var_dump($current_user));
        ?>
                        <ul>
                            <li><strong><?php 
        _e("Level", "pmpro");
        ?>
:</strong> <?php 
        echo $current_user->membership_level->name;
        ?>
</li>
                            <?php 
        if ($current_user->membership_level->billing_amount > 0) {
            ?>
                                <li><strong><?php 
            _e("Membership Fee", "pmpro");
            ?>
:</strong>
                                    <?php 
            $level = $current_user->membership_level;
            if ($current_user->membership_level->cycle_number > 1) {
                printf(__('%s every %d %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
            } elseif ($current_user->membership_level->cycle_number == 1) {
                printf(__('%s per %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), pmpro_translate_billing_period($level->cycle_period));
            } else {
                echo pmpro_formatPrice($current_user->membership_level->billing_amount);
            }
            ?>
                                </li>
                            <?php 
        }
        ?>
						

                            <?php 
        if ($current_user->membership_level->billing_limit) {
            ?>
                                <li><strong><?php 
            _e("Duration", "pmpro");
            ?>
:</strong> <?php 
            echo $current_user->membership_level->billing_limit . ' ' . sornot($current_user->membership_level->cycle_period, $current_user->membership_level->billing_limit);
            ?>
</li>
                            <?php 
        }
        ?>

                            <?php 
        if ($current_user->membership_level->enddate) {
            ?>
                                <li><strong><?php 
            _e("Next billing date", "pmpro");
            ?>
:</strong> <?php 
            echo date_i18n(get_option('date_format'), $current_user->membership_level->enddate);
            ?>
</li>
                            <?php 
        }
        ?>

                            <?php 
        if ($current_user->membership_level->trial_limit == 1) {
            printf(__("Your first payment will cost %s.", "pmpro"), pmpro_formatPrice($current_user->membership_level->trial_amount));
        } elseif (!empty($current_user->membership_level->trial_limit)) {
            printf(__("Your first %d payments will cost %s.", "pmpro"), $current_user->membership_level->trial_limit, pmpro_formatPrice($current_user->membership_level->trial_amount));
        }
        ?>
                        </ul>

                    </div> <!-- end pmpro_account-membership -->

                    <div id="pmpro_account-profile" class="pmpro_box hide">	
                        <?php 
        get_currentuserinfo();
        ?>
 
                        <h3><?php 
        _e("My Account", "pmpro");
        ?>
</h3>
                        <?php 
        if ($current_user->user_firstname) {
            ?>
                            <p><?php 
            echo $current_user->user_firstname;
            ?>
 <?php 
            echo $current_user->user_lastname;
            ?>
</p>
                        <?php 
        }
        ?>
                        <ul>
                            <li><strong><?php 
        _e("Username", "pmpro");
        ?>
:</strong> <?php 
        echo $current_user->user_login;
        ?>
</li>
                            <li><strong><?php 
        _e("Email", "pmpro");
        ?>
:</strong> <?php 
        echo $current_user->user_email;
        ?>
</li>
                        </ul>
                        <p>
                            <a href="<?php 
        echo admin_url('profile.php');
        ?>
"><?php 
        _e("Edit Profile", "pmpro");
        ?>
</a> |
                            <a href="<?php 
        echo admin_url('profile.php');
        ?>
"><?php 
        _ex("Change Password", "As in 'change password'.", "pmpro");
        ?>
</a>
                        </p>
                    </div> <!-- end pmpro_account-profile -->

                    <?php 
        //last invoice for current info
        //$ssorder = $wpdb->get_row("SELECT *, UNIX_TIMESTAMP(timestamp) as timestamp FROM $wpdb->pmpro_membership_orders WHERE user_id = '$current_user->ID' AND membership_id = '" . $current_user->membership_level->ID . "' AND status = 'success' ORDER BY timestamp DESC LIMIT 1");
        $ssorder = new MemberOrder();
        $ssorder->getLastMemberOrder();
        $invoices = $wpdb->get_results("SELECT *, UNIX_TIMESTAMP(timestamp) as timestamp FROM {$wpdb->pmpro_membership_orders} WHERE user_id = '{$current_user->ID}' ORDER BY timestamp DESC LIMIT 6");
        if (!empty($ssorder->id) && $ssorder->gateway != "check" && $ssorder->gateway != "paypalexpress" && $ssorder->gateway != "paypalstandard" && $ssorder->gateway != "twocheckout") {
            //default values from DB (should be last order or last update)
            $bfirstname = get_user_meta($current_user->ID, "pmpro_bfirstname", true);
            $blastname = get_user_meta($current_user->ID, "pmpro_blastname", true);
            $baddress1 = get_user_meta($current_user->ID, "pmpro_baddress1", true);
            $baddress2 = get_user_meta($current_user->ID, "pmpro_baddress2", true);
            $bcity = get_user_meta($current_user->ID, "pmpro_bcity", true);
            $bstate = get_user_meta($current_user->ID, "pmpro_bstate", true);
            $bzipcode = get_user_meta($current_user->ID, "pmpro_bzipcode", true);
            $bcountry = get_user_meta($current_user->ID, "pmpro_bcountry", true);
            $bphone = get_user_meta($current_user->ID, "pmpro_bphone", true);
            $bemail = get_user_meta($current_user->ID, "pmpro_bemail", true);
            $bconfirmemail = get_user_meta($current_user->ID, "pmpro_bconfirmemail", true);
            $CardType = get_user_meta($current_user->ID, "pmpro_CardType", true);
            $AccountNumber = hideCardNumber(get_user_meta($current_user->ID, "pmpro_AccountNumber", true), false);
            $ExpirationMonth = get_user_meta($current_user->ID, "pmpro_ExpirationMonth", true);
            $ExpirationYear = get_user_meta($current_user->ID, "pmpro_ExpirationYear", true);
            ?>
	

                        <div id="pmpro_account-billing" class="pmpro_box">
                            <h3><?php 
            _e("Billing Information", "pmpro");
            ?>
</h3>
                            <?php 
            if (!empty($baddress1)) {
                ?>
                                <p>
                                    <strong><?php 
                _e("Billing Address", "pmpro");
                ?>
</strong><br />
                                    <?php 
                echo $bfirstname . " " . $blastname;
                ?>
                                    <br />		
                                    <?php 
                echo $current_user->user_email;
                ?>
<br />
                                    <?php 
                echo $baddress1;
                ?>
<br />
                                    <?php 
                if ($baddress2) {
                    echo $baddress2 . "<br />";
                }
                ?>
                                    <?php 
                if ($bcity && $bstate) {
                    ?>
                                        <?php 
                    echo $bcity;
                    ?>
, <?php 
                    echo $bstate;
                    ?>
 <?php 
                    echo $bzipcode;
                    ?>
 <?php 
                    echo $bcountry;
                    ?>
                                    <?php 
                }
                ?>
                         
                                    <br />
                                    <?php 
                echo formatPhone($bphone);
                ?>
                                </p>
                            <?php 
            }
            ?>

                            <?php 
            if (!empty($AccountNumber)) {
                ?>
                                <p>
                                    <strong><?php 
                _e("Payment Method", "pmpro");
                ?>
</strong><br />
                                    <?php 
                echo $CardType;
                ?>
: <?php 
                echo last4($AccountNumber);
                ?>
 (<?php 
                echo $ExpirationMonth;
                ?>
/<?php 
                echo $ExpirationYear;
                ?>
)
                                </p>
                            <?php 
            }
            ?>

                            <?php 
            if (isset($ssorder->status) && $ssorder->status == "success" && (isset($ssorder->gateway) && in_array($ssorder->gateway, array("authorizenet", "paypal", "stripe", "braintree", "payflow", "cybersource")))) {
                ?>
                                <p><a href="<?php 
                echo pmpro_url("billing", "");
                ?>
"><?php 
                _e("Edit Billing Information", "pmpro");
                ?>
</a></p>
                                <?php 
            }
            ?>
                        </div> <!-- end pmpro_account-billing -->				
                        <?php 
        }
        ?>

                    <?php 
        if (!empty($invoices)) {
            ?>
                        <div id="pmpro_account-invoices" class="pmpro_box">
                            <h3><?php 
            _e("Past Invoices", "pmpro");
            ?>
</h3>
                            <ul>
                                <?php 
            $count = 0;
            foreach ($invoices as $invoice) {
                if ($count++ > 5) {
                    break;
                }
                ?>
                                    <li><a href="<?php 
                echo pmpro_url("invoice", "?invoice=" . $invoice->code);
                ?>
"><?php 
                echo date_i18n(get_option("date_format"), $invoice->timestamp);
                ?>
 (<?php 
                echo pmpro_formatPrice($invoice->total);
                ?>
)</a></li>
                                    <?php 
            }
            ?>
                            </ul>
                            <?php 
            //if ($count == 6) {
            ?>
                            <p><a href="<?php 
            echo pmpro_url("invoice");
            ?>
"><?php 
            _e("View All Invoices", "pmpro");
            ?>
</a></p>
                            <?php 
            //}
            ?>
                        </div> <!-- end pmpro_account-billing -->
                    <?php 
        }
        ?>
                    <!--
                    <p class="help-block">We have the following subscriptions available for our site. To join, simply click on the <strong>Change Subscription</strong> button to Change Membership Level.</p>
                    -->                  
                    <?php 
        //getLevels();
        ?>
	
                </div> <!-- end pmpro_account -->	

                <!-- END CONTENT-->
            </div>
        </div>
        <?php 
    } else {
        $user_id = $current_user->ID;
        //make sure we only run once a day
        $today = date("Y-m-d", current_time("timestamp"));
        //look for memberships that expired
        $sqlQuery = "SELECT mu.user_id, mu.membership_id, mu.startdate, mu.enddate FROM {$wpdb->pmpro_memberships_users} mu WHERE mu.status = 'expired' AND mu.enddate IS NOT NULL AND mu.enddate <> '' AND mu.enddate <> '0000-00-00 00:00:00' AND DATE(mu.enddate) <= '" . $today . "' AND mu.user_id = '" . $user_id . "' ORDER BY mu.enddate  LIMIT 1";
        $expired = $wpdb->get_results($sqlQuery);
        if (count($expired) > 0) {
            ?>
            <div class="row billing-content">
                <div class="col-md-8 col-sm-8 col-sm-offset-3 col-md-offset-3">
                    <!-- BEGIN CONTENT-->
                    <div id="pmpro_account">		
                        <div id="pmpro_account-membership" class="pmpro_box-first">
                            <?php 
            foreach ($expired as $e) {
                $level_id = $e->membership_id;
                $level = pmpro_getLevel($level_id);
                ?>
                                <div class="pmpro_message">Your "<?php 
                echo $level->name;
                ?>
" Membership has expired, please renew now <a href="<?php 
                echo pmpro_url("levels");
                ?>
"><?php 
                _e("here", "pmpro");
                ?>
</a>.</div>
                                <div id="pmpro_account-membership" class="pmpro_box-first">
                                    <?php 
                $level = $current_user->membership_level->name;
                ?>
                                    <p><?php 
                _e("Membership status: <strong>" . $level->name . "(Expired)</strong>", "pmpro");
                ?>
</p>
                                    <ul>
                                        <?php 
                if ($e->enddate) {
                    //die(var_dump($e->enddate));
                    ?>

                                            <li><strong><?php 
                    _e("Expiration billing date", "pmpro");
                    ?>
:  </strong> <?php 
                    echo " " . date_i18n(get_option('date_format'), strtotime($e->enddate));
                    ?>
</li>
                                        <?php 
                }
                ?>
                                    </ul>

                                </div> <!-- end pmpro_account-membership -->                               
                                <?php 
            }
            ?>
                        </div>
                    </div>
                </div>
            </div>
            <?php 
        }
    }
    ?>
    <?php 
}
コード例 #7
0
ファイル: account.php プロジェクト: Jtgadbois/Pedadida
					<p>
						<strong>Billing Address</strong><br />
						<?php echo $bfirstname . " " . $blastname?>
						<br />		
						<?php echo $baddress1?><br />
						<?php if($baddress2) echo $baddress2 . "<br />";?>
						<?php if($bcity && $bstate) { ?>
							<?php echo $bcity?>, <?php echo $bstate?> <?php echo $bzipcode?> <?php echo $bcountry?>
						<?php } ?>                         
						<br />
						<?php echo formatPhone($bphone)?>
					</p>
					<?php } ?>
					<p>
						<strong>Payment Method</strong><br />
						<?php echo $CardType?>: <?php echo last4($AccountNumber)?> (<?php echo $ExpirationMonth?>/<?php echo $ExpirationYear?>)
					</p>
				</div>					
			<?php
			}
			?>
			<div class="pmpro_box">
				<h3>Member Links</h3>
				<ul>
					<?php 
						do_action("pmpro_member_links_top");
					?>
					<?php if((isset($ssorder->status) && $ssorder->status == "success") && (isset($ssorder->gateway) && in_array($ssorder->gateway, array("authorizenet", "paypal", "stripe")))) { ?>
						<li><a href="<?php echo pmpro_url("billing", "", "https")?>">Update Billing Information</a></li>
					<?php } ?>
					<?php if(count($pmpro_levels) > 1) { ?>
コード例 #8
0
function billing_content_func($atts)
{
    global $wpdb, $pmpro_msg, $pmpro_msgt, $pmpro_levels, $current_user, $levels;
    //-> If a member is logged in, show them some info here (1. past invoices. 2. billing information with button to update.)
    if ($current_user->membership_level->ID) {
        if ($pmpro_msg) {
            ?>
            <div class="pmpro_message <?php 
            echo $pmpro_msgt;
            ?>
"><?php 
            echo $pmpro_msg;
            ?>
</div>
            <?php 
        }
        ?>
	
        <div class="row">
            <div class="col-md-8 col-sm-8 col-sm-offset-2 col-md-offset-2">
                <!-- BEGIN CONTENT-->
                <div id="pmpro_account">		
                    <div id="pmpro_account-membership" class="pmpro_box">
                        <p><?php 
        _e("Your membership is <strong>active</strong>.", "pmpro");
        ?>
</p>
                        <ul>
                            <li><strong><?php 
        _e("Level", "pmpro");
        ?>
:</strong> <?php 
        echo $current_user->membership_level->name;
        ?>
</li>
                            <?php 
        if ($current_user->membership_level->billing_amount > 0) {
            ?>
                                <li><strong><?php 
            _e("Membership Fee", "pmpro");
            ?>
:</strong>
                                    <?php 
            $level = $current_user->membership_level;
            if ($current_user->membership_level->cycle_number > 1) {
                printf(__('%s every %d %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
            } elseif ($current_user->membership_level->cycle_number == 1) {
                printf(__('%s per %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), pmpro_translate_billing_period($level->cycle_period));
            } else {
                echo pmpro_formatPrice($current_user->membership_level->billing_amount);
            }
            ?>
                                </li>
                            <?php 
        }
        ?>
						

                            <?php 
        if ($current_user->membership_level->billing_limit) {
            ?>
                                <li><strong><?php 
            _e("Duration", "pmpro");
            ?>
:</strong> <?php 
            echo $current_user->membership_level->billing_limit . ' ' . sornot($current_user->membership_level->cycle_period, $current_user->membership_level->billing_limit);
            ?>
</li>
                            <?php 
        }
        ?>

                            <?php 
        if ($current_user->membership_level->enddate) {
            ?>
                                <li><strong><?php 
            _e("Membership Expires", "pmpro");
            ?>
:</strong> <?php 
            echo date_i18n(get_option('date_format'), $current_user->membership_level->enddate);
            ?>
</li>
                            <?php 
        }
        ?>

                            <?php 
        if ($current_user->membership_level->trial_limit == 1) {
            printf(__("Your first payment will cost %s.", "pmpro"), pmpro_formatPrice($current_user->membership_level->trial_amount));
        } elseif (!empty($current_user->membership_level->trial_limit)) {
            printf(__("Your first %d payments will cost %s.", "pmpro"), $current_user->membership_level->trial_limit, pmpro_formatPrice($current_user->membership_level->trial_amount));
        }
        ?>
                        </ul>

                    </div> <!-- end pmpro_account-membership -->

                    <div id="pmpro_account-profile" class="pmpro_box hide">	
                        <?php 
        get_currentuserinfo();
        ?>
 
                        <h3><?php 
        _e("My Account", "pmpro");
        ?>
</h3>
                        <?php 
        if ($current_user->user_firstname) {
            ?>
                            <p><?php 
            echo $current_user->user_firstname;
            ?>
 <?php 
            echo $current_user->user_lastname;
            ?>
</p>
                        <?php 
        }
        ?>
                        <ul>
                            <li><strong><?php 
        _e("Username", "pmpro");
        ?>
:</strong> <?php 
        echo $current_user->user_login;
        ?>
</li>
                            <li><strong><?php 
        _e("Email", "pmpro");
        ?>
:</strong> <?php 
        echo $current_user->user_email;
        ?>
</li>
                        </ul>
                        <p>
                            <a href="<?php 
        echo admin_url('profile.php');
        ?>
"><?php 
        _e("Edit Profile", "pmpro");
        ?>
</a> |
                            <a href="<?php 
        echo admin_url('profile.php');
        ?>
"><?php 
        _ex("Change Password", "As in 'change password'.", "pmpro");
        ?>
</a>
                        </p>
                    </div> <!-- end pmpro_account-profile -->

                    <?php 
        //last invoice for current info
        //$ssorder = $wpdb->get_row("SELECT *, UNIX_TIMESTAMP(timestamp) as timestamp FROM $wpdb->pmpro_membership_orders WHERE user_id = '$current_user->ID' AND membership_id = '" . $current_user->membership_level->ID . "' AND status = 'success' ORDER BY timestamp DESC LIMIT 1");
        $ssorder = new MemberOrder();
        $ssorder->getLastMemberOrder();
        $invoices = $wpdb->get_results("SELECT *, UNIX_TIMESTAMP(timestamp) as timestamp FROM {$wpdb->pmpro_membership_orders} WHERE user_id = '{$current_user->ID}' ORDER BY timestamp DESC LIMIT 6");
        if (!empty($ssorder->id) && $ssorder->gateway != "check" && $ssorder->gateway != "paypalexpress" && $ssorder->gateway != "paypalstandard" && $ssorder->gateway != "twocheckout") {
            //default values from DB (should be last order or last update)
            $bfirstname = get_user_meta($current_user->ID, "pmpro_bfirstname", true);
            $blastname = get_user_meta($current_user->ID, "pmpro_blastname", true);
            $baddress1 = get_user_meta($current_user->ID, "pmpro_baddress1", true);
            $baddress2 = get_user_meta($current_user->ID, "pmpro_baddress2", true);
            $bcity = get_user_meta($current_user->ID, "pmpro_bcity", true);
            $bstate = get_user_meta($current_user->ID, "pmpro_bstate", true);
            $bzipcode = get_user_meta($current_user->ID, "pmpro_bzipcode", true);
            $bcountry = get_user_meta($current_user->ID, "pmpro_bcountry", true);
            $bphone = get_user_meta($current_user->ID, "pmpro_bphone", true);
            $bemail = get_user_meta($current_user->ID, "pmpro_bemail", true);
            $bconfirmemail = get_user_meta($current_user->ID, "pmpro_bconfirmemail", true);
            $CardType = get_user_meta($current_user->ID, "pmpro_CardType", true);
            $AccountNumber = hideCardNumber(get_user_meta($current_user->ID, "pmpro_AccountNumber", true), false);
            $ExpirationMonth = get_user_meta($current_user->ID, "pmpro_ExpirationMonth", true);
            $ExpirationYear = get_user_meta($current_user->ID, "pmpro_ExpirationYear", true);
            ?>
	

                        <div id="pmpro_account-billing" class="pmpro_box">
                            <h3><?php 
            _e("Billing Information", "pmpro");
            ?>
</h3>
                            <?php 
            if (!empty($baddress1)) {
                ?>
                                <p>
                                    <strong><?php 
                _e("Billing Address", "pmpro");
                ?>
</strong><br />
                                    <?php 
                echo $bfirstname . " " . $blastname;
                ?>
                                    <br />		
                                    <?php 
                echo $baddress1;
                ?>
<br />
                                    <?php 
                if ($baddress2) {
                    echo $baddress2 . "<br />";
                }
                ?>
                                    <?php 
                if ($bcity && $bstate) {
                    ?>
                                        <?php 
                    echo $bcity;
                    ?>
, <?php 
                    echo $bstate;
                    ?>
 <?php 
                    echo $bzipcode;
                    ?>
 <?php 
                    echo $bcountry;
                    ?>
                                    <?php 
                }
                ?>
                         
                                    <br />
                                    <?php 
                echo formatPhone($bphone);
                ?>
                                </p>
                            <?php 
            }
            ?>

                            <?php 
            if (!empty($AccountNumber)) {
                ?>
                                <p>
                                    <strong><?php 
                _e("Payment Method", "pmpro");
                ?>
</strong><br />
                                    <?php 
                echo $CardType;
                ?>
: <?php 
                echo last4($AccountNumber);
                ?>
 (<?php 
                echo $ExpirationMonth;
                ?>
/<?php 
                echo $ExpirationYear;
                ?>
)
                                </p>
                            <?php 
            }
            ?>

                            <?php 
            if (isset($ssorder->status) && $ssorder->status == "success" && (isset($ssorder->gateway) && in_array($ssorder->gateway, array("authorizenet", "paypal", "stripe", "braintree", "payflow", "cybersource")))) {
                ?>
                                <p><a href="<?php 
                echo pmpro_url("billing", "");
                ?>
"><?php 
                _e("Edit Billing Information", "pmpro");
                ?>
</a></p>
                                <?php 
            }
            ?>
                        </div> <!-- end pmpro_account-billing -->				
                        <?php 
        }
        ?>

                    <?php 
        if (!empty($invoices)) {
            ?>
                        <div id="pmpro_account-invoices" class="pmpro_box">
                            <h3><?php 
            _e("Past Invoices", "pmpro");
            ?>
</h3>
                            <ul>
                                <?php 
            $count = 0;
            foreach ($invoices as $invoice) {
                if ($count++ > 5) {
                    break;
                }
                ?>
                                    <li><a href="<?php 
                echo pmpro_url("invoice", "?invoice=" . $invoice->code);
                ?>
"><?php 
                echo date_i18n(get_option("date_format"), $invoice->timestamp);
                ?>
 (<?php 
                echo pmpro_formatPrice($invoice->total);
                ?>
)</a></li>
                                    <?php 
            }
            ?>
                            </ul>
                            <?php 
            if ($count == 6) {
                ?>
                                <p><a href="<?php 
                echo pmpro_url("invoice");
                ?>
"><?php 
                _e("View All Invoices", "pmpro");
                ?>
</a></p>
                            <?php 
            }
            ?>
                        </div> <!-- end pmpro_account-billing -->
                    <?php 
        }
        ?>
                    <p class="help-block">We have the following subscriptions available for our site. To join, simply click on the <strong>Renew</strong> or <strong>Change Subscription</strong> button and then complete the registration details.</p>
                    <?php 
        getLevels();
        ?>
                    <div id="pmpro_account-links" class="pmpro_box">
                        <h3><?php 
        _e("Manage Membership", "pmpro");
        ?>
</h3>
                        <ul>
                            <?php 
        do_action("pmpro_member_links_top");
        ?>
                            <?php 
        if (isset($ssorder->status) && $ssorder->status == "success" && (isset($ssorder->gateway) && in_array($ssorder->gateway, array("authorizenet", "paypal", "stripe", "braintree", "payflow", "cybersource")))) {
            ?>
                                <li><a href="<?php 
            echo pmpro_url("billing", "", "https");
            ?>
"><?php 
            _e("Update Billing Information", "pmpro");
            ?>
</a></li>
                            <?php 
        }
        ?>
                            <?php 
        if (count($pmpro_levels) > 1 && !defined("PMPRO_DEFAULT_LEVEL")) {
            ?>
                                <li><a href="<?php 
            echo pmpro_url("levels");
            ?>
"> <?php 
            _e("Change Membership Level", "pmpro");
            ?>
</a></li>
                            <?php 
        }
        ?>
                            <li><a href="<?php 
        echo pmpro_url("cancel");
        ?>
" class="red"><?php 
        _e("Cancel Membership", "pmpro");
        ?>
</a></li>
                            <?php 
        do_action("pmpro_member_links_bottom");
        ?>
                        </ul>
                    </div> <!-- end pmpro_account-links -->		
                </div> <!-- end pmpro_account -->	

                <!-- END CONTENT-->
            </div>
        </div>
        <?php 
    }
    ?>
    <?php 
}