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_package_invoice($_SESSION['JB_ID'], $_REQUEST['package_id']); } if ($invoice_id !== false) { // delete other selected orders $sql = "DELETE FROM package_invoices WHERE (`status`='in_cart' ) AND `invoice_id` != '{$invoice_id}' AND employer_id='" . jb_escape_sql($_SESSION['JB_ID']) . "' "; //echo $sql; $result = JB_mysql_query($sql) or die($sql . mysql_error()); $sql = "select * from packages WHERE package_id='" . jb_escape_sql($_REQUEST['package_id']) . "' "; $result = JB_mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); JB_display_package_invoice($invoice_id); ?> </td> <td width="50%"> <p> <input type="button" class="confirm_order_button" value="<?php echo $label['package_invoice_confirm']; ?> " onClick="window.location='payment.php?action=post&invoice_id=<?php echo jb_escape_html($invoice_id); ?> &package_id=<?php echo $row['package_id']; ?> &employer_id=<?php
<?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>