public function mailerAdmin($idOrder, $key, $userTo) { $mail = new PaymentGateway_HtmlMail(); $tblSetting = new Kutu_Core_Orm_Table_PaymentSetting(); $template = $tblSetting->fetchAll($tblSetting->select()->where("settingKey = '{$key}'")); $tblOrder = new Kutu_Core_Orm_Table_Order(); $tbluser = new Kutu_Core_Orm_Table_User(); $tblOrderDetail = new Kutu_Core_Orm_Table_OrderDetail(); $tblSetting = new Kutu_Core_Orm_Table_PaymentSetting(); $lgsMail = $tblSetting->fetchAll($tblSetting->select()->where("settingKey = 'paypalBusiness'")); $userDetailInfo = $tbluser->userInfoOrder($idOrder); $rowset = $tblOrder->getOrderAndStatus($idOrder); $rowsetDetail = $tblOrderDetail->fetchAll($tblOrderDetail->select()->where("orderId = " . $idOrder)); $tblConfirm = new Kutu_Core_Orm_Table_PaymentConfirmation(); if ($rowset[0]->orderStatus == 6) { $status = 'rejected'; } else { $status = 'confirmed'; } $unConfirmed = $tblConfirm->fetchAll($tblConfirm->select()->where("confirmed =0 AND orderId = " . $idOrder)); echo '<pre>'; //print_r($userDetailInfo); echo '</pre>'; $detail = "ORDER ID : " . $idOrder . '<br/>' . 'Detail : <br/><blockquote><ol>'; foreach ($rowsetDetail as $row) { $detail .= '<li><ul> <li>Document Name: ' . $row->documentName . '</li> <li>Quantity : ' . $row->qty . '</li> <li>Price : USD ' . number_format($row->price, 2) . ' </li> <li>Tax : ' . number_format($row->tax, 2) . ' %</li> <li>Final Price : ' . number_format($row->finalPrice, 2) . '</li> </ul></li>'; } $detail .= '</ol><blockquote><br />'; //print_r($detail); $sMailSource = $template[0]->note; if ($userTo == 'admin') { $sMailEmailTo = $lgsMail[0]->settingValue; $sMailEmailFrom = $userDetailInfo[0]->email; $link = '<a href="' . KUTU_ROOT_URL . '/admin/store/detailOrder/id/' . $idOrder . '">here</a>'; } else { $sMailEmailTo = $userDetailInfo[0]->email; $sMailEmailFrom = $lgsMail[0]->settingValue; $link = '<a href="' . KUTU_ROOT_URL . '/site/store_payment/detail/id/' . $idOrder . '">here</a>'; } $sMailSubject = "Confirmation for user payment"; $sMailHeader = ''; $aMailDataSet = array('PAYMENTDATE' => $unConfirmed[0]->paymentDate, 'PAIDTIME' => $unConfirmed[0]->paymentDate, 'PAYMENT' => $rowset[0]->paymentMethod, 'DESCRIPTION' => $detail, 'TOTALORDER' => $rowset[0]->orderTotal, 'ORDERTIME' => $rowset[0]->datePurchased, 'INVOICE' => $rowset[0]->invoiceNumber, 'METHOD' => $rowset[0]->paymentMethod, 'LINK' => $link, 'STATUS' => $status); $mail->SendFileMail($sMailSource, $sMailEmailTo, $sMailSubject, $sMailEmailFrom, $sMailHeader, $aMailDataSet); }
public function editpaymentsettingAction() { $idSetting = $this->_request->getParam('id'); $tblPaymentSetting = new Kutu_Core_Orm_Table_PaymentSetting(); $rowset = $tblPaymentSetting->fetchAll($tblPaymentSetting->select()->where("settingId = " . $idSetting)); $this->view->id = $idSetting; $this->view->rows = $rowset; if ($this->_request->isPost($this->_request->getParam('save'))) { $id = $this->_request->getParam('id'); //$data['settingKey'] = $this->_request->getParam('key'); $data['settingValue'] = $this->_request->getParam('value'); $data['note'] = $this->_request->getParam('note'); $update = $tblPaymentSetting->update($data, 'settingId = ' . $id); $this->_helper->redirector('paymentsetting'); } }
function preDispatch() { $this->view->addHelperPath(KUTU_ROOT_DIR . '/library/Kutu/View/Helper', 'Kutu_View_Helper'); $this->_helper->layout->setLayout('layout-storepayment'); $this->_helper->layout->setLayoutPath(array('layoutPath' => KUTU_ROOT_DIR . '/application/modules/hol-site/views/layouts')); $this->_testMode = true; $this->_defaultCurrency = 'USD'; $tblPaymentSetting = new Kutu_Core_Orm_Table_PaymentSetting(); $usdIdrEx = $tblPaymentSetting->fetchAll($tblPaymentSetting->select()->where(" settingKey= 'USDIDR'")); $this->_currencyValue = $usdIdrEx[0]->settingValue; Zend_Session::start(); $tblPaymentSetting = new Kutu_Core_Orm_Table_PaymentSetting(); $rowSet = $tblPaymentSetting->fetchAll(); for ($iRow = 0; $iRow < count($rowSet); $iRow++) { $key = $rowSet[$iRow]->settingKey; $this->_paymentVars[$key] = $rowSet[$iRow]->settingValue; } $tblSetting = new Kutu_Core_Orm_Table_PaymentSetting(); $this->_holMail = $tblSetting->fetchAll($tblSetting->select()->where("settingKey = 'paypalBusiness'")); }
function preDispatch() { $sReturn = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $sReturn = base64_encode($sReturn); $auth = Zend_Auth::getInstance(); if (!$auth->hasIdentity()) { $registry = Zend_Registry::getInstance(); $config = $registry->get('config'); $loginUrl = $config->identity->config->local->login->url; $this->_redirect(KUTU_ROOT_URL . $loginUrl . '?returnTo=' . $sReturn); } else { $this->_testMode = true; $this->_defaultCurrency = 'USD'; $tblPaymentSetting = new Kutu_Core_Orm_Table_PaymentSetting(); $usdIdrEx = $tblPaymentSetting->fetchAll($tblPaymentSetting->select()->where(" settingKey= 'USDIDR'")); $this->_currencyValue = $usdIdrEx[0]->settingValue; $this->view->addHelperPath(KUTU_ROOT_DIR . '/library/Kutu/View/Helper', 'Kutu_View_Helper'); $this->_helper->layout->setLayout('layout-membership'); $this->_helper->layout->setLayoutPath(array('layoutPath' => KUTU_ROOT_DIR . '/application/modules/membership/views/layouts')); Zend_Session::start(); $this->_user = $auth->getIdentity(); } }
public function confirmAction() { $this->_checkAuth(); $userId = $this->_userInfo->userId; $tblOrder = new Kutu_Core_Orm_Table_Order(); $tblSetting = new Kutu_Core_Orm_Table_PaymentSetting(); $rowset = $tblOrder->getTransactionToConfirm($userId); //,$limit,$offset); $numCount = $tblOrder->getTransactionToConfirmCount($userId); $bankAccount = $tblSetting->fetchAll($tblSetting->select()->where("settingKey = 'bankAccount'")); if ($this->_request->get('sended') == 1) { $this->view->sended = 'Payment Confirmation Sent'; } $this->view->numCount = $numCount; $this->view->rowset = $rowset; $this->view->bankAccount = $bankAccount; /*echo'<pre>'; print_r($this->_userDetailInfo); echo'</pre>';*/ }