public function markDayAction() { parent::ajaxEnabled(); $date = $this->_getParam('date'); $mode = $this->_getParam('mode'); $modelDailyDetails = new Public_Model_Daily_Details(); $dailyDetails = $modelDailyDetails->fetchOneByDate($date, $this->user); if ($mode == 'off') { $values['value'] = 'LightSlateGray'; } else { $values['value'] = null; } $values['date'] = $date; $values['userId'] = $this->user->getId(); if ($dailyDetails) { $modelDailyDetails->update($values, 'id = ' . $dailyDetails['id']); } else { $modelDailyDetails->insert($values); } echo Zend_Json::encode(array('success' => 1, 'loadThis' => '/calendar/', 'loadOn' => 'content', 'title' => $this->t->_('Success Message'), 'message' => $this->t->_('Day was successfully marked'), 'icon' => 'success')); exit; }