コード例 #1
0
 /**
  * Lists all Allowance models.
  * @return mixed
  */
 public function actionIndex()
 {
     $model = new Allowance();
     $searchModel = new AllowanceSearch($model);
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
コード例 #2
0
    /**
     * Lists all Allowance models.
     * @return mixed
     */
    public function actionIndex()
    {
		
		$username=Yii::$app->user->identity->username;
		$users = User::find()->all();
		$scholars = Scholars::find()->all();
		$deductions = Deductions::find()->all();
		$refunds = Refunds::find()->all();
		$model = new Allowance();
		
		foreach($users as $user){
			foreach($scholars as $scholar){
				foreach($deductions as $deduction){
					foreach($refunds as $refund){
				if($user->username==$username&&$user->id==$scholar->scholar_id){
					$model->allowance_scholar_id=$scholar->scholar_id;
					
					$searchModel = new AllowanceSearch($model);
					$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
					return $this->render('index', [
					'searchModel' => $searchModel,
					'dataProvider' => $dataProvider,
					]);
				}
				}
				}

			}
		}
    }
コード例 #3
0
 /**
  * Lists all Allowance models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new AllowanceSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     if (Yii::$app->request->post('hasEditable')) {
         $allowanceId = Yii::$app->request->post('editableKey');
         $allowance = Allowance::findOne($allowanceId);
         $out = Json::encode(['output' => '', 'message' => '']);
         $post = [];
         $posted = current($_POST['Allowance']);
         $post['Allowance'] = $posted;
         if ($allowance->load($post)) {
             $allowance->save();
         }
         echo $out;
         return;
     }
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
コード例 #4
0
ファイル: index.php プロジェクト: seans888/SMF-Project
    		}
    		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 AllowanceSearch();
					$searchModel -> allowance_scholar_id = $model->scholar_id;
					$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
					
					return Yii::$app->controller->renderPartial('_allowancerecords',[
						'searchModel' => $searchModel,
						'dataProvider' => $dataProvider,
					]);
				},
			],

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