本文整理汇总了PHP中tep_db_output函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_db_output函数的具体用法?PHP tep_db_output怎么用?PHP tep_db_output使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_db_output函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_common_description
/**
* Get common order description:
* - order id
* - invoice url
* - date
* - comments
*
* @param order $order Order
*
* @return string Common order description
*/
protected function get_common_description(OsCommerceOrder $order)
{
$invoice_url = tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order->info['order_id'], 'SSL', false);
$common_info = EMAIL_TEXT_ORDER_NUMBER . ': ' . $order->info['order_id'] . "\n" . ($common_info .= EMAIL_TEXT_INVOICE_URL . ': ' . $invoice_url . "\n");
$common_info .= EMAIL_TEXT_DATE_ORDERED . ': ' . strftime(DATE_FORMAT_LONG) . "\n";
if ($order->info['comments']) {
$common_info .= EMAIL_TEXT_COMMENTS . ': ' . tep_db_output($order->info['comments']) . "\n";
}
return $common_info;
}
示例2: tep_date_short
?>
</b> <?php
echo tep_date_short($rInfo->date_added);
?>
</td>
</tr>
</table>
</tr>
<tr>
<td><table witdh="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" class="main"><b><?php
echo ENTRY_REVIEW;
?>
</b><br><br><?php
echo nl2br(tep_db_output(tep_break_string($rInfo->reviews_text, 15)));
?>
</td>
</tr>
</table></td>
</tr>
<tr>
<td><?php
echo tep_draw_separator('pixel_trans.gif', '1', '10');
?>
</td>
</tr>
<tr>
<td class="main"><b><?php
echo ENTRY_RATING;
?>
示例3: before_process
function before_process()
{
global $order_id, $order, $languages_id, $currencies, $order_totals, $customer_id, $sendto, $billto, $payment;
$new_order_status = DEFAULT_ORDERS_STATUS_ID;
if (OSCOM_APP_PAYPAL_PS_ORDER_STATUS_ID > 0) {
$new_order_status = OSCOM_APP_PAYPAL_PS_ORDER_STATUS_ID;
}
tep_db_query("update orders set orders_status = '" . (int) $new_order_status . "', last_modified = now() where orders_id = '" . (int) $order_id . "'");
$sql_data_array = array('orders_id' => $order_id, 'orders_status_id' => (int) $new_order_status, 'date_added' => 'now()', 'customer_notified' => SEND_EMAILS == 'true' ? '1' : '0', 'comments' => $order->info['comments']);
tep_db_perform('orders_status_history', $sql_data_array);
// initialized for the email confirmation
$products_ordered = '';
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
// Stock Update - Joao Correia
if (STOCK_LIMITED == 'true') {
if (DOWNLOAD_ENABLED == 'true') {
$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename\n FROM products p\n LEFT JOIN products_attributes pa\n ON p.products_id=pa.products_id\n LEFT JOIN products_attributes_download pad\n ON pa.products_attributes_id=pad.products_attributes_id\n WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
// Will work with only one option for downloadable products
// otherwise, we have to build the query dynamically with a loop
$products_attributes = isset($order->products[$i]['attributes']) ? $order->products[$i]['attributes'] : '';
if (is_array($products_attributes)) {
$stock_query_raw .= " AND pa.options_id = '" . (int) $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . (int) $products_attributes[0]['value_id'] . "'";
}
$stock_query = tep_db_query($stock_query_raw);
} else {
$stock_query = tep_db_query("select products_quantity from products where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
}
if (tep_db_num_rows($stock_query) > 0) {
$stock_values = tep_db_fetch_array($stock_query);
// do not decrement quantities if products_attributes_filename exists
if (DOWNLOAD_ENABLED != 'true' || !$stock_values['products_attributes_filename']) {
$stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
} else {
$stock_left = $stock_values['products_quantity'];
}
tep_db_query("update products set products_quantity = '" . (int) $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
if ($stock_left < 1 && STOCK_ALLOW_CHECKOUT == 'false') {
tep_db_query("update products set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
}
}
}
// Update products_ordered (for bestsellers list)
tep_db_query("update products set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
//------insert customer choosen option to order--------
$attributes_exist = '0';
$products_ordered_attributes = '';
if (isset($order->products[$i]['attributes'])) {
$attributes_exist = '1';
for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
if (DOWNLOAD_ENABLED == 'true') {
$attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename\n from products_options popt, products_options_values poval, products_attributes pa\n left join products_attributes_download pad\n on pa.products_attributes_id=pad.products_attributes_id\n where pa.products_id = '" . (int) $order->products[$i]['id'] . "'\n and pa.options_id = '" . (int) $order->products[$i]['attributes'][$j]['option_id'] . "'\n and pa.options_id = popt.products_options_id\n and pa.options_values_id = '" . (int) $order->products[$i]['attributes'][$j]['value_id'] . "'\n and pa.options_values_id = poval.products_options_values_id\n and popt.language_id = '" . (int) $languages_id . "'\n and poval.language_id = '" . (int) $languages_id . "'";
$attributes = tep_db_query($attributes_query);
} else {
$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from products_options popt, products_options_values poval, products_attributes pa where pa.products_id = '" . (int) $order->products[$i]['id'] . "' and pa.options_id = '" . (int) $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int) $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int) $languages_id . "' and poval.language_id = '" . (int) $languages_id . "'");
}
$attributes_values = tep_db_fetch_array($attributes);
$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
}
}
//------insert customer choosen option eof ----
$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}
// lets start with the email confirmation
$email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link('account_history_info.php', 'order_id=' . $order_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
if ($order->info['comments']) {
$email_order .= tep_db_output($order->info['comments']) . "\n\n";
}
$email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n";
for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
}
if ($order->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
}
$email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
if (isset($GLOBALS[$payment]) && is_object($GLOBALS[$payment])) {
$email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n";
$payment_class = $GLOBALS[$payment];
$email_order .= $payment_class->title . "\n\n";
if ($payment_class->email_footer) {
$email_order .= $payment_class->email_footer . "\n\n";
}
}
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
// send emails to other people
if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
// load the after_process function from the payment modules
$this->after_process();
}
示例4: tep_date_short
?>
</b> <?php
echo tep_date_short($rInfo->date_added);
?>
</td>
</tr>
</table>
</tr>
<tr>
<td><table witdh="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" class="main"><b><?php
echo ENTRY_REVIEW;
?>
</b><br><br><?php
echo nl2br(tep_db_output($rInfo->reviews_text));
?>
</td>
</tr>
</table></td>
</tr>
<tr>
<td><?php
echo tep_draw_separator('pixel_trans.gif', '1', '10');
?>
</td>
</tr>
<tr>
<td class="main"><b><?php
echo ENTRY_RATING;
?>
示例5: array
$sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'orders_products_filename' => $attributes_values['products_attributes_filename'], 'download_maxdays' => $attributes_values['products_attributes_maxdays'], 'download_count' => $attributes_values['products_attributes_maxcount']);
tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
}
$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
}
}
//------insert customer choosen option eof ----
$total_weight += $order->products[$i]['qty'] * $order->products[$i]['weight'];
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;
$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}
// lets start with the email confirmation
$email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
if ($order->info['comments']) {
$email_order .= tep_db_output($order->info['comments']) . "\n\n";
}
$email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n";
for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
}
if ($order->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
}
$email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
if (is_object(${$payment})) {
$email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n";
$payment_class = ${$payment};
$email_order .= $payment_class->title . "\n\n";
if ($payment_class->email_footer) {
$email_order .= $payment_class->email_footer . "\n\n";
示例6: tep_db_query
<td class="smallText" align="center"><b><?php
echo TABLE_HEADING_COMMENTS;
?>
</b></td>
</tr>
<?php
$orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
if (tep_db_num_rows($orders_history_query)) {
while ($orders_history = tep_db_fetch_array($orders_history_query)) {
echo ' <tr>' . "\n" . ' <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" . ' <td class="smallText" align="center">';
if ($orders_history['customer_notified'] == '1') {
echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
} else {
echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
}
echo ' <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" . ' <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" . ' </tr>' . "\n";
}
} else {
echo ' <tr>' . "\n" . ' <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" . ' </tr>' . "\n";
}
?>
</table></td>
</tr>
<tr>
<td class="main"><br><b><?php
echo TABLE_HEADING_COMMENTS;
?>
</b></td>
</tr>
<tr>
<td><?php
示例7: tep_db_query
<td width="91" align="center" class="smallText" style="border:solid 1px #0099FF; border-top:0; border-left:0"><b><?php
echo TABLE_HEADING_DATE_ADDED;
?>
</b></td>
<td align="center" class="smallText" style="border-bottom:solid 1px #0099FF;"><b><?php
echo TABLE_HEADING_COMMENTS;
?>
</b></td>
</tr>
<?php
$admin_comments_query = tep_db_query("SELECT orders_id, \n\t\t\t\t\t\t\t\t\t\t\t\t date_added, \n\t\t\t\t\t\t\t\t\t\t\t\t comments, \n\t\t\t\t\t\t\t\t\t\t\t\t admin_user \n\t\t\t\t\t\t\t\t\t\t FROM admin_comments \n\t\t\t\t\t\t\t\t\t\t WHERE orders_id = '" . tep_db_input($oID) . "'\n\t\t\t\t\t\t\t\t\t\t ORDER BY date_added\n\t\t\t\t\t\t\t\t\t\t");
if (tep_db_num_rows($admin_comments_query)) {
while ($admin_history = tep_db_fetch_array($admin_comments_query)) {
echo '<tr>
<td class="smallText" align="center" style="border-right:solid 1px #0099FF; padding:10px;">' . tep_datetime_short($admin_history['date_added']) . (!empty($admin_history['admin_user']) ? '<br><br><b>By: ' . $admin_history['admin_user'] : '') . '</b></td>
<td class="smallText" style="padding:10px;">' . tep_db_output($admin_history['comments']) . ' </td>
</tr>';
}
} else {
echo '<tr>
<td class="smallText" colspan="2" style="padding:10px;">No Admin Comments.</td>
</tr>';
}
?>
</table></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">
<tr>
<td class="main" style="padding-top:10px;"><b>Admin Only Comments</b></td>
示例8: before_process
//.........这里部分代码省略.........
tep_db_query("update orders set orders_status = '" . (int) $new_order_status . "', last_modified = now() where orders_id = '" . (int) $order_id . "'");
$sql_data_array = array('orders_id' => $order_id, 'orders_status_id' => (int) $new_order_status, 'date_added' => 'now()', 'customer_notified' => SEND_EMAILS == 'true' ? '1' : '0', 'comments' => $order->info['comments']);
tep_db_perform('orders_status_history', $sql_data_array);
// initialized for the email confirmation
$products_ordered = '';
$subtotal = 0;
$total_tax = 0;
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
// Stock Update - Joao Correia
if (STOCK_LIMITED == 'true') {
if (DOWNLOAD_ENABLED == 'true') {
$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename\n FROM products p\n LEFT JOIN products_attributes pa\n ON p.products_id=pa.products_id\n LEFT JOIN products_attributes_download pad\n ON pa.products_attributes_id=pad.products_attributes_id\n WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
// Will work with only one option for downloadable products
// otherwise, we have to build the query dynamically with a loop
$products_attributes = $order->products[$i]['attributes'];
if (is_array($products_attributes)) {
$stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
}
$stock_query = tep_db_query($stock_query_raw);
} else {
$stock_query = tep_db_query("select products_quantity from products where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
}
if (tep_db_num_rows($stock_query) > 0) {
$stock_values = tep_db_fetch_array($stock_query);
// do not decrement quantities if products_attributes_filename exists
if (DOWNLOAD_ENABLED != 'true' || !$stock_values['products_attributes_filename']) {
$stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
} else {
$stock_left = $stock_values['products_quantity'];
}
tep_db_query("update products set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
if ($stock_left < 1 && STOCK_ALLOW_CHECKOUT == 'false') {
tep_db_query("update products set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
}
}
}
// Update products_ordered (for bestsellers list)
tep_db_query("update products set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
//------insert customer choosen option to order--------
$attributes_exist = '0';
$products_ordered_attributes = '';
if (isset($order->products[$i]['attributes'])) {
$attributes_exist = '1';
for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
if (DOWNLOAD_ENABLED == 'true') {
$attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename\n from products_options popt, products_options_values poval, products_attributes pa\n left join products_attributes_download pad\n on pa.products_attributes_id=pad.products_attributes_id\n where pa.products_id = '" . $order->products[$i]['id'] . "'\n and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'\n and pa.options_id = popt.products_options_id\n and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'\n and pa.options_values_id = poval.products_options_values_id\n and popt.language_id = '" . $languages_id . "'\n and poval.language_id = '" . $languages_id . "'";
$attributes = tep_db_query($attributes_query);
} else {
$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from products_options popt, products_options_values poval, products_attributes pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
}
$attributes_values = tep_db_fetch_array($attributes);
$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
}
}
//------insert customer choosen option eof ----
$total_weight += $order->products[$i]['qty'] * $order->products[$i]['weight'];
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;
$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}
// lets start with the email confirmation
$email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link('account_history_info.php', 'order_id=' . $order_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
if ($order->info['comments']) {
$email_order .= tep_db_output($order->info['comments']) . "\n\n";
}
$email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n";
for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
}
if ($order->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
}
$email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
if (is_object(${$payment})) {
$email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n";
$payment_class = ${$payment};
$email_order .= $payment_class->title . "\n\n";
if ($payment_class->email_footer) {
$email_order .= $payment_class->email_footer . "\n\n";
}
}
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
// send emails to other people
if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
// load the after_process function from the payment modules
$this->after_process();
$cart->reset(true);
// unregister session variables used during checkout
tep_session_unregister('sendto');
tep_session_unregister('billto');
tep_session_unregister('shipping');
tep_session_unregister('payment');
tep_session_unregister('comments');
tep_session_unregister('cart_PayPal_Pro_HS_ID');
tep_session_unregister('pphs_result');
tep_session_unregister('pphs_key');
tep_redirect(tep_href_link('checkout_process.php', '', 'SSL'));
}
示例9: tep_datetime_short
if (ORDER_EDITOR_USE_AJAX == 'true') {
echo ' <tr class="' . $rowClass . '" id="commentRow' . $orders_history['orders_status_history_id'] . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')">' . "\n" . ' <td class="smallText" align="center"><div id="do_not_delete"><input name="update_comments[' . $orders_history['orders_status_history_id'] . '][delete]" type="checkbox" onClick="updateCommentsField(\'delete\', \'' . $orders_history['orders_status_history_id'] . '\', this.checked, \'\', this)"></div></td>' . "\n" . ' <td class="smallText">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" . ' <td class="smallText" align="center">';
} else {
echo ' <tr class="' . $rowClass . '" id="commentRow' . $orders_history['orders_status_history_id'] . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')">' . "\n" . ' <td class="smallText" align="center"><div id="do_not_delete"><input name="update_comments[' . $orders_history['orders_status_history_id'] . '][delete]" type="checkbox"></div></td>' . "\n" . ' <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" . ' <td class="smallText" align="center">';
}
if ($orders_history['customer_notified'] == '1') {
echo tep_image(DIR_WS_ICONS . 'tick.png', ICON_TICK) . "</td>\n";
} else {
echo tep_image(DIR_WS_ICONS . 'cross.png', ICON_CROSS) . "</td>\n";
}
echo ' <td class="smallText" align="left">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n";
echo ' <td class="smallText" align="left">';
if (ORDER_EDITOR_USE_AJAX == 'true') {
echo tep_draw_textarea_field("update_comments[" . $orders_history['orders_status_history_id'] . "][comments]", "40", "5", "" . tep_db_output($orders_history['comments']) . "", "onChange=\"updateCommentsField('update', '" . $orders_history['orders_status_history_id'] . "', 'false', encodeURIComponent(this.value))\"") . '' . "\n" . ' </td>' . "\n";
} else {
echo tep_draw_textarea_field("update_comments[" . $orders_history['orders_status_history_id'] . "][comments]", "40", "5", "" . tep_db_output($orders_history['comments']) . "") . '' . "\n" . ' </td>' . "\n";
}
echo ' </tr>' . "\n";
}
} else {
echo ' <tr>' . "\n" . ' <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" . ' </tr>' . "\n";
}
?>
</table>
</div>
<div>
<?php
echo tep_draw_separator('pixel_trans.gif', '1', '1');
?>
</div>
示例10: before_process
//.........这里部分代码省略.........
}
}
// Update products_ordered (for bestsellers list)
tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
//++++ QT Pro: Begin Changed code
if (!isset($products_stock_attributes)) {
$products_stock_attributes = null;
}
$sql_data_array = array('orders_id' => $insert_id, 'products_id' => tep_get_prid($order->products[$i]['id']), 'products_model' => $order->products[$i]['model'], 'products_name' => $order->products[$i]['name'], 'products_price' => $order->products[$i]['price'], 'final_price' => $order->products[$i]['final_price'], 'products_tax' => $order->products[$i]['tax'], 'products_quantity' => $order->products[$i]['qty'], 'products_stock_attributes' => $products_stock_attributes);
//++++ QT Pro: End Changed Code
tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
$order_products_id = tep_db_insert_id();
// Start - CREDIT CLASS Gift Voucher Contribution
// if (isset($order_total_modules)) {
// $order_total_modules->update_credit_account($i);
// }
// End - CREDIT CLASS Gift Voucher Contribution
//------insert customer choosen option to order--------
$attributes_exist = '0';
$products_ordered_attributes = '';
if (isset($order->products[$i]['attributes'])) {
$attributes_exist = '1';
for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
if (DOWNLOAD_ENABLED == 'true') {
$attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename\n from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa\n left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\n on pa.products_attributes_id=pad.products_attributes_id\n where pa.products_id = '" . $order->products[$i]['id'] . "'\n and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'\n and pa.options_id = popt.products_options_id\n and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'\n and pa.options_values_id = poval.products_options_values_id\n and popt.language_id = '" . $languages_id . "'\n and poval.language_id = '" . $languages_id . "'";
$attributes = tep_db_query($attributes_query);
} else {
$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
}
$attributes_values = tep_db_fetch_array($attributes);
$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
}
}
//------insert customer choosen option eof ----
$total_weight += $order->products[$i]['qty'] * $order->products[$i]['weight'];
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;
$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}
// Start - CREDIT CLASS Gift Voucher Contribution
if (isset($order_total_modules)) {
$order_total_modules->apply_credit();
}
// End - CREDIT CLASS Gift Voucher Contribution
// lets start with the email confirmation
$email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
if ($order->info['comments']) {
$email_order .= tep_db_output($order->info['comments']) . "\n\n";
}
$email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n";
for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
}
/* One Page Checkout - BEGIN */
$sendToFormatted = tep_address_label($customer_id, $sendto, 0, '', "\n");
if (ONEPAGE_CHECKOUT_ENABLED == 'True') {
$sendToFormatted = $onePageCheckout->getAddressFormatted('sendto');
}
$billToFormatted = tep_address_label($customer_id, $billto, 0, '', "\n");
if (ONEPAGE_CHECKOUT_ENABLED == 'True') {
$billToFormatted = $onePageCheckout->getAddressFormatted('billto');
}
/* One Page Checkout - END */
if ($order->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
}
$email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
if (is_object(${$payment})) {
$email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n";
$payment_class = ${$payment};
$email_order .= $payment_class->title . "\n\n";
if ($payment_class->email_footer) {
$email_order .= $payment_class->email_footer . "\n\n";
}
}
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
// send emails to other people
if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
// load the after_process function from the payment modules
$this->after_process();
$cart->reset(true);
// unregister session variables used during checkout
tep_session_unregister('sendto');
tep_session_unregister('billto');
tep_session_unregister('shipping');
tep_session_unregister('payment');
tep_session_unregister('comments');
// Added Bugfix 157
if (tep_session_is_registered('credit_covers')) {
tep_session_unregister('credit_covers');
}
if (isset($order_total_modules)) {
$order_total_modules->clear_posts();
}
// End - CREDIT CLASS Gift Voucher Contribution
tep_session_unregister('cart_PayPal_Standard_ID');
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));
}
示例11: before_process
function before_process()
{
global $customer_id, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart, $cart_PostFinance_ID;
global ${$payment};
$order_id = substr($cart_PostFinance_ID, strpos($cart_PostFinance_ID, '-') + 1);
$order_status = $_GET['STATUS'];
$check_query = tep_db_query("select orders_status from " . TABLE_ORDERS . " where orders_id = '" . (int) $order_id . "'");
if (tep_db_num_rows($check_query)) {
$check = tep_db_fetch_array($check_query);
if ($check['orders_status'] == MODULE_PAYMENT_POSTFINANCE_PREPARE_ORDER_STATUS_ID) {
$sql_data_array = array('orders_id' => $order_id, 'orders_status_id' => MODULE_PAYMENT_POSTFINANCE_PREPARE_ORDER_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => '0', 'comments' => '');
tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
}
}
if ($order_status == '5' || $order_status == '9' || $order_status == '91' || $order_status == '51') {
tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . (MODULE_PAYMENT_POSTFINANCE_ORDER_STATUS_ID > 0 ? (int) MODULE_PAYMENT_POSTFINANCE_ORDER_STATUS_ID : (int) DEFAULT_ORDERS_STATUS_ID) . "', last_modified = now() where orders_id = '" . (int) $order_id . "'");
}
if ($order_status == '5') {
$comment_status = 'PostFinance IPN Verified [Payment has been authorized]';
} elseif ($order_status == '9') {
$comment_status = 'PostFinance IPN Verified [Payment has been accepted]';
} elseif ($order_status == '51' || $order_status == '91') {
$comment_status = 'PostFinance IPN Verified [Payment is pending]';
}
if ($order_status == "2") {
$comment_status = 'PostFinance IPN Invalid [Declined]';
} elseif ($order_status == "52" || $order_status == "92") {
$comment_status = 'PostFinance IPN Invalid [Exception occured]';
} elseif ($order_status == "1") {
$comment_status = 'PostFinance IPN Invalid [Cancelled]';
}
$sql_data_array = array('orders_id' => $order_id, 'orders_status_id' => MODULE_PAYMENT_POSTFINANCE_ORDER_STATUS_ID > 0 ? (int) MODULE_PAYMENT_POSTFINANCE_ORDER_STATUS_ID : (int) DEFAULT_ORDERS_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => SEND_EMAILS == 'true' ? '1' : '0', 'comments' => $comment_status);
tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
// initialized for the email confirmation
$products_ordered = '';
$subtotal = 0;
$total_tax = 0;
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
if (STOCK_LIMITED == 'true') {
if (DOWNLOAD_ENABLED == 'true') {
$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename\r\n FROM " . TABLE_PRODUCTS . " p\r\n LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa\r\n ON p.products_id=pa.products_id\r\n LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\r\n ON pa.products_attributes_id=pad.products_attributes_id\r\n WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
$products_attributes = $order->products[$i]['attributes'];
if (is_array($products_attributes)) {
$stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
}
$stock_query = tep_db_query($stock_query_raw);
} else {
$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
}
if (tep_db_num_rows($stock_query) > 0) {
$stock_values = tep_db_fetch_array($stock_query);
if (DOWNLOAD_ENABLED != 'true' || !$stock_values['products_attributes_filename']) {
$stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
} else {
$stock_left = $stock_values['products_quantity'];
}
if ($order_status == '5' || $order_status == '9' || $order_status == '91' || $order_status == '51') {
tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
if ($stock_left < 1 && STOCK_ALLOW_CHECKOUT == 'false') {
tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
}
}
}
}
if ($order_status == '5' || $order_status == '9' || $order_status == '91' || $order_status == '51') {
tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
}
//------insert customer choosen option to order--------
$attributes_exist = '0';
$products_ordered_attributes = '';
if (isset($order->products[$i]['attributes'])) {
$attributes_exist = '1';
for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
if (DOWNLOAD_ENABLED == 'true') {
$attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename\r\n from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa\r\n left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\r\n on pa.products_attributes_id=pad.products_attributes_id\r\n where pa.products_id = '" . $order->products[$i]['id'] . "'\r\n and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'\r\n and pa.options_id = popt.products_options_id\r\n and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'\r\n and pa.options_values_id = poval.products_options_values_id\r\n and popt.language_id = '" . $languages_id . "'\r\n and poval.language_id = '" . $languages_id . "'";
$attributes = tep_db_query($attributes_query);
} else {
$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
}
$attributes_values = tep_db_fetch_array($attributes);
$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
}
}
//------insert customer choosen option eof ----
$total_weight += $order->products[$i]['qty'] * $order->products[$i]['weight'];
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;
$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}
// lets start with the email confirmation
$email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
if ($order->info['comments']) {
$email_order .= tep_db_output($order->info['comments']) . "\n\n";
}
$email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n";
for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
}
if ($order->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
//.........这里部分代码省略.........
示例12: before_process
function before_process()
{
global $customer_id, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart, $cart_PayPal_Standard_ID;
$insert_id = substr($cart_PayPal_Standard_ID, strpos($cart_PayPal_Standard_ID, '-') + 1);
$check_query = tep_db_query("select orders_status from " . TABLE_ORDERS . " where orders_id = '" . (int) $insert_id . "'");
if (tep_db_num_rows($check_query)) {
$check = tep_db_fetch_array($check_query);
if ($check['orders_status'] == MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID) {
$sql_data_array = array('orders_id' => $insert_id, 'orders_status_id' => MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => '0', 'comments' => '');
tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
}
}
tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . (MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID > 0 ? (int) MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID : (int) DEFAULT_ORDERS_STATUS_ID) . "', last_modified = now() where orders_id = '" . (int) $insert_id . "'");
$sql_data_array = array('orders_id' => $insert_id, 'orders_status_id' => MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID > 0 ? (int) MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID : (int) DEFAULT_ORDERS_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => SEND_EMAILS == 'true' ? '1' : '0', 'comments' => $order->info['comments']);
tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
// initialized for the email confirmation
$products_ordered = '';
$subtotal = 0;
$total_tax = 0;
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
// Update products_ordered (for bestsellers list)
tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
//------insert customer choosen option eof ----
$total_weight += $order->products[$i]['qty'] * $order->products[$i]['weight'];
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;
$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . "\n";
}
// lets start with the email confirmation
$email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long(DATE_FORMAT_LONG) . "\n\n";
if ($order->info['comments']) {
$email_order .= tep_db_output($order->info['comments']) . "\n\n";
}
$email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n";
for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
}
if ($order->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, false) . "\n";
}
if ($billto != false) {
// $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
// EMAIL_SEPARATOR . "\n" .
// tep_address_label($customer_id, $billto, false) . "\n\n";
}
if (is_object(${$payment})) {
$email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n";
$payment_class = ${$payment};
$email_order .= $payment_class->title . "\n\n";
if ($payment_class->email_footer) {
$email_order .= strip_tags($payment_class->email_footer) . "\n\n";
}
}
$email_subject = STORE_NAME . ' - ' . sprintf(EMAIL_TEXT_SUBJECT, $insert_id);
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], $email_subject, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
// send emails to other people
if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, $email_subject, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
// load the after_process function from the payment modules
$this->after_process();
$cart->reset(true);
$order = new order($insert_id);
$order_total_sum = 0;
$order_shipping_sum = 0;
reset($order->totals);
while (list(, $order_total) = each($order->totals)) {
if ($order_total['class'] == 'ot_total') {
$order_total_sum = $order_total['value'];
} elseif ($order_total['class'] == 'ot_shipping') {
$order_shipping_sum = $order_total['value'];
}
}
$order_shipping_title = strtolower($order->info['shipping_method']);
if (mb_strpos($order_shipping_title, 'самовывоз', 0, 'CP1251') !== false) {
$order_shipping_id = 1;
} elseif (mb_strpos($order_shipping_title, 'подмосковье', 0, 'CP1251') !== false) {
if ($order_shipping_sum == 0) {
$order_shipping_id = 5;
} else {
$order_shipping_id = 4;
}
} elseif (mb_strpos($order_shipping_title, 'курьером', 0, 'CP1251') !== false) {
if ($order_shipping_sum == 0) {
$order_shipping_id = 3;
} else {
$order_shipping_id = 2;
}
} elseif (mb_strpos($order_shipping_title, 'почт', 0, 'CP1251') !== false) {
if (DOMAIN_ZONE == 'ru') {
$order_shipping_id = 6;
} elseif (DOMAIN_ZONE == 'ua') {
$order_shipping_id = 8;
} elseif (DOMAIN_ZONE == 'by') {
$order_shipping_id = 9;
}
} elseif (strpos($order_shipping_title, 'postal') !== false) {
$order_shipping_id = 7;
} elseif (strpos($order_shipping_title, 'deutsche') !== false) {
$order_shipping_id = 10;
//.........这里部分代码省略.........
示例13: tep_date_short
</table>
</td>
</tr>
<tr>
<td align="center" width="95%">
<table width="95%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="95%" class="smallText">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">
<tr>
<td width="150" align="left" valign="top" class="smallText"><?php
echo tep_date_short($sInfo->date_added);
?>
</td>
<td align="left" valign="top" class="smallText"><?php
echo nl2br(tep_db_output($orders_comments['comments']));
?>
<br><br></td>
</tr>
</table></td>
</tr></table></td></tr>
<?php
}
}
}
if ($has_comments == false) {
?>
<tr>
<td align="center" width="95%">
示例14: tep_db_query
</tr>
<?php
$supply_request_history_query = tep_db_query("SELECT * FROM " . TABLE_SUPPLY_REQUEST_STATUS_HISTORY . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t WHERE supply_request_id = '" . (int) $sID . "' \r\n\t\t\t\t\t\t\t\t\t\t\t\t ORDER BY date_added\r\n\t\t\t\t\t\t\t\t\t\t\t\t");
if (tep_db_num_rows($supply_request_history_query)) {
while ($supply_request_history = tep_db_fetch_array($supply_request_history_query)) {
echo '<tr>
<td class="smallText" align="center">' . tep_datetime_short($supply_request_history['date_added']) . '</td>
<td class="smallText" align="center">';
if ($supply_request_history['supplier_notified'] == '1') {
echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK);
} else {
echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS);
}
echo ' </td>
<td class="smallText" align="left">' . $supply_request_status_array[$supply_request_history['supply_request_status_id']] . '</td>
<td class="smallText" align="left" width="50%">' . nl2br(tep_db_output($supply_request_history['comments'])) . ' </td>
</tr>';
}
} else {
echo ' <tr><td class="smallText" colspan="5">' . TEXT_NO_SUPPLY_REQUEST_HISTORY . '</td></tr>';
}
?>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="left"><?php
echo TABLE_HEADING_STATUS;
示例15: tep_db_query
<td class="dataTableHeadingContent"><?php
echo TABLE_HEADING_TRANSACTION_INFO;
?>
</td>
</tr>
<?php
$orders_history_query = tep_db_query("select orders_status_history_id, orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
if (tep_db_num_rows($orders_history_query)) {
while ($orders_history = tep_db_fetch_array($orders_history_query)) {
echo ' <tr class="dataTableRow" onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)">' . "\n" . ' <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" . ' <td class="smallText" align="center">';
if ($orders_history['customer_notified'] == '1') {
echo tep_image(DIR_WS_ICONS . 'tick.png', ICON_TICK) . "</td>\n";
} else {
echo tep_image(DIR_WS_ICONS . 'cross.png', ICON_CROSS) . "</td>\n";
}
echo ' <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" . ' <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" . ' <td class="smallText">' . $paypal_wpp->get_transaction_info($orders_history['orders_status_history_id']) . '</td>' . "\n" . ' </tr>' . "\n";
}
} else {
echo ' <tr>' . "\n" . ' <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" . ' </tr>' . "\n";
}
?>
</table></td>
</tr>
<tr>
<td class="main"><br><b><?php
echo TABLE_HEADING_NEW_ORDER_COMMENTS;
?>
</b></td>
</tr>
<tr>
<td><?php