private function _saveCoupon()
{
if ($this->validateForm() === TRUE) {
$save_type = !is_numeric($this->input->get('id')) ? $this->lang->line('text_added') : $this->lang->line('text_updated');
if ($coupon_id = $this->Coupons_model->saveCoupon($this->input->get('id'), $this->input->post())) {
log_activity($this->user->getStaffId(), $save_type, 'coupons', get_activity_message('activity_custom', array('{staff}', '{action}', '{context}', '{link}', '{item}'), array($this->user->getStaffName(), $save_type, 'coupon', site_url('coupons/edit?id=' . $coupon_id), $this->input->post('name'))));
$this->alert->set('success', sprintf($this->lang->line('alert_success'), 'Coupon ' . $save_type));
} else {
$this->alert->set('warning', sprintf($this->lang->line('alert_error_nothing'), $save_type));
}
return $coupon_id;
}
}