public function payconfirmnoAction() { //print_r($this->_request->getParams()); $id = $this->_request->getParam('id'); //$method = $this->_request->getParam('method'); /*if($this->_request->getParam('method') == 'bank'){ $method = 1; }else{ $method = 5; }*/ $this->view->idOrder = $id; $this->view->warn = ''; if ($this->_request->isPost('adminNotes') == true) { if (strlen($this->_request->getParam('adminNotes')) == 0) { $this->view->warn = '<div class="error"> Please insert some notes</div>'; } else { $id = $this->_request->getParam('id'); $method = 6; $tblOrder = new Kutu_Core_Orm_Table_Order(); $tblHistory = new Kutu_Core_Orm_Table_OrderHistory(); $tblConfirm = new Kutu_Core_Orm_Table_PaymentConfirmation(); //echo $method; //select payment date from paymentconfirmation $date = $tblConfirm->fetchAll($tblConfirm->select()->where("orderId = " . $id . " AND confirmed = 0")); //$data['paidDate'] = @$date[0]->paymentDate; //update order $data['orderStatus'] = $method; $data['adminNotes'] = $this->_request->getParam('adminNotes'); $tblOrder->update($data, "orderId = " . $id); //update paymentconfirmation $dataConfirm['confirmed'] = 1; $dataConfirm['adminNotes'] = $this->_request->getParam('adminNotes'); $tblConfirm->update($dataConfirm, "orderId = " . $id); //add history $dataHistory = $tblHistory->fetchNew(); //history data $dataHistory['orderId'] = $id; $dataHistory['orderStatusId'] = $method; $dataHistory['dateCreated'] = date('Y-m-d'); $dataHistory['userNotified'] = 1; $dataHistory['note'] = 'rejected'; $dataHistory->save(); $mod = new App_Model_Store_Mailer(); $mod->sendReceiptToUser($id, 'Bank Transfer', "REJECTED", 1); //redirect to confirmation page $this->_helper->redirector('confirm'); } } }
public function payconfirmnoAction() { //print_r($this->_request->getParams()); $id = $this->_request->getParam('id'); //$method = $this->_request->getParam('method'); /*if($this->_request->getParam('method') == 'bank'){ $method = 1; }else{ $method = 5; }*/ $method = 6; $tblOrder = new Kutu_Core_Orm_Table_Order(); $tblHistory = new Kutu_Core_Orm_Table_OrderHistory(); $tblConfirm = new Kutu_Core_Orm_Table_PaymentConfirmation(); //echo $method; //select payment date from paymentconfirmation $date = $tblConfirm->fetchAll($tblConfirm->select()->where("orderId = " . $id . " AND confirmed = 0")); //$data['paidDate'] = @$date[0]->paymentDate; //update order $data['orderStatus'] = $method; $tblOrder->update($data, "orderId = " . $id); //mailer $this->Mailer($id, 'user-confirm', 'user'); //update paymentconfirmation $dataConfirm['confirmed'] = 1; $tblConfirm->update($dataConfirm, "orderId = " . $id); //add history $dataHistory = $tblHistory->fetchNew(); //history data $dataHistory['orderId'] = $id; $dataHistory['orderStatusId'] = $method; $dataHistory['dateCreated'] = date('Y-m-d'); $dataHistory['userNotified'] = 1; $dataHistory['note'] = 'rejected'; $dataHistory->save(); //redirect to confirmation page $this->_helper->redirector('confirm'); }