public function actionGetViewData()
 {
     $result = array();
     // комиссии по защите дипломов. показываем только комиссии этого года
     foreach (CActiveRecordProvider::getWithCondition(TABLE_SAB_COMMISSIONS, "year_id=" . CUtils::getCurrentYear()->getId())->getItems() as $ar) {
         $comm = new CSABCommission($ar);
         $value = $comm->title;
         if (!is_null($comm->manager)) {
             $value .= " " . $comm->manager->getName();
         }
         if (!is_null($comm->secretar)) {
             $value .= " (" . $comm->secretar->getName() . ")";
         }
         $diplom = CStaffManager::getDiplom(CRequest::getInt("diplom_id"));
         if (!is_null($diplom)) {
             $cnt = 0;
             foreach ($comm->diploms->getItems() as $d) {
                 if (strtotime($diplom->date_act) == strtotime($d->date_act)) {
                     $cnt++;
                 }
             }
             $value .= " " . $cnt;
         }
         $result[$comm->getId()] = $value;
     }
     return $result;
 }
 public function actionRemoveDiplom()
 {
     $diplom = CStaffManager::getDiplom(CRequest::getInt("diplom_id"));
     if (!is_null($diplom)) {
         $diplom->gak_num = 0;
         $diplom->save();
     }
 }
 public function actionUpdateThemeApprove()
 {
     $diplom = CStaffManager::getDiplom(CRequest::getInt("id"));
     $result = array("title" => "не рассматривали", "color" => "white");
     // меняем на следующий статус утверждения
     $diplom->diplom_confirm += 1;
     if (is_null($diplom->confirmation)) {
         $diplom->diplom_confirm = 0;
     } else {
         $result["title"] = $diplom->confirmation->getValue();
         $result["color"] = $diplom->confirmation->color_mark;
     }
     $diplom->save();
     echo json_encode($result);
 }