Esempio n. 1
0
 public function actionOtsenochnyjList()
 {
     $request = \Yii::$app->request;
     $type = $request->get('type', '');
     $id = $request->get('id', 0);
     $zid = $request->get('zid', 0);
     $zayavlenie = ZayavlenieNaAttestaciyu::findOne($zid);
     $query = OtsenochnyjListZayavleniya::find()->joinWith('strukturaOtsenochnogoListaZayvaleniyaRel')->joinWith('rabotnikKomissiiFizLicoRel')->orderBy('fiz_lico.familiya, fiz_lico.imya, fiz_lico.otchestvo')->where(['otsenochnyj_list_zayavleniya.zayavlenie_na_attestaciyu' => $zid]);
     $ispytanie = [];
     if ($type == 'postoyannoe') {
         $query = $query->andWhere(['otsenochnyj_list_zayavleniya.postoyannoe_ispytanie' => $id]);
         $ispytanie = PostoyannoeIspytanie::findOne($id);
     } elseif ($type == 'variativnoe') {
         $query = $query->andWhere(['otsenochnyj_list_zayavleniya.var_ispytanie_3' => $id]);
         $ispytanie = AttestacionnoeVariativnoeIspytanie_3::findOne($id);
     }
     $data = $query->all();
     $content = $this->renderPartial('otsenochnyj-list', compact('data', 'zayavlenie', 'ispytanie'));
     $pdf = new Pdf($this->getPdfSeetings($content));
     // return the pdf output as per the destination setting
     return $pdf->render();
 }