try this: not tested it for a while (BACKUP FIRST) but, new main/history_order.tpl
Code:
<?
/*****************************************************************************\
+-----------------------------------------------------------------------------+
| X-Cart |
| Copyright (c) 2001-2002 Ruslan R. Fazliev. All rights reserved. |
+-----------------------------------------------------------------------------+
| The Ruslan R. Fazliev forbids, under any circumstances, the unauthorized |
| reproduction of software or use of illegally obtained software. Making |
| illegal copies of software is prohibited. Individuals who violate copyright |
| law and software licensing agreements may be subject to criminal or civil |
| action by the owner of the copyright. |
| |
| 1. It is illegal to copy a software, and install that single program for |
| simultaneous use on multiple machines. |
| |
| 2. Unauthorized copies of software may not be used in any way. This applies |
| even though you yourself may not have made the illegal copy. |
| |
| 3. Purchase of the appropriate number of copies of a software is necessary |
| for maintaining legal status. |
| |
| DISCLAIMER |
| |
| THIS SOFTWARE IS PROVIDED BY Ruslan R. Fazliev ``AS IS'' AND ANY |
| EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| DISCLAIMED. IN NO EVENT SHALL Ruslan R. Fazliev OR ITS |
| CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| |
| The Initial Developer of the Original Code is Ruslan R. Fazliev. |
| Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2002 |
| Ruslan R. Fazliev. All Rights Reserved. |
+-----------------------------------------------------------------------------+
\*****************************************************************************/
#
# $Id: order.php,v 1.19 2002/12/10 08:57:10 sdg Exp $
#
require "../smarty.php";
require "../config.php";
require "./auth.php";
require "../include/security.php";
#
# Collect infos about ordered products
#
require "../include/history_order.php";
$order = $order_data["order"];
$userinfo = $order_data["userinfo"];
$products = $order_data["products"];
$giftcerts = $order_data["giftcerts"];
if ($mode == "status_change") {
# Update order
#
func_change_order_status($orderid, $status);
// db_query("update $sql_tbl[orders] set tracking='$tracking', notes='$notes', details='".text_crypt($details)."' where orderid='$orderid'");
db_query("update $sql_tbl[orders] set tracking='$tracking', total='$total', subtotal='$subtotal', discount='$discount', shipping_cost='$shipping', tax='$tax', firstname='$firstname', lastname='$lastname', company='$company', b_address='$b_address', b_city='$b_city', b_state='$b_state', b_country='$b_country', b_zipcode='$b_zipcode', s_address='$s_address', s_city='$s_city', s_state='$s_state', s_country='$s_country', s_zipcode='$s_zipcode', phone='$phone', email='$email', fax='$fax', notes='$notes', details='".text_crypt($details)."' where orderid='$orderid'");
// echo "update $sql_tbl[orders] set tracking='$tracking', total='$total', subtotal='$subtotal', discount='$discount', shipping_cost='$shipping', tax='$tax', firstname='$firstname', lastname='$lastname', company='$company', b_address='$b_address', b_city='$b_city', b_state='$b_state', b_country='$b_country', b_zipcode='$b_zipcode', s_address='$s_address', s_city='$s_city', s_state='$s_state', s_country='$s_country', s_zipcode='$s_zipcode', phone='$phone', email='$email', fax='$fax', notes='$notes', details='".text_crypt($details)."' where orderid='$orderid'";
// loop through the products and amend the quantity
for ($n=0; $n <= count($prod);$n++){
db_query ("update $sql_tbl[order_details] set amount = '$amount[$n] ' where orderid = '$orderid' AND productid = '$prod[$n]'");
}
header("Location: order.php?orderid=$orderid&mode=status_changed");
exit;
}
#
# Delete order
#
if ($mode=="delete") {
db_query("DELETE FROM $sql_tbl[orders] WHERE orderid='$orderid'");
db_query("DELETE FROM $sql_tbl[order_details] WHERE orderid='$orderid'");
db_query("DELETE FROM $sql_tbl[giftcerts] WHERE orderid='$orderid'");
db_query("DELETE FROM $sql_tbl[partner_payment] WHERE orderid='$orderid'");
db_query("DELETE FROM $sql_tbl[subscription_customers] WHERE orderid='$orderid'");
header("Location: orders.php?".$query_string);
exit;
}
$smarty->assign("main","history_order");
@include "../modules/gold_display.php";
$smarty->display("admin/home.tpl");
?>