private function UpdateOfferStatus() { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('orders'); if (isset($_REQUEST['o']) && isset($_REQUEST['s'])) { $order_id = (int) $_REQUEST['o']; $status = (int) $_REQUEST['s']; $order = GetOffer($order_id); if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $order['ordvendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) { echo 0; exit; } #--------------- Baskaran $statuscode = ''; if ($status == '12') { $type = "PRIOR_AUTH_CAPTURE"; $statuscode = $this->PaymentStatus($order_id, $type); } else { $type = "VOID"; $statuscode = $this->PaymentStatus($order_id, $type); } #--------------- if ($statuscode == '1') { if (UpdateOfferStatus($order_id, $status)) { echo 1; } else { echo 0; } } } else { echo 0; } exit; }
/** * Show the form to edit an existing order. */ private function EditOffer() { $GLOBALS['BreadcrumEntries']['EditOffer'] = ''; if (!$GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Edit_Orders)) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); return; } $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); if (!isset($_REQUEST['orderId']) || !($order = GetOffer($_REQUEST['orderId']))) { FlashMessage(GetLang('InvalidOrderToEdit'), MSG_SUCCESS, 'index.php?ToDo=viewOffers'); } // Does this user have permission to edit this order? if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $order['ordvendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) { FlashMessage(GetLang('Unauthorized'), MSG_ERROR, 'index.php?ToDo=viewOffers'); } // Load the customers language file explicitly $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('customers'); $GLOBALS['FormAction'] = 'SaveUpdatedOffer'; $GLOBALS['Title'] = GetLang('EditOffer'); $GLOBALS['Intro'] = GetLang('EditOfferIntro'); $GLOBALS['SaveAndAddAnother'] = GetLang('SaveAndContinueEditing'); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $GLOBALS['OrderSession'] = isc_html_escape($_POST['orderSession']); $sessionId = $_POST['orderSession']; $api = $this->GetCartApi($order['orderid']); } else { $this->CleanupOrderManagerSessions(); unset($_SESSION['ORDER_MANAGER'][$order['orderid']]); $sessionId = $order['orderid']; // Load the products from the order in to the order session $api = $this->GetCartApi($order['orderid']); $api->LoadInOrderItems($order['orderid']); } $GLOBALS['OrderSession'] = $sessionId; $this->GetCartApi()->Set('SHIPPING_METHOD', array('methodCost' => $order['ordshipcost'], 'methodName' => $order['ordshipmethod'], 'methodModule' => $order['ordershipmodule'], 'handlingCost' => $order['ordhandlingcost'], 'methodId' => 'existing')); $this->GetCartApi()->Set('EXISTING_ORDER', $order['orderid']); $this->SetupOrderManagementForm($order); $GLOBALS['OrderItems'] = $this->GenerateOrderItemsGrid(); $summary = $this->CalculateOrderSummary($order); $GLOBALS['OrderSummary'] = $this->GenerateOrderSummaryTable($summary); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('offer.form'); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); }
private function UpdateOfferStatus() { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('orders'); if (isset($_REQUEST['o']) && isset($_REQUEST['s'])) { $order_id = (int) $_REQUEST['o']; $status = (int) $_REQUEST['s']; $order = GetOffer($order_id); if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $order['ordvendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) { echo 0; exit; } #--------------- Baskaran $statuscode = ''; if ($status == '12') { $type = "PRIOR_AUTH_CAPTURE"; $statuscode = $this->PaymentStatus($order_id, $type); } else { $type = "VOID"; $statuscode = $this->PaymentStatus($order_id, $type); } $query = $GLOBALS['ISC_CLASS_DB']->Query("SELECT * from [|PREFIX|]offers where orderid = '{$order_id}'"); $row = $GLOBALS['ISC_CLASS_DB']->Fetch($query); $cus_email = $row['ordbillemail']; #--------------- require_once ISC_BASE_PATH . "/lib/email.php"; $store_name = GetConfig('StoreName'); if ($statuscode == '1') { if (UpdateOfferStatus($order_id, $status)) { if ($status == '12') { $message = "Your Offer has been approved"; } else { $message = "Your offer has been denied"; } $obj_email = GetEmailClass(); $obj_email->Set('CharSet', GetConfig('CharacterSet')); $obj_email->From(GetConfig('OrderEmail'), $store_name); $obj_email->Set("Subject", "Make an Offer"); $obj_email->AddBody("html", $message); $obj_email->AddRecipient($cus_email, "", "h"); $email_result = $obj_email->Send(); echo 1; } else { $message = "Your offer has been denied"; $obj_email = GetEmailClass(); $obj_email->Set('CharSet', GetConfig('CharacterSet')); $obj_email->From(GetConfig('OrderEmail'), $store_name); $obj_email->Set("Subject", "Make an Offer"); $obj_email->AddBody("html", $message); $obj_email->AddRecipient($cus_email, "", "h"); $email_result = $obj_email->Send(); echo 0; } } } else { echo 0; } exit; }