/**
  * Lists all Departmentrole models.
  * @return mixed
  */
 public function actionIndex()
 {
     //        $searchModel = new DepartmentroleSearch();
     //        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $model = \common\models\Departments::find()->all();
     return $this->renderAjax('index', ['model' => $model]);
 }
Exemplo n.º 2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Departments::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(['id' => $this->id, 'company_id' => $this->company_id, 'branch_id' => $this->branch_id, 'created_dt' => $this->created_dt, 'status' => $this->status]);
     $query->andFilterWhere(['like', 'department_name', $this->department_name]);
     return $dataProvider;
 }
Exemplo n.º 3
0
?>

<div class="assignroles-form">

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

    <?php 
$user = new common\models\User();
?>
    <?php 
$dept = new common\models\Departments();
?>
    <?php 
$dept2 = \common\models\Departments::find()->all();
?>
    <?php 
$dept3count = \common\models\Assignroledetail::find()->where(['assignid' => $model->recid])->count();
$dept3 = \common\models\Assignroledetail::find()->where(['assignid' => $model->recid])->all();
?>
    <?php 
$role = new common\models\Roles();
?>
    
    <?php 
echo $form->field($model, 'description')->textarea(['rows' => 6]);
?>

    <?php 
echo $form->field($model, 'userid')->dropDownList(ArrayHelper::map($user->find()->all(), 'id', 'fname'));