\n";
$body =$body."| 訂單編號: | ".$order_no." |
\n";
$body =$body."
| 客戶名稱: | ".$order["name"]." | 電子郵件: | ".$order["email"]." |
\n";
$body =$body."| 電話: | ".$order["phone"]." | 傳真: | ".$ordder["fax"]." |
\n";
$body =$body."| 總價: | ".$order["total"]." | 總價含郵資: | ".$order["totalship"]." |
\n";
$body =$body."| 郵寄地址: | ".$order["country"].$order["zip"].$order["county"].$order["address"]." | 付款方式: | ".$order["shipping"]." |
\n";
$body =$body."| 備註: | ".$order["memo"]." |
\n";
$body =$body."\n";
$body =$body."\n";
$body =$body."| 編號 | 名稱 | 單價 | 數量 | 小計 |
\n";
for($i=1; $i <= $item_no;$i++) {
$values ="";
while(list($key,$val) = each($order_item[$i])) {
$values = $values."| ".$val." | " ;
}
$values =$values."
\n";
$body =$body.$values;
}
$body =$body."
\n";
//$to = "editor@diyzone.net";
//mail("editor@ns.diyzone.net",$subject,$body,"From:sales@diyzone.net");
mail($to, $subject, $body, "From: ".$from." <".$from.">\nContent-Type: text/html; charset=big-5");
echo "訂單副本已寄到 :".$to;
}
if(!$email or !$order_no) {
$email="null";
$order_no = 0;
}
$conn = mysql_connect("203.69.230.142","albert","kukucow");
$query = "select order_table.order_no,order_table.status,order_table.totalship,order_table.shipping,order_table.date,order_table.memo,
order_table.total,customer.name,customer.email,customer.phone,customer.country,customer.county,
customer.address,customer.zip,order_table.status from order_table,customer where order_table.email = customer.email
and order_table.order_no = $order_no and order_table.email = '$email'";
$result = mysql_db_query("diyzone",$query,$conn);
echo "
DZ服務部訂單查詢
";
$order = mysql_fetch_array($result);
$query = "select * from order_item where order_no = $order_no;";
$result = mysql_db_query("diyzone",$query,$conn);
printf("
");
printf("| 訂單編號: | ".$order_no." |
");
printf("
| 客戶名稱: | ".$order["name"]." | 電子郵件: | ".$order["email"]." |
");
printf("| 電話: | ".$order["phone"]." | 傳真: | ".$order["fax"]." |
");
printf("| 總價: | ".$order["total"]." | 總價含郵資: | ".$order["totalship"]." |
");
printf("| 郵寄地址: | ".$order["country"].$order["zip"].$order["county"].$order["address"]." | 付款方式: | ".$order["shipping"]." |
\n");
printf("| 備註: | ".$order["memo"]." | 訂單狀態: | ".$order["status"]." |
");
printf("
");
printf("
");
printf("| 產品編號 | 品名 | 單價 | 數量 | 小計 |
");
$i=0;
while($item = mysql_fetch_array($result)) {
$i++;
$order_item[$i]["item_id"] = $item["item_id"];
$order_item[$i]["product_name"] = $item["product_name"];
$order_item[$i]["price"] = $item[$result, "price"];
$order_item[$i]["quantity"] = $item["quantity"];
$order_item[$i]["subtotal"] = $item["subtotal"];
printf("| ".$order_item[$i]["item_id"]." | ".$order_item[$i]["product_name"]." | ".$order_item[$i]["price"]." | ".$order_item[$i]["quantity"]." | ".$order_item[$i]["subtotal"]." |
");
}
print("
");
if($mail == "yes") {
mail_order($order_no,$order,$order_item,$i);
}
print("
寄回確認單");
print("
重新查詢");
}
else {
print("
無此筆訂單或Email錯誤!請同時輸入訂單編號及Email重新查詢");
}
echo "
";
mysql_close($conn);
?>