public function actionOptionbahagian()
 {
     $id = Yii::$app->request->post('id');
     $count = Bahagian::find()->where(['id_jabatan' => $id])->count();
     $list = Bahagian::find()->where(['id_jabatan' => $id])->all();
     if ($count > 0) {
         foreach ($list as $list) {
             echo '<option value="' . $list->id_bahagian . '">' . $list->nama_bahagian . '</option>';
         }
     } else {
         echo '<option>Tiada Rekod</option>';
     }
 }
 public function getBahagian()
 {
     return $this->hasOne(Bahagian::className(), ['id_bahagian' => 'id_bahagian']);
 }