/** * @author Thuanth6589 <*****@*****.**> * process change status/is_available ss * @param $type * @param $status */ private function _set_is_available($status) { if (Input::method() == 'POST') { $ss_id = Input::post('ss_id', null); $result = 'error'; $message = \Constants::$message_create_error; if (!\Model_Mss::find_by_pk($ss_id)) { $message = 'SSは存在しません'; } else { $ss = new \Model_Mss(); if ($ss->set_is_available($ss_id, $status)) { $result = 'success'; $message = $status == 1 ? '公開しました' : '非公開しました'; } } Session::set_flash($result, $message); } $url = Session::get('sslist_url') ? Session::get('sslist_url') : Uri::base() . 'master/sslist'; return Response::redirect($url); }