public function actionSortNoTreatmentReasons()
{
if (!empty($_POST['order'])) {
foreach ($_POST['order'] as $i => $id) {
if ($drug = models\OphCiExamination_InjectionManagementComplex_NoTreatmentReason::model()->findByPk($id)) {
$drug->display_order = $i + 1;
if (!$drug->save()) {
throw new \Exception('Unable to save drug: ' . print_r($drug->getErrors(), true));
}
}
}
}
}