function execute() { $id = Request::post('id'); $status = Request::post('status'); $model = new connectionFeedbackModel(); $model->setStatus($id, $status, true); }
function execute() { $id = Request::post('id'); $this->frame = false; $model = new connectionFeedbackModel(); $this->smarty->assign('ticket', $model->getTicket($id)); }
function add($answer) { $model = new connectionFeedbackModel(); if (!isset($answer['ticket']) || !isset($answer['message'])) { return false; } if (!$model->getTicket($answer['ticket'])) { return false; } $data = array(); $data['ticket'] = (int) $answer['ticket']; $data['message'] = nl2br(htmlspecialchars($answer['message'])); $data['user'] = (int) $answer['user']; $data['date'] = strtotime('now'); $data['attachment'] = array(); if (!isset($answer['type'])) { $data['type'] = 'message'; } else { $data['type'] = $answer['type']; $data['status'] = $answer['status']; } if (isset($answer['attachment']) && is_array($answer['attachment']) && sizeof($answer['attachment']) > 0) { foreach ($answer['attachment'] as $attachment) { if (is_numeric((int) $attachment) && (int) $attachment > 0) { $data['attachment'][] = (int) $attachment; } } } return $this->insert($data); }
function execute() { $user = ConnectionHelper::userLogin(); $model = new connectionFeedbackModel(); $list = $model->where(array('contact' => (int) $user['id']))->sort('date', -1)->fetchAll(); return array('list' => $list); }
function execute() { $ticketID = (int) Request::get('ticket_id'); $model = new connectionFeedbackModel(); $ticket = $model->getTicket($ticketID); if (!$ticket) { $this->showNotFound(); return; } return array('ticket' => $ticket, 'feedbackModel' => $model); }
function execute() { if (!Request::post('feedback')) { Request::redirect('/'); } $feedback = Request::post('feedback'); $model = new connectionFeedbackModel(); $ticket = $model->add($feedback); if (isset($feedback['ajax'])) { echo json_encode(array('title' => '[`Title feedback success send message`]', 'content' => '[`Title feedback number ticket`]: ' . $ticket . '<br>[`Text feedback success send message`]')); $this->end(); } return array('ticket' => $ticket); }
function execute() { $id = Request::post('id'); connectionFeedbackModel::create()->where(array('id' => (int) $id))->delete(); connectionFeedbackAnswerModel::create()->where(array('ticket' => (int) $id))->delete(); }
function execute() { $model = new connectionFeedbackModel(); $list = $model->getByStatus(Request::get('list')); $this->smarty->assign('tickets', $list); }
function execute() { connectionFeedbackModel::create()->setStatus((int) Request::post('ticket'), Request::post('status'), false); }