/**
  * Lists all Parttimejobs models.
  * @return mixed
  */
 public function actionIndex()
 {
     $username = Yii::$app->user->identity->username;
     $users = User::find()->all();
     $scholars = Scholars::find()->all();
     $model = new Parttimejobs();
     foreach ($users as $user) {
         foreach ($scholars as $scholar) {
             if ($user->username == $username && $user->id == $scholar->scholar_id) {
                 $model->job_scholar_id = $scholar->scholar_id;
                 $searchModel = new ParttimejobsSearch($model);
                 $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
                 return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
             }
         }
     }
 }
Exemple #2
0
    		{
    			return['class'=>'provincial-row'];
    		}
    		else if(strcasecmp($model->scholar_school_area, 'NCR') == 0)
    		{
    			return['class'=>'ncr-row'];
    		}
    	},
        'columns' => [
            [
				'class' => 'kartik\grid\ExpandRowColumn',
				'value' => function($model, $key, $index, $column){
					return GridView::ROW_COLLAPSED;
				},
				'detail' => function ($model, $key, $index, $column){
					$searchModel = new ParttimejobsSearch();
					$searchModel -> job_scholar_id = $model->scholar_id;
					$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
					
					return Yii::$app->controller->renderPartial('_parttimejobs',[
						'searchModel' => $searchModel,
						'dataProvider' => $dataProvider,
					]);
				},
			],

            'scholar_id',
            'scholar_firstName',
            'scholar_lastName',
            'scholar_middleName',
            // 'scholar_gender',