📄 order_print.ihtml
字号:
<?php
eval(load_class("product", "ps_product"));
$ps_product = new ps_product;
?>
<?php
$q = "SELECT * FROM orders WHERE order_id='$order_id'";
$db->query($q);
$db->next_record();
?>
<?php
// PAVLO: 8.28.00
$navi_db = new ps_DB;
$navigation = "<center>\n<BR><B>\n";
$q = "SELECT order_id FROM orders WHERE ";
$q .= "order_id < '$order_id' ORDER BY order_id DESC";
$navi_db->query($q);
$navi_db->next_record();
if ($navi_db->f("order_id")) {
$url = SECUREURL . "?page=$modulename/order_print&order_id=";
$url .= $navi_db->f("order_id");
$navigation .= "<A HREF=" . $sess->url($url) . "><<上条</A> | ";
} else
$navigation .= "<<上条| ";
$q = "SELECT order_id FROM orders WHERE ";
$q .= "order_id > '$order_id' ORDER BY order_id";
$navi_db->query($q);
$navi_db->next_record();
if ($navi_db->f("order_id")) {
$url = SECUREURL . "?page=$modulename/order_print&order_id=";
$url .= $navi_db->f("order_id");
$navigation .= "<A HREF=" . $sess->url($url) . ">下条 >></A>";
} else
$navigation .= "下条 >>";
$navigation .= "\n<B>\n</center>\n";
echo $navigation;
?>
<div align="center"><br>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td height="118">
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr bgcolor="#666666">
<td width="26%" bgcolor="#666666"><B><?php echo $order_print_po_lbl ?></B></td>
<td width="74%"><b> </b></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="26%"> </td>
<td width="74%"> </td>
</tr>
<tr>
<td width="26%"><b><?php echo $order_print_po_number ?>:</b></td>
<td width="74%"><?php
printf("%08d", $db->f("order_id"));
?></td>
</tr>
<tr>
<td width="26%"><b><?php echo $order_print_po_date ?>:</b></td>
<td width="74%"><?php
echo date("d-M-Y:H:i", $db->f("cdate"));
?></td>
</tr>
<tr>
<td width="26%"><b><?php echo $order_print_po_status ?>:</b></td>
<td width="74%">
<form method="post" action="<?php echo SECUREURL ?>"><?php
$ps_order_status->list_order_status($db->f("order_status"));
$sess->hidden_session();?>
<input type="submit" name="Submit" value="修改">
<input type="hidden" name="page" value="order/order_print">
<input type="hidden" name="func" value="orderStatusSet">
<input type="hidden" name="order_id" value="<?php echo $order_id ?>">
</form>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr bgcolor="#666666">
<td width="48%"><b><?php echo $order_print_cust_info_lbl ?> </b></td>
<td width="52%"><b> </b></td>
</tr>
<tr>
<td width="48%" valign="top" bgcolor="#CCCCCC"><?php echo $order_print_bill_to_lbl ?></td>
<td width="52%" valign="top" bgcolor="#CCCCCC"><?php echo $order_print_ship_to_lbl ?></td>
</tr>
<tr>
<td width="48%" valign="top"><?php
$user_id = $db->f("user_id");
$dbt = new ps_DB;
$qt = "SELECT * from auth_user_md5,user_info where ";
$qt .= "user_info.user_id='$user_id' AND ";
$qt .= "user_info.address_type='BT'";
$dbt->query($qt);
$dbt->next_record();
?>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="35%" align="right"><b> <?php echo $order_print_name ?>:</b></td>
<td width="65%"><?php echo $dbt->f("true_name");?></td>
</tr>
<tr>
<td width="35%" align="right"><b><?php echo $order_print_company ?>:</b></td>
<td width="65%"><?php echo $dbt->p("company");?></td>
</tr>
<tr>
<td width="35%" align="right"><b><?php echo $order_print_address_1 ?>:</b></td>
<td width="65%"><?php echo $dbt->p("address");?></td>
</tr>
<tr>
<td width="35%" align="right"><b><?php echo $order_print_city ?>:</b></td>
<td width="65%"><?php echo $dbt->p("city"); ?></td>
</tr>
<tr>
<td width="35%" align="right"><b><?php echo $order_print_state ?>:</b></td>
<td width="65%"><?php echo $dbt->p("province");?></td>
</tr>
<tr>
<td width="35%" align="right"><b><?php echo $order_print_zip ?>:</b></td>
<td width="65%"><?php
echo $dbt->p("zip");
?></td>
</tr>
<tr>
<td width="35%" align="right"><b><?php echo $order_print_country ?>:</b></td>
<td width="65%"><?php
echo $dbt->p("country");
?></td>
</tr>
<tr>
<td width="35%" align="right"><b><?php echo $order_print_phone ?>:</b></td>
<td width="65%"><?php
echo $dbt->p("phone");
?></td>
</tr>
<tr>
<td width="35%" align="right"><b><?php echo $order_print_fax ?>:</b></td>
<td width="65%"><?php
echo $dbt->p("fax");
?></td>
</tr>
<tr>
<td width="35%" align="right"><b><?php echo $order_print_email ?>:</b></td>
<td width="65%"><?php
echo $dbt->p("email");
?></td>
</tr>
</table>
</td>
<td width="52%" valign="top"><?php
$dbt = new ps_DB;
$qt = "SELECT * from user_info where ";
$qt .= "user_info_id='" . $db->f("user_info_id") . "'";
$dbt->query($qt);
$dbt->next_record();
?>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<TD WIDTH="35%" ALIGN="right"><B> <?php echo $order_print_name ?>:</B></TD>
<td width="65%"><?php echo $dbt->f("true_name");?></td>
</tr>
<tr>
<TD WIDTH="35%" ALIGN="right"><B><?php echo $order_print_company ?>:</B></TD>
<td width="65%"><?php
echo $dbt->p("company");
?></td>
</tr>
<tr>
<TD WIDTH="35%" ALIGN="right"><B><?php echo $order_print_address_1 ?>:</B></TD>
<td width="65%"><?php
echo $dbt->p("address");
?></td>
</tr>
<tr>
<TD WIDTH="35%" ALIGN="right"><B><?php echo $order_print_city ?>:</B></TD>
<td width="65%"><?php
echo $dbt->p("city");
?></td>
</tr>
<tr>
<TD WIDTH="35%" ALIGN="right"><B><?php echo $order_print_state ?>:</B></TD>
<td width="65%"><?php
echo $dbt->p("province");
?></td>
</tr>
<tr>
<TD WIDTH="35%" ALIGN="right"><B><?php echo $order_print_zip ?>:</B></TD>
<td width="65%"><?php
echo $dbt->p("zip");
?></td>
</tr>
<tr>
<TD WIDTH="35%" ALIGN="right"><B><?php echo $order_print_country ?>:</B></TD>
<td width="65%"><?php
echo $dbt->p("country");
?></td>
</tr>
<tr>
<TD WIDTH="35%" ALIGN="right"><B><?php echo $order_print_phone ?>:</B></TD>
<td width="65%"><?php
echo $dbt->p("phone");
?></td>
</tr>
<tr>
<TD WIDTH="35%" ALIGN="right"><B><?php echo $order_print_fax ?>:</B></TD>
<td width="65%"><?php
echo $dbt->p("fax");
?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr bgcolor="#666666">
<td><b><?php echo $order_print_shipping_lbl ?></b></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#CCCCCC">
<td width="35%"><font color="#000000"><?php echo $order_print_shipping_carrier_lbl ?></font></td>
<td width="29%"><font color="#000000"><?php echo $order_print_shipping_mode_lbl ?></font></td>
<td width="18%"><font color="#000000"><?php echo $order_print_shipping_date_lbl ?></font></td>
<td width="18%"><font color="#000000"><?php echo $order_print_shipping_price_lbl ?></font></td>
</tr>
<tr>
<td width="35%"><?php
$dbship = new ps_DB;
$q = "SELECT * from ISshipping WHERE ship_method_id =" . $db->f("ship_method_id");
$dbship->query($q);
$dbship->next_record();
$dbship->p("ship_carrier_name");
?> </td>
<td width="29%"><?php
$dbship->p("ship_method_name");
?></td>
<td width="18%"><?php
$shipdate = time();
echo date("Y-M-d", $shipdate);
?></td>
<td width="18%"><?php
$t = $db->f("order_shipping");
printf("%.2f%s", $t,$price_info["product_currency"]);
?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td bgcolor="#666666"><B><?php echo $order_print_items_lbl ?></B></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="5%" bgcolor="#CCCCCC"><B><?php echo $order_print_quantity ?></B></td>
<td width="42%" bgcolor="#CCCCCC"><B><?php echo $order_print_name ?></B></td>
<td width="9%" bgcolor="#CCCCCC"><B><?php echo $order_print_sku ?></B></td>
<td width="12%" bgcolor="#CCCCCC"><B><?php echo $order_print_price ?></B></td>
<td width="19%" bgcolor="#CCCCCC"><B><?php echo $order_print_total ?></B></td>
</tr>
<?php
$dbt = new ps_DB;
$qt = "SELECT * from orders,order_item,product ";
$qt .= "WHERE orders.order_id='$order_id' ";
$qt .= "AND order_item.order_id=orders.order_id ";
$qt .= "AND product.product_id=order_item.product_id ";
$dbt->query($qt);
$i = 0;
while ($dbt->next_record()){
?>
<tr bgcolor="<?php echo $bgcolor; ?>" valign="top">
<td width="5%"> <?php $dbt->p("product_quantity") ?></td>
<td width="42%"><?php
if ($dbt->f("product_parent_id")) {
echo $ps_product->get_field($dbt->f("product_parent_id"), "product_name");
}
else {
$dbt->p("product_name");
}
?></td>
<td width="9%"><?php
$dbt->p("product_sku");
?> </td>
<td width="12%"> <?php
$price_info = $ps_product->get_price($dbt->f("product_id"));
printf("%8.2f%s", $dbt->f("product_item_price"), $price_info["product_currency"]);
?> </td>
<td width="19%"><?php
$t = $dbt->f("product_quantity") * $dbt->f("product_item_price");
printf("%8.2f%s", $t, $price_info["product_currency"]);
?></td>
</tr>
<?php } ?>
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td width="5%"> </td>
<td width="42%"> </td>
<td colspan="2" align="right"><b> <?php echo $order_print_subtotal ?>:</b></td>
<td width="19%"><?php
$t = $db->f("order_subtotal");
printf("%.2f%s", $t, $price_info["product_currency"]);
?></td>
</tr>
<tr>
<td width="5%"> </td>
<td width="42%"> </td>
<td colspan="2" align="right"><b><?php echo $order_print_total_tax ?>:</b></td>
<td width="19%"><?php
$t = $db->f("order_tax");
printf("%.2f%s", $t,$price_info["product_currency"]);
?></td>
</tr>
<tr>
<td width="5%"> </td>
<td width="42%"> </td>
<td colspan="2" align="right"><b><?php echo $order_print_shipping ?>:</b></td>
<td width="19%"><?php
$t = $db->f("order_shipping");
printf("%.2f%s", $t,$price_info["product_currency"]);
?></td>
</tr>
<tr>
<td width="5%"> </td>
<td width="42%"> </td>
<td colspan="2" align="right"><b><?php echo $order_print_shipping_tax ?>:</b></td>
<td width="19%"><?php
$t = $db->f("order_shipping_tax");
printf("%.2f%s", $t,$price_info["product_currency"]);
?></td>
</tr>
<tr>
<td width="5%" height="24"> </td>
<td width="42%" height="24"> </td>
<td colspan="2" align="right" height="24"><b><?php echo $order_print_total ?>:</b></td>
<td width="19%" height="24"><?php
$t = $db->f("order_subtotal") +
$db->f("order_tax") +
$db->f("order_shipping") +
$db->f("order_shipping_tax");
printf("%.2f%s", $t,$price_info["product_currency"]);
?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td bgcolor="#666666"><B><?php echo $order_print_payment_lbl ?></B></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr bgcolor="#CCCCCC">
<td width="13%"><?php echo $order_print_payment_lbl ?></td>
<td width="40%"><B><?php echo $order_print_account_name ?></B></td>
<td width="30%"><b><?php echo $order_print_account_number ?> <?php
$dbpm = new ps_DB;
$q = "SELECT * FROM payment_method, order_payment WHERE order_payment.order_id='$order_id' ";
$q .= "AND payment_method.payment_method_id=order_payment.payment_method_id";
$dbpm->query($q);
$dbpm->next_record();
// DECODE Account Number
$dbaccount = new ps_DB;
$q = "SELECT DECODE(\"". addslashes($dbpm->f("order_payment_number"))."\",\"".ENCODE_KEY."\") as account_number";
$dbaccount->query($q);
$dbaccount->next_record();
?> </b></td>
<td width="17%"><?php echo $order_print_expire_date ?></td>
</tr>
<tr>
<td width="13%"><?php
$dbpm->p("payment_method_name");
?> </td>
<td width="40%"><?php
$dbpm->p("order_payment_name");
?></td>
<td width="30%"><?php
$dbaccount->p("account_number");
?></td>
<td width="17%"><?php
echo date("M-Y", $dbpm->f("order_payment_expire"));
?></td>
</tr>
</table>
</td>
</tr>
<TR>
<TD> </TD>
</TR>
<?php if (IS_ENABLE) { ?> <?php
}
?>
<tr>
<td> </td>
</tr>
<tr BGCOLOR="#666666">
<td><B><?php echo $order_print_payment_log_lbl ?></B></td>
</tr>
<tr>
<td><?php
$dbpm->p("order_payment_log");
?></td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -