private function _addReview()
{
$add = array();
if ($this->validateForm() === TRUE) {
$add['sale_type'] = $this->uri->rsegment(3);
$add['sale_id'] = (int) $this->uri->rsegment(4);
$add['location_id'] = (int) $this->uri->rsegment(5);
$add['customer_id'] = $this->input->post('customer_id');
$add['author'] = $this->customer->getFirstName() . ' ' . $this->customer->getLastName();
$add['rating'] = $this->input->post('rating');
$add['review_text'] = $this->input->post('review_text');
if ($this->Reviews_model->saveReview(NULL, $add)) {
$this->alert->set('success', $this->lang->line('alert_review_success'));
} else {
$this->alert->set('danger', $this->lang->line('alert_review_error'));
}
return TRUE;
} else {
return FALSE;
}
}