public function marksellerarbitrationstatusAction()
 {
     $request = $this->getRequest();
     $this->adminOrders = new Zend_Session_Namespace('adminOrders');
     $orderItemId = $this->getRequest()->getParam('id');
     $decision = $this->getRequest()->getParam('decision');
     if ($orderItemId != '' && is_numeric($orderItemId) && isset($orderItemId)) {
         $product = new DatabaseObject_OrderProfile($this->db);
         //must check to see if the person is seller. because a seller can approve them selves as buyers if they are not the seller.
         if ($product->load($orderItemId)) {
             if ($decision == 'APPROVED') {
                 $product->orderStatus->seller_claim_approved = true;
                 $product->orderStatus->order_status = 'HELD_BY_SELLER_FOR_ARBITRATION_APPROVED';
                 $product->orderStatus->seller_claim_approved_date = date('Y-m-d G:i:s');
                 if ($product->orderStatus->save()) {
                     DatabaseObject_Helper_Admin_OrderManager::updateStatusTracking($this->db, $orderItemId, 'HELD_BY_SELLER_FOR_ARBITRATION_APPROVED');
                 }
             } elseif ($decision == 'DENIED') {
                 $product->orderStatus->seller_claim_approved = true;
                 $product->orderStatus->order_status = 'HELD_BY_SELLER_FOR_ARBITRATION_DENIED';
                 if ($product->orderStatus->save()) {
                     DatabaseObject_Helper_Admin_OrderManager::updateStatusTracking($this->db, $orderItemId, 'HELD_BY_SELLER_FOR_ARBITRATION_DENIED');
                 }
             }
         } else {
             //logg error
         }
     } else {
         //logg error
     }
 }
 public function ordercancellationbybuyerAction()
 {
     $request = $this->getRequest();
     $cancellation_reason = $request->getParam('cancellationReason');
     $productId = $request->getParam('productId');
     $product = new DatabaseObject_OrderProfile($this->db);
     if ($product->load($productId)) {
         if ($product->buyer_UserID == $this->signedInUserSessionInfoHolder->generalInfo->userID && $product->product_order_status == 'unshipped' && strtotime($product->product_absolute_latest_delivery_date) < time()) {
             echo 'here';
             $product->product_order_status = 'Cancelled by buyer';
             $product->cancellation_reason = $cancellation_reason;
             $product->save();
             $this->messenger->addMessage('You have successfully cancelled this order. The seller will be notified');
             $this->_redirect($_SERVER['HTTP_REFERER']);
         } else {
             echo 'sorry but you are not able to cancel this order';
         }
     }
 }