Esempio n. 1
0
 public function actionRpd()
 {
     $rpd_id = $_GET['id'];
     $podrazdel = PodrazdelKursa::find()->where(['id' => $rpd_id])->one();
     if (!$podrazdel) {
         $podrazdel = new PodrazdelKursa();
     }
     if ($podrazdel->load(Yii::$app->request->post()) && $podrazdel->validate()) {
         $podrazdel->save();
         $podrazdel = PodrazdelKursa::find()->where(['id' => $rpd_id])->one();
     }
     $soderzhanie = RpdGlobals::get_podrazdel_and_themes($podrazdel['id']);
     $weeks = [];
     for ($i = $podrazdel->nedelya_nachalo; $i <= $podrazdel->nedelya_konec; $i++) {
         $weeks[$i] = $i;
     }
     $vidy_rabot = KursGlobals::get_vidy_rabot();
     $sotrudniki = KursGlobals::get_sotrudniki();
     $sotrudniki[-1] = 'Вакансия';
     $kf_temi = KursGlobals::get_kontrolnie_formi_temi();
     $kf_temi[-1] = 'без формы контроля';
     $kurs_info = RpdGlobals::get_kurs_info_by_podrazdel_id($rpd_id);
     $nomer = RpdGlobals::get_nomer_razdela_v_kurse_by_podrazdel($kurs_info['kurs_id'], $rpd_id);
     return $this->render('redaktor-rpd', ['podrazdel' => $podrazdel, 'soderzhanie' => $soderzhanie, 'weeks' => $weeks, 'vidy_rabot' => $vidy_rabot, 'sotrudniki' => $sotrudniki, 'kf_temi' => $kf_temi, 'nomer' => $nomer, 'kurs_info' => $kurs_info]);
 }