notify_verify(); if($verify_result) { // out_trade_no= $_POST["out_trade_no"] // status = $_POST["trade_status"] // put the database string here, to update the database if ( $_POST["trade_status"] == 'TRADE_FINISHED' ){ $sql="UPDATE `order_record` SET `payment_status` = '1' where `order_no` = '".escapeit($_POST["out_trade_no"])."'"; $db->query($sql); $k=0; $print_fav = ''; $sql = "SELECT * FROM `order_record` WHERE `order_no` = '".escapeit($_POST["out_trade_no"])."'"; $row = $db->getrow($sql); $sql_item = "SELECT * FROM `order_item` WHERE `order_id` = '".$row['id']."' ORDER BY `id` ASC"; $rs_item = $db->query($sql_item); while ( $row_item = $db->fetch_array($rs_item) ){ $print_fav.='
| #'.($k+1).' | |
| Name | '.$cart_item[$row_item["product_id"]]["name"].' |
| Item No. | '.$cart_item[$row_item["product_id"]]["item_no"].' |
| Qty | '.$row_item["quantity"].' |
| Unit Price | '.$currency_unit['Hong Kong'].' '.number_format($cart_item[$row_item["product_id"]]["price"]['Hong Kong'],2).' |
| Name | '.$row['name'].' |
| '.$row['email'].' | |
| Address | '.$row['address'].' |
| Phone | '.$row['phone'].' |
| Order Detail | '.($print_fav).' |
| Shipping | '.$currency_unit['Hong Kong'].' '.number_format($row['shipping'],2).' |
| Tax | '.$currency_unit['Hong Kong'].' '.number_format($row['tax'],2).' |
| Order Total | '.$currency_unit['Hong Kong'].' '.number_format($row['order_total'],2).' |