/** * Manages all models. */ public function actionAdmin() { $allt = new TAnggota('search'); $perusahaan = new TPerusahaan(); $model = new TPermintaanPerusahaan('search'); $model->unsetAttributes(); // clear any default values if (TAnggota::isAnggota()) { $allt->username = Yii::app()->user->id; if (isset($_GET['TPermintaanPerusahaan'])) { $model->attributes = $_GET['TPermintaanPerusahaan']; } $this->render('admin', array('model' => $model, 'allt' => $allt)); } elseif (TPerusahaan::isPerusahaan()) { $model->id_perusahaan = $perusahaan->getIdUser(); if (isset($_GET['TPermintaanPerusahaan'])) { $model->attributes = $_GET['TPermintaanPerusahaan']; } $this->render('admin', array('model' => $model)); } }