$exp = new ExpertoPreventista(); switch ($oData['behavior']) { case 'load': $oData = $exp->getById($oData['id_preventista']); break; case 'save': if (isset($oData['id_preventista'])) { $exp->save($oData); } break; case 'delete': $flag = false; if (isset($oData['id_preventista'])) { $ids = explode(",", $oData['id_preventista']); foreach ($ids as $id) { if (!$exp->delete($id)) { $flag = true; } } } if ($flag == true) { pushError("Algunos registros no pudieron ser eliminados"); } else { pushInfo("Cambios aplicados exitosamente"); } header("LOCATION: preventistaList.php"); break; } ?> <html>