/* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'Summary'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="aitk-request-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php $dosen = AitkRDosen::find()->where(['account_id' => Yii::$app->user->id])->one(); $kelas = AitkRKelas::findOne(['wali' => $dosen->dosen_id]); if (isset($kelas)) { $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">
public function actionDosenwali() { $dosen = AitkRDosen::findOne(['account_id' => Yii::$app->user->id]); $kelas = AitkRKelas::findOne(['wali' => $dosen->dosen_id]); /* HAPUS INI UNTUK PENGGUNAAN RBAC */ /* * *** */ if (!isset($kelas)) { throw new \yii\web\HttpException(403, 'You not authorized to enter this', 405); } if (Yii::$app->user->isGuest) { $this->redirect(Yii::$app->homeUrl); } /* * *** */ $dataProviderRejected = new ActiveDataProvider(['query' => AitkRequest::find()->where(['status_dosen' => 0, 'dosen_wali' => $dosen->dosen_id]), 'pagination' => ['pageSize' => 3], 'sort' => ['defaultOrder' => ['request_id' => SORT_DESC]]]); $dataProviderPending = new ActiveDataProvider(['query' => AitkRequest::find()->where(['status_dosen' => NULL, 'dosen_wali' => $dosen->dosen_id]), 'pagination' => ['pageSize' => 3], 'sort' => ['defaultOrder' => ['request_id' => SORT_DESC]]]); $dataProviderApproved = new ActiveDataProvider(['query' => AitkRequest::find()->where(['status_dosen' => 1, 'dosen_wali' => $dosen->dosen_id]), 'pagination' => ['pageSize' => 3], 'sort' => ['defaultOrder' => ['request_id' => SORT_DESC]]]); $dosenId = $dosen->nama_dosen; $searchModel = new AitkRequestSearch(); $searchModel->dosen_wali = $dosenId; $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('dosenwali', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'dataProviderRejected' => $dataProviderRejected, 'dataProviderPending' => $dataProviderPending, 'dataProviderApproved' => $dataProviderApproved]); }
?> <div class="wrap"> <?php NavBar::begin(['brandLabel' => 'Aplikasi Izin Tidak Mengikuti Jam Akademik (APTIKAD)', 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]); $menuItems = [['label' => 'Home', 'url' => ['/site/index']]]; if (Yii::$app->user->isGuest) { $menuItems[] = ['label' => 'Login', 'url' => ['/site/login']]; } else { $akun = common\models\AitkRAccount::findOne(Yii::$app->user->id); if ($akun->username == "baakitdel") { $menuItems[] = ['label' => 'View Summary', 'url' => ['/aitk/request/baak']]; } else { $wali = null; $dosen = \backend\modules\aitk\models\AitkRDosen::findOne(['account_id' => Yii::$app->user->identity->id]); if (isset($dosen)) { $wali = \backend\modules\aitk\models\AitkRKelas::findOne(['wali' => $dosen->dosen_id]); } $asrama = \backend\modules\aitk\models\AitkRAsrama::findOne(['account_id' => Yii::$app->user->identity->id]); $mahasiswa = \backend\modules\aitk\models\AitkRMahasiswa::findOne(['account_id' => Yii::$app->user->identity->id]); $url = ""; if (isset($dosen)) { $url = "dosen"; } if (isset($wali)) { $url = "dosenwali"; } if (isset($asrama)) { $url = "asrama"; } if (isset($mahasiswa)) { $url = "index";