Esempio n. 1
0
 /**
  * Finds the Mahasiswa model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Mahasiswa the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Mahasiswa::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Esempio n. 2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Mahasiswa::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['nim' => $this->nim, 'progdi' => $this->progdi, 'status' => $this->status, 'foto' => $this->foto, 'proposal' => $this->proposal, 'kst' => $this->kst, 'transkrip' => $this->transkrip, 'usulan_pembimbing_1' => $this->usulan_pembimbing_1, 'usulan_pembimbing_2' => $this->usulan_pembimbing_2]);
     $query->andFilterWhere(['like', 'nama', $this->nama])->andFilterWhere(['like', 'no_telpon', $this->no_telpon])->andFilterWhere(['like', 'judul', $this->judul])->andFilterWhere(['like', 'deskripsi', $this->deskripsi]);
     return $dataProvider;
 }
Esempio n. 3
0
use yii\helpers\ArrayHelper;
use common\models\Mahasiswa;
use backend\models\Dosen;
/* @var $this yii\web\View */
/* @var $model backend\models\Bimbingan */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="bimbingan-form">

    <?php 
$form = ActiveForm::begin();
?>

     <?php 
echo $form->field($model, 'nim')->dropDownList(ArrayHelper::map(Mahasiswa::find()->all(), 'nim', 'nim'));
?>
     <?php 
echo $form->field($model, 'kd_dosen')->dropDownList(ArrayHelper::map(Dosen::find()->all(), 'kd_dosen', 'nama'));
?>
     <?php 
echo $form->field($model, 'dosen_dua')->dropDownList(ArrayHelper::map(Dosen::find()->all(), 'kd_dosen', 'nama'));
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php