Esempio n. 1
0
    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Allowance::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->joinWith('allowanceScholar');
        
        $query->andFilterWhere([
            'allowance_id' => $this->allowance_id,
            'allowance_amount' => $this->allowance_amount,
            'allowance_scholar_id' => $this->allowance_scholar_id,
            'allowance_school_id' => $this->allowance_school_id,
            'benefit_allowance_id' => $this->benefit_allowance_id,
            'allowance_paidDate' => $this->allowance_paidDate,
        ]);

        $query->andFilterWhere(['like', 'allowance_remark', $this->allowance_remark])
            ->andFilterWhere(['like', 'allowance_payStatus', $this->allowance_payStatus])
            ->andFilterWhere(['like', 'scholars.scholar_lastName', $this->allowance_scholar_lastName])
            ->andFilterWhere(['like', 'scholars.scholar_firstName', $this->allowance_scholar_firstName])
            ->andFilterWhere(['like', 'scholars.scholar_middleName', $this->allowance_scholar_middleName]);

        return $dataProvider;
    }
Esempio n. 2
0
 /**
  * Lists all Compile models.
  * @return mixed
  */
 public function actionIndex()
 {
     $schools = School::find()->all();
     $users = User::find()->all();
     $scholars = Scholar::find()->all();
     $allowances = Allowance::find()->all();
     $grades = Grade::find()->all();
     return $this->render('index', array('users' => $users, 'scholars' => $scholars, 'schools' => $schools, 'allowances' => $allowances, 'grades' => $grades));
 }
Esempio n. 3
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Allowance::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(['allowance_amount' => $this->allowance_amount]);
     $query->andFilterWhere(['like', 'allowance_area', $this->allowance_area]);
     return $dataProvider;
 }
Esempio n. 4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAllowances()
 {
     return $this->hasMany(Allowance::className(), ['allowance_scholar_id' => 'scholar_id']);
 }
Esempio n. 5
0
use common\models\Scholar;
use common\models\User;
/* @var $this yii\web\View */
/* @var $searchModel common\models\DeductionsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Deductions';
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="deductions-index">
	
	<?php 
$username = Yii::$app->user->identity->username;
$users = User::find()->all();
$scholars = Scholar::find()->all();
$allowances = Allowance::find()->all();
foreach ($users as $user) {
    foreach ($scholars as $scholar) {
        foreach ($allowances as $allowance) {
            if ($user->username == $username && $user->id == $scholar->scholar_user_id && $allowance->allowance_area == $scholar->allowance_allowance_area) {
                echo '<strong><h3 style="margin-top:150px">Current Allowance Received:  Php <strong>' . $allowance->allowance_amount . '</h3><strong><h3>Current School Location: <strong>' . $allowance->allowance_area . '</h3><br><br></strong>';
            }
        }
    }
}
?>
	
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>
	<?php 
 /**
  * Finds the Allowance model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Allowance the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Allowance::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Esempio n. 7
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAllowances()
 {
     return $this->hasMany(Allowance::className(), ['benefit_allowance_id' => 'benefit_id']);
 }
Esempio n. 8
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAllowanceAllowanceArea()
 {
     return $this->hasOne(Allowance::className(), ['allowance_area' => 'allowance_allowance_area']);
 }