<?php // check to see if there are unpaid orders of the same subscription_id $sql = "select * from membership_invoices where user_id=" . jb_escape_sql($_SESSION['JB_ID']) . " AND user_type='C' AND membership_id='" . jb_escape_sql($_REQUEST['membership_id']) . "' AND (status='in_cart' OR status='Confirmed') "; $result = JB_mysql_query($sql); if (mysql_num_rows($result) > 0) { $row = mysql_fetch_array($result, MYSQL_ASSOC); $invoice_id = $row['invoice_id']; } else { // this is a new order, make a new invoice $invoice_id = JB_place_membership_invoice($_SESSION['JB_ID'], $_REQUEST['membership_id']); } if ($invoice_id !== false) { // delete other in_cart orders $sql = "DELETE FROM membership_invoices WHERE (`status`='in_cart' ) AND `invoice_id` <> '{$invoice_id}' AND user_type = 'C' AND `user_id`='" . jb_escape_sql($_SESSION['JB_ID']) . "' "; $result = JB_mysql_query($sql); JB_display_membership_invoice($invoice_id); ?> </td> <td width="100%"> <p align="center"> <input type="button" class="pay_button" value="<?php echo $label['c_membership_trn_confirm']; ?> " onClick="window.location='payment.php?action=membership&invoice_id=<?php echo $invoice_id; ?> &membership_id=<?php echo $row['membership_id']; ?>
<?php ########################################################################### # Copyright Jamit Software 2012, http://www.jamit.com # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. ########################################################################### require "../config.php"; require dirname(__FILE__) . "/admin_common.php"; JB_admin_header('Admin -> View Invoice'); if ($_REQUEST['invoice_id'] != '') { if ($_REQUEST['product_type'] == 'P') { JB_display_package_invoice($_REQUEST['invoice_id']); } elseif ($_REQUEST['product_type'] == 'M') { JB_display_membership_invoice($_REQUEST['invoice_id']); } elseif ($_REQUEST['product_type'] == 'S') { JB_display_subscription_invoice($_REQUEST['invoice_id']); } $sql = "select * from jb_txn where invoice_id='" . jb_escape_sql($_REQUEST['invoice_id']) . "' AND product_type='" . jb_escape_sql($_REQUEST['product_type']) . "'"; $result = JB_mysql_query($sql) or die($sql . mysql_error()); if (mysql_num_rows($result) > 0) { ?> Transactions: <table cellSpacing="1" cellPadding="3" style="margin: 0 auto; background-color: #d9d9d9; width:100%; border:0px" > <tr bgColor="#eaeaea"> <td><b><font face="Arial" size="2">Seq. ID</font></b></td> <td><b><font face="Arial" size="2">Date</font></b></td> <td><b><font face="Arial" size="2">Invoice ID</font></b></td> <td><b><font face="Arial" size="2">Type</font></b></td>