📄 orders.php
字号:
<?/* orders.php (c) 2000 Ying Zhang (ying@zippydesign.com) * * TERMS OF USAGE: * This file was written and developed by Ying Zhang (ying@zippydesign.com) * for educational and demonstration purposes only. You are hereby granted the * rights to use, modify, and redistribute this file as you like. The only * requirement is that you must retain this notice, without modifications, at * the top of your source code. No warranties or guarantees are expressed or * implied. DO NOT use this code in a production environment without * understanding the limitations and weaknesses pretaining to or caused by the * use of these scripts, directly or indirectly. USE AT YOUR OWN RISK! *//****************************************************************************** * MAIN *****************************************************************************/include("../application.php");require_login();require_priv("admin");$DOC_TITLE = "MyMarket Order Log";include("templates/header.php");switch (nvl($mode)) { case "details" : show_order_details($id); break; default : print_order_list(); break;}include("templates/footer.php");/****************************************************************************** * FUNCTIONS *****************************************************************************/function show_order_details($id) {/* loads up the details for an order and displays it */ global $CFG, $ME; $qid_order = db_query("SELECT * FROM orders WHERE id = '$id'"); $qid_items = db_query(" SELECT p.name ,p.price AS curr_price ,oi.price AS purchase_price ,oi.qty ,oi.price * oi.qty AS total FROM order_items oi LEFT JOIN products p ON (oi.product_id = p.id) WHERE order_id = '$id' "); $order = db_fetch_object($qid_order); include("templates/order_details.php");}function print_order_list() {/* reads a list of orders from the database and displays them, we will use * a template to display the listings to keep this main script clean */ global $CFG, $ME; $qid = db_query(" SELECT id, username, o_timestamp, a_timestamp, status, amount FROM orders "); include("templates/order_list.php");}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -