public function onClickSaveProfileDet($datForm, $profile_id) { $ess_profiles_detail = new ess_profiles_detail(); $ess_profiles_detail->beginTransaction(); $ess_profiles_detail->delete('profiles_id = ' . $profile_id); $pref = 'chk_'; foreach ($datForm as $id => $chkList) { if (stripos($id, $pref) !== false) { if ($datForm[$id]) { $ess_profiles_detail->menu_id = substr($id, strlen($pref)); $ess_profiles_detail->profiles_id = $profile_id; $ess_profiles_detail->save(); } } } if ($ess_profiles_detail->endTransaction()) { $this->notificationWindow(OPF_myLang::getPhrase('MSG_CAMBIOS_GUARDADOS'), 3, 'ok'); $this->onClickCancel(); } else { $this->messageBox($ess_profiles_detail->getErrorLog(), 'error'); } return $this->response; }