public function actionDosen() { $dosen = AitkRDosen::findOne(['account_id' => Yii::$app->user->id]); /* HAPUS INI UNTUK PENGGUNAAN RBAC */ /* * **** */ if (!isset($dosen)) { throw new \yii\web\HttpException(403, 'You not authorized to enter this', 405); } if (Yii::$app->user->isGuest) { $this->redirect(Yii::$app->homeUrl); } /* * **** */ $matkul = \backend\modules\aitk\models\AitkDosenmatakuliah::findAll(['dosen_id' => $dosen->dosen_id]); $arrMtaId = array(); foreach ($matkul as $mta) { $arrMtaId[] = $mta["matakuliah_id"]; } $allIzin = AitkMatakuliahizin::find()->where(["matakuliah_id" => $arrMtaId])->all(); $searchModel = new AitkRequestSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('dosen', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'dosen' => $dosen, 'allIzin' => $allIzin]); }
/** * @return \yii\db\ActiveQuery */ public function getAitkDosenmatakuliahs() { return $this->hasMany(AitkDosenmatakuliah::className(), ['dosen_id' => 'dosen_id']); }
$iddosenWali = $dosen->dosen_id; ?> <p> <?php echo Html::a('Go to Dosen Wali Section', ['dosenwali'], ['class' => 'btn btn-info']); ?> </p> <?php } ?> <div class="body-content"> <?php $matakuliah = AitkDosenmatakuliah::find()->where(['dosen_id' => $dosen->dosen_id])->all(); $arrMatakuliahId = array(); $arrMatakuliah = array(); $arrTotalJam = array(); $arrayObjMatkul = array(); foreach ($matakuliah as $matkul) { $arrMatakuliahId[] = $matkul['matakuliah_id']; $arrayObjMatkul[] = AitkRMatakuliah::findOne($matkul['matakuliah_id']); } $totalTeori = array(); $totalPrak = array(); $totalLainnya = array(); foreach ($arrayObjMatkul as $ObjMatakuliah) { $arrMatakuliah[] = $ObjMatakuliah['alias']; $arrTotalJam[] = $ObjMatakuliah['jumlah_jam']; $totalTeori[] = (int) AitkMatakuliahizin::find()->where(['matakuliah_id' => $ObjMatakuliah['matakuliah_id'], 'sesi' => 'T'])->count();
});', \yii\web\View::POS_READY); } ?> <div class="jamMatakuliah" style="display: none" > <?php $j = 0; for ($i = 0; $i < $count; $i++) { $dosenMatakuliah = AitkDosenmatakuliah::find()->where(['matakuliah_id' => $matkulId[$i]])->all(); $arrDosenId = array(); foreach ($dosenMatakuliah as $valueDosen => $keyD) { foreach ($keyD as $valD => $isiD) { if ($valD == "dosen_id") { $arrDosenId[] = $keyD[$valD]; } } } $dosenAllMatakuliah = AitkRDosen::findAll($arrDosenId); echo "<div id=\"sesi" . current(explode(' ', $arrMatkul[$i])) . "\" style=\"display:none;\">"; echo kartik\builder\Form::widget(['model' => $model, 'form' => $form, 'columns' => 2, 'attributes' => ['sesiList[' . $i . '][]' => ['label' => 'Sesi ' . $arrMatkul[$i], 'type' => Form::INPUT_CHECKBOX_LIST, 'items' => array('T_' . current(explode(' ', $arrMatkul[$i])) => 'Teori', 'P_' . current(explode(' ', $arrMatkul[$i])) => 'Praktikum'), 'options' => ['inline' => true, 'item' => function ($index, $label, $name, $checked, $value) { return Html::checkbox($name, $checked, ['value' => $value, 'label' => '<label for="' . $label . '">' . $label . '</label>', 'labelOptions' => ['id' => $value . 'SesiRad', 'style' => 'display:block; float:left'], 'id' => "Sesi" . $value, 'class' => 'PilihanSesiList']); }]]]]); echo "<div id=\"matkulT" . current(explode(' ', $arrMatkul[$i])) . "\" style=\"display:none;\">"; echo kartik\builder\Form::widget(['model' => $model, 'form' => $form, 'columns' => 2, 'attributes' => ['waktuKuliah' => ['label' => 'Waktu Sesi Teori ' . $arrMatkul[$i], 'attributes' => ['waktu_mulaiKulList[' . $i . '][]' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\TimePicker', 'options' => ['options' => ['placeholder' => 'Time from...', 'id' => 'timeStartTeori' . current(explode(' ', $arrMatkul[$i])), 'options' => ['required' => true]]]], 'waktu_selesaiKulList[' . $i . '][]' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\TimePicker', 'options' => ['options' => ['placeholder' => 'Time to...', 'class' => 'col-md-9', 'id' => 'timeEndTeori' . current(explode(' ', $arrMatkul[$i])), 'options' => ['required' => true]]]]]], 'dosen_matkulList[' . $i . '][]' => ['label' => 'Dosen ' . $arrMatkul[$i], 'type' => Form::INPUT_DROPDOWN_LIST, 'items' => ArrayHelper::map($dosenAllMatakuliah, 'dosen_id', 'nama_dosen'), 'options' => ['id' => 'dosen_matkul_' . $arrMatkul[$i], 'prompt' => 'Pilih Dosen Matakuliah', 'options' => ['required' => true]]]]]);