Beispiel #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]);
 }
Beispiel #2
0
 public function actionRpd()
 {
     if (!($id = $_GET['id'])) {
         $id = 2;
     }
     $podrazdel = PodrazdelKursa::find()->where(['id' => $id])->one();
     $kurs_info = RpdGlobals::get_kurs_info_by_podrazdel_id($id);
     $kug = RpdGlobals::get_kug($kurs_info['kurs_id']);
     $max_nedelya = 0;
     $min_nedelya = 0;
     $nedeli = RpdGlobals::get_max_min_weeks($id);
     $min_nedelya = min((int) $podrazdel['nedelya_nachalo'], $nedeli['min']);
     $max_nedelya = max($podrazdel['nedelya_konec'], $nedeli['max']);
     $kug_html = RpdGlobals::get_kug_html($kug, $id, $min_nedelya, $max_nedelya);
     $plan_html = RpdGlobals::get_uchebnii_plan_html($kug, $id);
     $rukovoditel = RpdGlobals::get_rukovoditel_podrazdela($id);
     $rukovoditel_podrazdeleniya = RpdGlobals::get_rukovoditel_podrazdeleniya($id);
     $tip = $kurs_info['kurs_tip'] == 'pp' ? 'профессиональной переподготовки' : 'профессионального обучения';
     $soderzhanie = RpdGlobals::get_rpd_soderzhanie($id);
     $nomer = RpdGlobals::get_nomer_razdela_v_kurse_by_podrazdel($kurs_info['kurs_id'], $id);
     $kims = RpdGlobals::get_rpd_kims($id);
     $lk = $podrazdel['raschitano_chasov_lekcyj'];
     $pr = $podrazdel['raschitano_chasov_praktik'];
     $vsego_chasov = $lk + $pr;
     $pdf = (new Pdf())->api;
     $pdf->title = $podrazdel['nazvanie'];
     $pdf->WriteHTML('<style>
             body {font-family: "Times New Roman", Times, serif;font-size: 10pt;}
             p.myp {text-indent: 2.5em;text-align: justify}
             .indent0 {text-indent: 2.5em;text-align: justify;margin:0}
             .center {text-align:center}
             .tb {border-collapse: collapse}
             .tb td {padding: 5px;border: 1px solid #000}
             .razdel-tr td {font-weight: bold}
             .attestatsiya-tr td {font-weight: bold}
             .bold-tr td {font-weight: bold}
             .bold {font-weight: bold}
             </style>');
     $pdf->WriteHTML('<p style="text-align:center">Министерство образования и науки Республики Бурятия</p>');
     $pdf->WriteHTML('<p style="text-align:center">ГАУ ДПО РБ «Бурятский республиканский институт образовательной политики»</p>');
     $pdf->WriteHTML('<p style="text-align:center">' . ApiGlobals::first_letter_up($kurs_info['podrazdelenie']) . '</p>');
     $pdf->WriteHTML('<div style="text-align:right">УТВЕРЖДАЮ</div>');
     $pdf->WriteHTML('<div style="text-align:right">Проректор по организации</div>');
     $pdf->WriteHTML('<div style="text-align:right">образовательной деятельности</div>');
     $pdf->WriteHTML('<div style="text-align:right">_____________ / ______________</div>');
     $pdf->WriteHTML('<div style="text-align:right">« ____» __________ 20__ г.</div>');
     $pdf->WriteHTML('<div style="position: absolute;top: 40%;left:0;width:100%">
         <p class="center">РАБОЧАЯ ПРОГРАММА</p>
         <p  class="center">учебной дисциплины</p>
         ' . $this->get_empty_row(1) . '
         <p class="center bold">«' . $podrazdel['nazvanie'] . '»</p>
         ' . $this->get_empty_row(1));
     $pdf->WriteHTML('<p style="text-align:center;">' . ($kurs_info['kurs_tip'] == 'po' ? 'основной профессиональной программы' : 'дополнительной профессиональной программы') . '</p>');
     $pdf->WriteHTML('<p class="center">' . $tip . '</p>
         <div style="text-align:center;width: 100%;">
             <p style="width: 60%;margin: 0 auto">«' . mb_strtoupper($kurs_info['kurs_nazvanie'], 'UTF-8') . '»</p>
         </div>
         </div>
     ');
     $pdf->WriteHTML('<htmlpagefooter show-this-page="1" name="first_page_footer">
                      <div style="text-align: center"><p>Улан-Удэ</p><p>' . date('Y') . ' год</p></div>
                     </htmlpagefooter>');
     $pdf->SetHTMLFooterByName('first_page_footer');
     $pdf->AddPage();
     $pdf->WriteHTML('<p>Структурное подразделение: ' . ApiGlobals::first_letter_up($kurs_info['podrazdelenie']) . '</p>');
     $pdf->WriteHTML('<p>Составитель: ' . $rukovoditel['familiya'] . ' ' . ApiGlobals::get_first_letter($rukovoditel['imya']) . '. ' . ApiGlobals::get_first_letter($rukovoditel['otchestvo']) . '., ' . $rukovoditel['dolzhnost'] . '.</p>');
     $pdf->WriteHTML($this->get_empty_row(2));
     $pdf->WriteHTML('<p>Обсуждена на заседании ' . ($kurs_info['podrazdelenie_sokrashennoe_nazvanie'] ? $kurs_info['podrazdelenie_sokrashennoe_nazvanie'] : $kurs_info['podrazdelenie']) . '.</p>');
     $pdf->WriteHTML('<p>Протокол № ___ от «__» _________ 20__ г.</p>');
     $pdf->WriteHTML($this->get_empty_row(2));
     $pdf->WriteHTML('<p>Утверждена на заседании НМС.</p>');
     $pdf->WriteHTML('<p>Протокол № ___ от «__» _________ 20__ г.</p>');
     $pdf->WriteHTML('<htmlpagefooter show-this-page="1" name="numbered_page_footer">
                      <div style="text-align: center">{PAGENO}</div>
                     </htmlpagefooter>');
     $pdf->SetHTMLFooterByName('numbered_page_footer');
     $pdf->AddPage();
     $pdf->WriteHTML('<p style="text-align: center"><b>Пояснительная записка</b></p>');
     $pdf->WriteHTML($this->get_paragraph('<b>Актуальность</b>'));
     $pdf->WriteHTML(ApiGlobals::parse_text($podrazdel['aktualnost']));
     $pdf->WriteHTML($this->get_paragraph('<b>Цель: </b>' . $podrazdel['cel']));
     $pdf->WriteHTML($this->get_paragraph('<b>Задачи:</b>'));
     $pdf->WriteHTML(ApiGlobals::parse_text($podrazdel['zadachi']));
     $pdf->WriteHTML($this->get_paragraph('<b>Планируемые результаты:</b>'));
     $pdf->WriteHTML(ApiGlobals::parse_text($podrazdel['planiruemye_rezultaty']));
     $pdf->WriteHTML($this->get_paragraph('<b>Место дисциплины в структуре программы: </b>' . $podrazdel['mesto_discipliny_v_strukture_programmy']));
     $pdf->WriteHTML($this->get_paragraph('<b>Количество часов: аудиторных ' . $vsego_chasov . ' ч.,</b> из них ' . $lk . ' ч. лекционных, ' . $pr . ' ч. практических.'));
     $pdf->WriteHTML($this->get_paragraph('<b>Организационно-педагогические условия:</b>'));
     $pdf->WriteHTML($this->get_paragraph('<i>Информационные:</i> ' . $podrazdel['informacionnye_usloviya']));
     $pdf->WriteHTML($this->get_paragraph('<i>Учебно-методические:</i> ' . $podrazdel['uchebnometodicheskie_usloviya']));
     $pdf->WriteHTML($this->get_paragraph('<i>Кадровые:</i> ' . $podrazdel['kadrovye_usloviya']));
     $pdf->WriteHTML($this->get_paragraph('<i>Материально-технические:</i> ' . $podrazdel['materialnotehnicheskie_usloviya']));
     $pdf->AddPage();
     $pdf->WriteHTML('<div class="center">Министерство образования и науки Республики Бурятия</div>');
     $pdf->WriteHTML('<div class="center">ГАУ ДПО РБ «Бурятский республиканский институт образовательной политики»</div>');
     $pdf->WriteHTML('<br>');
     $pdf->WriteHTML('<div class="" style="text-align:right">УТВЕРЖДАЮ</div>');
     $pdf->WriteHTML('<div style="text-align:right">Проректор по организации</div>');
     $pdf->WriteHTML('<div style="text-align:right">образовательной деятельности</div>');
     $pdf->WriteHTML('<div style="text-align:right">_____________ / ______________</div>');
     $pdf->WriteHTML('<div class="lh1" style="text-align:right">« ____» __________ 20__ г.</div>');
     $pdf->WriteHTML('<br>');
     $pdf->WriteHTML('<div class="center"><b>УЧЕБНЫЙ ПЛАН</b></div>');
     $pdf->WriteHTML('<div class="center">учебной дисциплины «' . $podrazdel['nazvanie'] . '»</div>');
     if ($kurs_info['kurs_tip'] == 'pp') {
         $pdf->WriteHTML('<div class="center">дополнительной профессиональной программы</div>');
         $pdf->WriteHTML('<div class="center">профессиональной переподготовки</div>');
     }
     if ($kurs_info['kurs_tip'] == 'po') {
         $pdf->WriteHTML('<div class="center">основной профессиональной программы</div>');
         $pdf->WriteHTML('<div class="center">профессионального обучения</div>');
     }
     $pdf->WriteHTML('<div class="center">«' . $kurs_info['kurs_nazvanie'] . '»</div>');
     $pdf->WriteHTML('<br>');
     //if ($kurs_info['kurs_tip'] == 'po') {
     $pdf->WriteHTML('<div class="left">Категория слушателей: ' . $kurs_info['kategorii'] . '</div>');
     $pdf->WriteHTML('<div class="left">Форма обучения: ' . $kurs_info['forma_obucheniya'] . '</div>');
     //}
     $pdf->WriteHTML('<div class="left">Режим занятий: ' . $kurs_info['rezhim_zanyatij'] . '</div>');
     $pdf->WriteHTML('<br>');
     $pdf->WriteHTML($plan_html);
     $pdf->WriteHTML('<p style="text-align:left;">Руководитель курсов: ____________/' . ApiGlobals::get_first_letter($kurs_info['rukovoditel_imya']) . '.' . ApiGlobals::get_first_letter($kurs_info['rukovoditel_otchestvo']) . '. ' . $kurs_info['rukovoditel_familiya'] . '</p>');
     $pdf->WriteHTML('<p style="text-align:left;">Руководитель структурного подразделения: __________/ ' . ApiGlobals::get_first_letter($rukovoditel_podrazdeleniya['imya']) . '.' . ApiGlobals::get_first_letter($rukovoditel_podrazdeleniya['otchestvo']) . '. ' . $rukovoditel_podrazdeleniya['familiya'] . '</p>');
     $pdf->WriteHTML('<p style="text-align:left;">Начальник учебного отдела: ___________/ Л.Е. Халудорова</p>');
     $pdf->AddPage();
     $pdf->WriteHTML('<div class="center">Министерство образования и науки Республики Бурятия</div>');
     $pdf->WriteHTML('<div class="center">ГАУ ДПО РБ «Бурятский республиканский институт образовательной политики»</div>');
     $pdf->WriteHTML('<br>');
     $pdf->WriteHTML('<div class="" style="text-align:right">УТВЕРЖДАЮ</div>');
     $pdf->WriteHTML('<div style="text-align:right">Проректор по организации</div>');
     $pdf->WriteHTML('<div style="text-align:right">образовательной деятельности</div>');
     $pdf->WriteHTML('<div style="text-align:right">_____________ / ______________</div>');
     $pdf->WriteHTML('<div class="lh1" style="text-align:right">« ____» __________ 20__ г.</div>');
     $pdf->WriteHTML('<br>');
     $pdf->WriteHTML('<div class="center"><b>КАЛЕНДАРНЫЙ УЧЕБНЫЙ ГРАФИК</b></div>');
     $pdf->WriteHTML('<div class="center">учебной дисциплины «' . $podrazdel['nazvanie'] . '»</div>');
     if ($kurs_info['kurs_tip'] == 'pp') {
         $pdf->WriteHTML('<div class="center">дополнительной профессиональной программы</div>');
         $pdf->WriteHTML('<div class="center">профессиональной переподготовки</div>');
     }
     if ($kurs_info['kurs_tip'] == 'po') {
         $pdf->WriteHTML('<div class="center">основной профессиональной программы</div>');
         $pdf->WriteHTML('<div class="center">профессионального обучения</div>');
     }
     $pdf->WriteHTML('<div class="center">«' . $kurs_info['kurs_nazvanie'] . '»</div>');
     //        $pdf->WriteHTML('<div class="lh1" style="text-align:center;width: 100%;">
     //                            <p style="font-weight:bold;width: 60%;margin: 0 auto;text-align: center">«'.$kurs['nazvanie'].'»</p>
     //                        </div>');
     $pdf->WriteHTML('<br>');
     $pdf->WriteHTML($kug_html);
     $pdf->WriteHTML('<p style="text-align:left;">Руководитель курсов: ____________/' . ApiGlobals::get_first_letter($kurs_info['rukovoditel_imya']) . '.' . ApiGlobals::get_first_letter($kurs_info['rukovoditel_otchestvo']) . '. ' . $kurs_info['rukovoditel_familiya'] . '</p>');
     $pdf->WriteHTML('<p style="text-align:left;">Руководитель структурного подразделения: __________/ ' . ApiGlobals::get_first_letter($rukovoditel_podrazdeleniya['imya']) . '.' . ApiGlobals::get_first_letter($rukovoditel_podrazdeleniya['otchestvo']) . '. ' . $rukovoditel_podrazdeleniya['familiya'] . '</p>');
     $pdf->WriteHTML('<p style="text-align:left;">Начальник учебного отдела: ___________/ Л.Е. Халудорова</p>');
     $pdf->AddPage();
     $pdf->WriteHTML($this->get_paragraph('Содержание', 'style="font-weight:bold;text-align:center"'));
     $pdf->WriteHTML(RpdGlobals::get_rpd_soderzhanie_html($soderzhanie, $nomer));
     //var_dump($kims);die();
     if ($kims) {
         $pdf->AddPage();
         $pdf->WriteHTML('<div class="center"><b>КОНТРОЛЬНО-ИЗМЕРИТЕЛЬНЫЕ МАТЕРИАЛЫ</b></div>');
         foreach ($kims as $item) {
             if ($item['type'] == 1 or $item['type'] == 3) {
                 $pdf->WriteHTML(RpdGlobals::get_rpd_kim_list_item($item));
             }
         }
     }
     $pdf->AddPage();
     $pdf->WriteHTML($this->get_paragraph('Литература', 'style="font-weight:bold;text-align:center"'));
     $pdf->WriteHTML(ApiGlobals::parse_text($podrazdel['literatura']));
     $pdf->output();
     die;
 }
 public function actionCopyProgram()
 {
     Yii::$app->response->format = Response::FORMAT_JSON;
     $from = Yii::$app->request->post('from');
     $to = Yii::$app->request->post('to');
     $response = new JsResponse();
     $transaction = \Yii::$app->db->beginTransaction();
     try {
         if (Kurs::doesHaveProgram($to)) {
             Kurs::deleteProgram($to);
         }
         /**
          * @var Kurs $from_kurs
          * @var Kurs $to_kurs
          */
         //$from_kurs = Kurs::findOne($from);
         $from_kurs = Kurs::find()->joinWith('kimRel')->joinWith('umkRel')->joinWith('kontroliruyushihKursaRel')->joinWith('temyDiplomnihRabotRel')->joinWith('razdelyKursaRel.podrazdelyKursaRel.temyRel')->joinWith('razdelyKursaRel.podrazdelyKursaRel.kimRel')->joinWith('razdelyKursaRel.podrazdelyKursaRel.umkRel')->joinWith('razdelyKursaRel.podrazdelyKursaRel.kontroliruyushihPodrazdelaKursaRel')->joinWith('razdelyKursaRel.podrazdelyKursaRel.temyRel.kimRel')->joinWith('razdelyKursaRel.podrazdelyKursaRel.temyRel.umkRel')->where(['kurs.id' => $from])->one();
         //kurs
         $to_kurs = Kurs::findOne($to);
         $to_kurs->annotaciya = $from_kurs->annotaciya;
         $to_kurs->aktualnost = $from_kurs->aktualnost;
         $to_kurs->cel = $from_kurs->cel;
         $to_kurs->zadachi = $from_kurs->zadachi;
         $to_kurs->zadachi = $from_kurs->zadachi;
         $to_kurs->planiruemyeRezultaty = $from_kurs->planiruemyeRezultaty;
         $to_kurs->formaItogovojAttestacii = $from_kurs->formaItogovojAttestacii;
         $to_kurs->harakteristikaNovojKvalifikacii = $from_kurs->harakteristikaNovojKvalifikacii;
         $to_kurs->trebovaniya_k_urovnyu_podgotovki = $from_kurs->trebovaniya_k_urovnyu_podgotovki;
         $to_kurs->formaObucheniya = $from_kurs->formaObucheniya;
         $to_kurs->informacionnyeUsloviya = $from_kurs->informacionnyeUsloviya;
         $to_kurs->kadrovyeUsloviya = $from_kurs->kadrovyeUsloviya;
         $to_kurs->uchebnometodicheskieUsloviya = $from_kurs->uchebnometodicheskieUsloviya;
         $to_kurs->tehnicheskieUsloviya = $from_kurs->tehnicheskieUsloviya;
         $to_kurs->itogovayaAttestaciya = $from_kurs->itogovayaAttestaciya;
         $to_kurs->rezhimZanyatij = $from_kurs->rezhimZanyatij;
         $to_kurs->spisokLiteratury = $from_kurs->spisokLiteratury;
         $to_kurs->chasyItogovojAttestacii = $from_kurs->chasyItogovojAttestacii;
         $to_kurs->opisanieItogovojAttestacii = $from_kurs->opisanieItogovojAttestacii;
         $to_kurs->nedelyaItogovojAttestacii = $from_kurs->nedelyaItogovojAttestacii;
         $to_kurs->harakteristikaNovojKvalifikacii = $from_kurs->harakteristikaNovojKvalifikacii;
         $to_kurs->sostaviteli = $from_kurs->sostaviteli;
         $to_kurs->recenzenti = $from_kurs->recenzenti;
         $to_kurs->itogovayaAttestaciyaTekst = $from_kurs->itogovayaAttestaciyaTekst;
         $to_kurs->save();
         //temy_diplomnih_rabot
         foreach ($from_kurs->temyDiplomnihRabotRel as $item) {
             $new_tema_diplomnoj_raboty = new TemaDiplomnojRabotyKursa();
             $new_tema_diplomnoj_raboty->kurs = $to_kurs->id;
             $new_tema_diplomnoj_raboty->nazvanie = $item->nazvanie;
             $new_tema_diplomnoj_raboty->save();
         }
         //kim_kurs
         foreach ($from_kurs->kimRel as $item) {
             $new_kim_kurs = new KimKursa();
             $new_kim_kurs->kim = $item->id;
             $new_kim_kurs->kurs = $to_kurs->id;
             $new_kim_kurs->save();
         }
         //umk_kurs
         foreach ($from_kurs->umkRel as $item) {
             $new_umk_kurs = new UmkKursa();
             $new_umk_kurs->umk = $item->id;
             $new_umk_kurs->kurs = $to_kurs->id;
             $new_umk_kurs->save();
         }
         //kontroliruyushie_kursa
         foreach ($from_kurs->kontroliruyushihKursaRel as $item) {
             $new_kontroliruyshij_kursa = new KontroliruyuschijKursa();
             $new_kontroliruyshij_kursa->kontroliruyuschijFizLico = $item->kontroliruyuschijFizLico;
             $new_kontroliruyshij_kursa->kurs = $to_kurs->id;
             $new_kontroliruyshij_kursa->kontroliruyuschijVakansiya = $item->kontroliruyuschijVakansiya;
             $new_kontroliruyshij_kursa->save();
         }
         //razdels
         foreach ($from_kurs->razdelyKursaRel as $razdel) {
             /**
              * @var RazdelKursa $razdel
              */
             $new_razdel = new RazdelKursa();
             $new_razdel->kurs = $to_kurs->id;
             $new_razdel->nazvanie = $razdel->nazvanie;
             $new_razdel->nomer = $razdel->nomer;
             $new_razdel->tip = $razdel->tip;
             $new_razdel->save();
             //podrazdels
             foreach ($razdel->podrazdelyKursaRel as $podrazdel) {
                 /**
                  * @var PodrazdelKursa $podrazdel
                  */
                 $new_podrazdel = new PodrazdelKursa();
                 $new_podrazdel->razdel = $new_razdel->id;
                 $new_podrazdel->forma_kontrolya = $podrazdel->forma_kontrolya;
                 $new_podrazdel->rukovoditel = $podrazdel->rukovoditel;
                 $new_podrazdel->nomer = $podrazdel->nomer;
                 $new_podrazdel->nazvanie = $podrazdel->nazvanie;
                 $new_podrazdel->raschitano_chasov_lekcyj = $podrazdel->raschitano_chasov_lekcyj;
                 $new_podrazdel->raschitano_chasov_praktik = $podrazdel->raschitano_chasov_praktik;
                 $new_podrazdel->raschitano_chasov_srs = $podrazdel->raschitano_chasov_srs;
                 $new_podrazdel->chasy_kontrolya = $podrazdel->chasy_kontrolya;
                 $new_podrazdel->aktualnost = $podrazdel->aktualnost;
                 $new_podrazdel->cel = $podrazdel->cel;
                 $new_podrazdel->zadachi = $podrazdel->zadachi;
                 $new_podrazdel->planiruemye_rezultaty = $podrazdel->planiruemye_rezultaty;
                 $new_podrazdel->mesto_discipliny_v_strukture_programmy = $podrazdel->mesto_discipliny_v_strukture_programmy;
                 $new_podrazdel->informacionnye_usloviya = $podrazdel->informacionnye_usloviya;
                 $new_podrazdel->uchebnometodicheskie_usloviya = $podrazdel->uchebnometodicheskie_usloviya;
                 $new_podrazdel->kadrovye_usloviya = $podrazdel->kadrovye_usloviya;
                 $new_podrazdel->materialnotehnicheskie_usloviya = $podrazdel->materialnotehnicheskie_usloviya;
                 $new_podrazdel->literatura = $podrazdel->literatura;
                 $new_podrazdel->status = $podrazdel->status;
                 $new_podrazdel->nedelya_nachalo = $podrazdel->nedelya_nachalo;
                 $new_podrazdel->nedelya_konec = $podrazdel->nedelya_konec;
                 $new_podrazdel->rukovoditel_vakansiya = $podrazdel->rukovoditel_vakansiya;
                 $new_podrazdel->save();
                 //podrazdel_kim
                 foreach ($podrazdel->kimRel as $kim) {
                     $new_podrazdel_kim = new KimPodrazdelaKursa();
                     $new_podrazdel_kim->podrazdelKursa = $new_podrazdel->id;
                     $new_podrazdel_kim->kim = $kim->id;
                     $new_podrazdel_kim->save();
                 }
                 //podrazdel_umk
                 foreach ($podrazdel->umkRel as $umk) {
                     $new_podrazdel_umk = new UmkPodrazdelaKursa();
                     $new_podrazdel_umk->podrazdelKursa = $new_podrazdel->id;
                     $new_podrazdel_umk->umk = $umk->id;
                     $new_podrazdel_umk->save();
                 }
                 //kontroliruyushie_podrazdela_kursa
                 foreach ($podrazdel->kontroliruyushihPodrazdelaKursaRel as $item) {
                     $new_kontroliruyshij_podrazdela = new KontroliruyuschijPodrazdelaKursa();
                     $new_kontroliruyshij_podrazdela->kontroliruyuschijFizLico = $item->kontroliruyuschijFizLico;
                     $new_kontroliruyshij_podrazdela->podrazdelKursa = $new_podrazdel->id;
                     $new_kontroliruyshij_podrazdela->kontroliruyuschijVakansiya = $item->kontroliruyuschijVakansiya;
                     $new_kontroliruyshij_podrazdela->save();
                 }
                 //podrazdel_temy
                 foreach ($podrazdel->temyRel as $tema) {
                     /**
                      * @var Tema $tema
                      */
                     $new_tema = new Tema();
                     $new_tema->podrazdel = $new_podrazdel->id;
                     $new_tema->tip_raboty = $tema->tip_raboty;
                     $new_tema->forma_kontrolya = $tema->forma_kontrolya;
                     $new_tema->prepodavatel_fiz_lico = $tema->prepodavatel_fiz_lico;
                     $new_tema->nomer = $tema->nomer;
                     $new_tema->nazvanie = $tema->nazvanie;
                     $new_tema->soderzhanie = $tema->soderzhanie;
                     $new_tema->chasy = $tema->chasy;
                     $new_tema->nedelya = $tema->nedelya;
                     $new_tema->prepodavatel_vakansiya = $tema->prepodavatel_vakansiya;
                     $new_tema->save();
                     //tema_kim
                     foreach ($tema->kimRel as $kim) {
                         $new_tema_kim = new KimTemy();
                         $new_tema_kim->tema = $new_tema->id;
                         $new_tema_kim->kim = $kim->id;
                         $new_tema_kim->save();
                     }
                     //tema_umk
                     foreach ($tema->umkRel as $umk) {
                         $new_tema_umk = new UmkTemy();
                         $new_tema_umk->tema = $new_tema->id;
                         $new_tema_umk->umk = $umk->id;
                         $new_tema_umk->save();
                     }
                 }
             }
         }
         $transaction->commit();
     } catch (Exception $e) {
         $transaction->rollBack();
         $response->type = JsResponse::ERROR;
         $response->msg = $e->getMessage();
     }
     return $response;
 }