public function editListPost($request, $response) { if ('' === $request->hospitalId) { exit('请选择医院'); } $vars = $request->vars; if ('' === $request->vars) { exit('不能把科室清空'); } $addList = array(); $deleteList = array(); $oldFacutlyIds = array(); $hospital = DAL::get()->find('hospital', $request->hospitalId); $oldFacutlyIds = array_keys(HospitalFacultyClient::getInstance()->getOrderListByHospital($hospital->id)); $addList = array_unique(array_diff($vars, $oldFacutlyIds)); $deleteList = array_unique(array_diff($oldFacutlyIds, $vars)); HospitalFacultyClient::getInstance()->editHospitalFacultyList($hospital->id, $addList, $deleteList); HospitalController::clearCache($hospital); $hfList = DAL::get()->find('HospitalFaculty', array_merge($addList, $deleteList)); if ($hfList) { foreach ($hfList as $hf) { self::clearCache($hf); } } $response->setRedirect("/hospitalfaculty/editlist?msg=更新成功&hospitalId=" . $request->hospitalId); }
</td> <td> </td> </tr> <tr> <td> المشافي الحالية </td> </tr> <tr> <td height="150" valign="top" align="center"> <?php $AllHospitals = new HospitalController(); $AllHospitals->invoke(""); ?> </td> </tr> </table> </td> <td style="width:25%;" valign="top"> <?php $loginCtrl->LoggedOrNot(); ?> </td> </tr> </table> </td>
</tr> <tr> <td> <form method="post" action="../View/Doctors/SearchDoctors.php"> <input type="text" name="value" /> <input type="submit" name="search" value="بحث"/> </td> </tr> <tr> <td height="150" valign="top"> <?php $AllHospitals = new HospitalController(); if (isset($_POST['value']) && !$_POST['value'] == "") { $AllHospitals->invoke($_POST['value']); } ?> </td> </tr> </table> </td> <td style="width:25%;" valign="top"> <?php $loginCtrl->LoggedOrNot(); ?> </td> </tr>