function payment($orderID) { $view = $this->getView(); $template = $this->getPath() . DS . 'lib' . DS . 'templates' . DS . 'Form.html'; $order = connectionUserBalanceModel::create()->where(array('id' => $orderID))->fetchOne(); $view->assign('payment', $this); $view->assign('order', $order); $view->assign('orderID', $orderID); return $view->fetch($template); }
function execute() { $user = ConnectionHelper::userLogin(); $mail = Request::post('mail'); if (!$mail || !isset($mail['to']) || !isset($mail['text']) || empty($mail['text'])) { return array('status' => 'error', 'message' => '[`Title error private message send`]'); } $model = new connectionUserMessageModel(); $count = connectionMessageModel::create()->getDialogMessageCount($user['id'], $mail['to']); if ($count > 0) { $result = connectionUserBalanceModel::create()->operation((int) $user['id'], -(double) Settings::getValue('price_message', 'connection'), connectionUserBalanceModel::OPERATION_REASON_PRIVATE_MESSAGE); if (!$result) { return array('status' => 'error', 'message' => '[`Title error private message send balance`]'); } } $message = $model->send($mail['to'], $mail['text'], isset($mail['attachment']) && is_array($mail['attachment']) ? array_unique($mail['attachment']) : array()); if ($count > 0) { connectionUserBalanceModel::create()->where(array('id' => (int) $result))->update(array('param' => array('message' => (int) $message))); } return array('status' => 'success', 'message' => '[`Title success private message send`]'); }
function execute() { $user = Request::get('id'); $history = connectionUserBalanceModel::create()->getHistory((int) $user); $this->smarty->assign('history', $history); }