public function transactiondisplayAction()
 {
     $Transaction = new Model_Transaction();
     $TransID = $this->_getParam('ID');
     $this->view->status_list = $Transaction->transactionStatus();
     if ($_POST) {
         $Transaction->updateStatus($_POST);
         $this->_redirect('/admin/transactiondisplay/ID/' . $_POST['TransactionID']);
     }
     $data = $Transaction->getTransaction($TransID);
     if (!$data) {
         $this->_redirect('/admin/transactionlist/');
     }
     $rawStates = $Transaction->getData("Shipping", "", "State asc");
     foreach ($rawStates as $row) {
         $states[$row['ID']] = $row['State'];
     }
     $this->view->states = $states;
     $this->view->payment_methods = $this->paymentMethods();
     $this->view->data = $data;
     $this->render('transactiondisplay');
 }
 public function paynowAction()
 {
     $this->_helper->layout()->setLayout('page');
     $user = $this->isLoggedIn();
     if (!$user) {
         $this->_redirect('/login/');
     }
     $transaction_id = $this->_getParam('TransactionID') ? $this->_getParam('TransactionID') : 0;
     $transactions = new Model_Transaction();
     if ($transaction_id) {
         $data = $transactions->getUserTransaction($transaction_id, $user['SiteEmail']);
     } else {
         $this->_redirect('/myorders/');
     }
     if (!$data) {
         $this->_redirect('/myorders/');
     }
     $products = new Model_Products();
     $products_data = array();
     foreach ($data as $row) {
         $products_data[$row['ProductID']] = $products->ListProducts($row['ProductID']);
     }
     //echo '<pre>'; print_r($products_data); exit;
     $this->view->products_data = $products_data;
     $payment_exists = $transactions->getData("Payments t1", "t1.TransactionID=" . $transaction_id, "", "", "Transactions t2 on t2.ID = t1.TransactionID");
     if ($payment_exists) {
         $this->view->payment_exists = 1;
         $this->view->payment_data = $payment_exists;
     }
     $rawStates = $transactions->getData("Shipping", "", "State asc");
     foreach ($rawStates as $row) {
         $states[$row['ID']] = $row['State'];
     }
     $this->view->states = $states;
     $this->view->payment_methods = $this->paymentMethods();
     $this->view->data = $data;
     $this->view->transaction_id = $transaction_id;
     $this->view->paynow_page = 1;
 }