Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/
require 'includes/application_top.php';
//  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_REVIEWS);
//  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_REVIEWS));
//require_once(DIR_WS_INCLUDES . 'modules/payment/estonia_seb.php');
require DIR_WS_CLASSES . 'payment.php';
$payment_modules = new payment('estonia_swed');
$p = $GLOBALS['estonia_swed'];
$result = $p->validatePayment($_REQUEST);
if ($result['payment'] == 'cancelled') {
    //delete the order, redirect
    $orderId = $result['orderNr'];
    vam_remove_order($orderId, 'on');
    vam_redirect(vam_href_link(FILENAME_CHECKOUT_CONFIRMATION, 'error_message=' . MODULE_PAYMENT_SWED_ERROR_ALL_FIELDS_REQUIRED, 'SSL'));
} else {
    if ($result['payment'] == 'success') {
        //mark the order payd
        $orderId = $result['orderNr'];
        if ($orderId) {
            if ($result['auto']) {
                if ($result['status'] > 0) {
                    $myRes = vam_db_query("update " . TABLE_ORDERS . " set orders_status = '" . $result['status'] . "', last_modified = now() where orders_id = '" . (int) $orderId . "' and orders_status <> '" . $result['status'] . "'");
                    if (mysql_affected_rows() > 0) {
                        //confirmation stuff
                        $orders_statuses = array();
                        $orders_status_array = array();
                        $orders_status_query = vam_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int) $languages_id . "'");
                        while ($orders_status = vam_db_fetch_array($orders_status_query)) {
Esempio n. 2
0
                    $html_mail_admin = $vamTemplate->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $order->info['language'] . '/accumulated_discount_admin.html');
                    $txt_mail_admin = $vamTemplate->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $order->info['language'] . '/accumulated_discount_admin.txt');
                    vam_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', EMAIL_ACC_SUBJECT, $html_mail_admin, $txt_mail_admin);
                    //email to customer
                    $html_mail_customer = $vamTemplate->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $order->info['language'] . '/accumulated_discount_customer.html');
                    $txt_mail_customer = $vamTemplate->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $order->info['language'] . '/accumulated_discount_customer.txt');
                    vam_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', EMAIL_ACC_SUBJECT, $html_mail_customer, $txt_mail_customer);
                }
            }
        }
        // eof denuz added accumulated discount
        vam_redirect(vam_href_link(FILENAME_ORDERS, vam_get_all_get_params(array('action')) . 'action=edit'));
        break;
    case 'deleteconfirm':
        $oID = vam_db_prepare_input($_GET['oID']);
        vam_remove_order($oID, $_POST['restock']);
        vam_redirect(vam_href_link(FILENAME_ORDERS, vam_get_all_get_params(array('oID', 'action'))));
        break;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html <?php 
echo HTML_PARAMS;
?>
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $_SESSION['language_charset'];
?>
">
<title><?php