Example #1
0
    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Scholars::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('scholarSchool');
		
        $query->andFilterWhere([
            'scholar_id' => $this->scholar_id,
      //      'scholar_school_id' => $this->scholar_school_id,
        ]);

        $query->andFilterWhere(['like', 'scholar_first_name', $this->scholar_first_name])
            ->andFilterWhere(['like', 'scholar_last_name', $this->scholar_last_name])
            ->andFilterWhere(['like', 'scholar_middle_initial', $this->scholar_middle_initial])
            ->andFilterWhere(['like', 'scholar_course', $this->scholar_course])
            ->andFilterWhere(['like', 'scholar_email', $this->scholar_email])
			->andFilterWhere(['like', 'schools.school_name', $this->scholar_school_id]);

        return $dataProvider;
    }
    /**
     * Creates a new Uploadedforms model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {	
		$username=Yii::$app->user->identity->username;
		$users = User::find()->all();
		$scholars = Scholars::find()->all();
		$model = new Uploadedforms();
		foreach($users as $user){
		foreach($scholars as $scholar){
			if($user->username==$username&&$user->id==$scholar->scholar_id){
			$model->uploaded_scholar_id=$scholar->scholar_id;
			if ($model->load(Yii::$app->request->post())) {
			$fileName = $model->fileName.$model->uploaded_scholar_id;
			$model->file = UploadedFile::getInstance($model,'file');
			if($model->file != null)
			{
				$model->file->saveAs('uploads/'.$fileName.'.'.$model->file->extension);	
				$model->uploadedForm = 'uploads/'.$fileName.'.'.$model->file->extension;	
			}			
			$model->save();
            return $this->redirect(['index', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
			}
			
			}
				
		}
			
		
    }
    /**
     * Creates a new Parttimejobs model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
		$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;
	
					if ($model->load(Yii::$app->request->post()) && $model->save()) {
					return $this->redirect(['index', 'id' => $model->id]);
					} else {
					return $this->render('create', [
					'model' => $model,
					]);
					}
				}
			}
		}
      
		
    }
    /**
     * 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,
					]);
				}
				}
				}

			}
		}
    }
Example #5
0
 /**
  * Lists all Grades models.
  * @return mixed
  */
 public function actionIndex()
 {
     $grades = Grades::find()->all();
     $schools = Schools::find()->all();
     $users = User::find()->all();
     $scholars = Scholars::find()->all();
     return $this->render('index', array('users' => $users, 'scholars' => $scholars, 'schools' => $schools, 'grades' => $grades));
 }
 /**
  * Lists all Allowance models.
  * @return mixed
  */
 public function actionIndex()
 {
     $schools = Schools::find()->all();
     $users = User::find()->all();
     $scholars = Scholars::find()->all();
     $allowances = Allowance::find()->all();
     $benefits = Benefit::find()->all();
     return $this->render('index', array('users' => $users, 'scholars' => $scholars, 'schools' => $schools, 'allowances' => $allowances, 'benefits' => $benefits));
 }
Example #7
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Scholars::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('scholarSchool');
     $query->andFilterWhere(['scholar_id' => $this->scholar_id, 'scholar_yearLevel' => $this->scholar_yearLevel, 'scholar_contactNum' => $this->scholar_contactNum, 'scholar_cashCardNum' => $this->scholar_cashCardNum]);
     $query->andFilterWhere(['like', 'scholar_firstName', $this->scholar_firstName])->andFilterWhere(['like', 'scholar_lastName', $this->scholar_lastName])->andFilterWhere(['like', 'scholar_middleName', $this->scholar_middleName])->andFilterWhere(['like', 'scholar_gender', $this->scholar_gender])->andFilterWhere(['like', 'scholar_address', $this->scholar_address])->andFilterWhere(['like', 'scholar_course', $this->scholar_course])->andFilterWhere(['like', 'scholar_email', $this->scholar_email])->andFilterWhere(['like', 'scholar_school_area', $this->scholar_school_area])->andFilterWhere(['like', 'schools.school_name', $this->scholar_school_id]);
     return $dataProvider;
 }
Example #8
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getRefundScholar()
 {
     return $this->hasOne(Scholars::className(), ['scholar_id' => 'refund_scholar_id']);
 }
Example #9
0
use common\models\Scholars;
use common\models\Schools;
use yii\helpers\ArrayHelper;
use kartik\select2\Select2;
/* @var $this yii\web\View */
/* @var $model common\models\Allowance */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="allowance-form">

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

	<?= $form->field($model,'allowance_scholar_id')->widget(Select2::classname(),
		[
			'data'=>ArrayHelper::map(Scholars::find()->all(),'scholar_id','scholar_id','scholar_lastName'),
			'language'=>'en',
			'options'=>['placeholder'=>'Select Scholar ID'],
			'pluginOptions'=>['allowClear'=>true],
		]) ?>
	
    <?= $form->field($model, 'allowance_amount')->textInput() ?>

    <?= $form->field($model, 'allowance_remark')->textInput(['maxlength' => true]) ?>

	<?= $form->field($model,'allowance_school_id')->widget(Select2::classname(),
		[
			'data'=>ArrayHelper::map(Schools::find()->all(), 'School_id','school_name'),
			'language'=>'en',
			'options'=>['placeholder'=>'Select School Name'],
			'pluginOptions'=>['allowClear'=>true],
 /**
  * Finds the Scholars model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Scholars the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Scholars::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #11
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getGradeScholar()
 {
     return $this->hasOne(Scholars::className(), ['scholar_id' => 'grade_scholar_id']);
 }
Example #12
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getFailScholar()
 {
     return $this->hasOne(Scholars::className(), ['scholar_id' => 'fail_scholar_id']);
 }
Example #13
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getScholars()
 {
     return $this->hasMany(Scholars::className(), ['scholar_school_id' => 'school_id']);
 }
Example #14
0
/* @var $this yii\web\View */
/* @var $model common\models\Grades */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="grades-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
$test = ArrayHelper::map(Scholars::findBySql('SELECT * FROM scholars WHERE scholar_id=2')->all(), 'scholar_id', 'scholar_lastName');
$test2 = ArrayHelper::map(Scholars::findBySql('SELECT * FROM scholars WHERE scholar_id=3')->all(), 'scholar_id', 'scholar_lastName');
$test3 = array_values($test2)[0] . ' ' . array_values($test)[0];
?>

	<?php 
echo $form->field($model, 'grade_scholar_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Scholars::find()->all(), 'scholar_id', 'scholar_id', 'scholar_lastName'), 'language' => 'en', 'options' => ['placeholder' => 'Select Scholar ID'], 'pluginOptions' => ['allowClear' => true]]);
?>
	
	<?php 
echo $form->field($model, 'grade_schoolYear')->textInput();
?>

    <?php 
echo $form->field($model, 'grade_Term')->textInput();
?>

	<?php 
echo $form->field($model, 'grade_value')->textInput();
?>

    <div class="form-group">
Example #15
0
		ArrayHelper::map(Scholars::find()->all(),'scholar_id','scholar_id'),
		['prompt'=>'Select Scholar ID']
	) ?>

    <?= $form->field($model, 'compile_scholar_lastName')->dropDownList(
		ArrayHelper::map(Scholars::find()->all(),'scholar_lastName','scholar_lastName'),
		['prompt'=>'Select Scholar Last Name']
	) ?>

    <?= $form->field($model, 'compile_scholar_firstName')->dropDownList(
		ArrayHelper::map(Scholars::find()->all(),'scholar_firstName','scholar_firstName'),
		['prompt'=>'Select Scholar First Name']
	) ?>
	
    <?= $form->field($model, 'compile_scholar_middleName')->dropDownList(
		ArrayHelper::map(Scholars::find()->all(),'scholar_middleName','scholar_middleName'),
		['prompt'=>'Select Scholar Middle Name']
	) ?>

    <?= $form->field($model, 'compile_school_name')->dropDownList(
		ArrayHelper::map(Schools::find()->all(),'school_name','school_name'),
		['prompt'=>'Select School Name']
	) ?>
	
	    <?= $form->field($model, 'compile_school_area')->dropDownList(
		ArrayHelper::map(Schools::find()->all(),'school_area','school_area'),
		['prompt'=>'Select School Area']
	) ?>

    <?= $form->field($model, 'compile_pendingPaymentToSchool')->dropDownList([ 'Yes' => 'Yes', 'No' => 'No', ], ['prompt' => '']) ?>
Example #16
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getBenefitScholar()
 {
     return $this->hasOne(Scholars::className(), ['scholar_id' => 'benefit_scholar_id']);
 }
Example #17
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getJobScholar()
 {
     return $this->hasOne(Scholars::className(), ['scholar_id' => 'job_scholar_id']);
 }
Example #18
0
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use common\models\Scholars;

/* @var $this yii\web\View */
/* @var $model common\models\Grades */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="grades-form">

    <?php $form = ActiveForm::begin(); ?>
	
	<?= $form->field($model, 'grade_scholar_id')->dropDownList(
		ArrayHelper::map(Scholars::find()->all(),'scholar_id','scholar_id'),
		['prompt'=>'Select Scholar']
	) ?>
	
    <?= $form->field($model, 'grade_school_year')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'grade_school_term')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'grade_value')->textInput(['maxlength' => true]) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>
Example #19
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCompileScholar()
 {
     return $this->hasOne(Scholars::className(), ['scholar_id' => 'compile_scholar_id']);
 }
Example #20
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTuitionScholar()
 {
     return $this->hasOne(Scholars::className(), ['scholar_id' => 'tuition_scholar_id']);
 }
Example #21
0
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\GradeSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->params['breadcrumbs'][] = $this->title;
?>


<div class="grades-index">

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
	<?php 
	echo'<table width=100% border=2><tr><td><h3><center>Tuition Fee Amount</center></h3></td><td><h3><center>Term No.</center></h3></td><td><h3><center>Date of Enrollment</center></h3></td><td><h3><center>Date of Payment</center></h3></td><td><h3><center>Status</center></h3></td></tr>';
$users = User::find()->all();
$scholars = Scholars::find()->all();
$tuitions = Tuitionfees::find()->all();
$username=Yii::$app->user->identity->username;

		foreach($users as $ctr){
		if($ctr->username==$username){
		foreach($scholars as $scholarctr){
				foreach($tuitions as $tuition){
				if($scholarctr->scholar_user_id==$ctr->id && $tuition->tuitionfee_scholar_id==$scholarctr->scholar_user_id){
						echo'<tr><td><h4><center>'.$tuition->tuitionfee_amount.'<br></center></h4></td><td><h4><center>'.$tuition->tuitionfees_term.'<br></center></h4></td><td><h4><center>'.$tuition->tuitionfee_dateOfEnrollment.'</center></h4></td><td><h4><center>'.$tuition->tuitionfee_dateOfPayment.'</center></h4></td><td><h4><center>'.$tuition->tuitionfee_paidStatus.'</center></h4></td></tr>';
						
						
					
					
					
				}
Example #22
0
?>

    <?php 
echo $form->field($model, 'compile_scholar_id')->dropDownList(ArrayHelper::map(Scholars::find()->all(), 'scholar_id', 'scholar_id'), ['prompt' => 'Select Scholar ID']);
?>

    <?php 
echo $form->field($model, 'compile_scholar_lastName')->dropDownList(ArrayHelper::map(Scholars::find()->all(), 'scholar_lastName', 'scholar_lastName'), ['prompt' => 'Select Scholar Last Name']);
?>

    <?php 
echo $form->field($model, 'compile_scholar_firstName')->dropDownList(ArrayHelper::map(Scholars::find()->all(), 'scholar_firstName', 'scholar_firstName'), ['prompt' => 'Select Scholar First Name']);
?>
	
    <?php 
echo $form->field($model, 'compile_scholar_middleName')->dropDownList(ArrayHelper::map(Scholars::find()->all(), 'scholar_middleName', 'scholar_middleName'), ['prompt' => 'Select Scholar Middle Name']);
?>

    <?php 
echo $form->field($model, 'compile_school_name')->dropDownList(ArrayHelper::map(Schools::find()->all(), 'school_name', 'school_name'), ['prompt' => 'Select School Name']);
?>
	
	    <?php 
echo $form->field($model, 'compile_school_area')->dropDownList(ArrayHelper::map(Schools::find()->all(), 'school_area', 'school_area'), ['prompt' => 'Select School Area']);
?>

    <?php 
echo $form->field($model, 'compile_pendingPaymentToSchool')->dropDownList(['Yes' => 'Yes', 'No' => 'No'], ['prompt' => '']);
?>

    <?php 
Example #23
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getScholar()
 {
     return $this->hasOne(Scholars::className(), ['scholar_id' => 'uploaded_scholar_id']);
 }
Example #24
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAllowanceScholar()
 {
     return $this->hasOne(Scholars::className(), ['scholar_id' => 'allowance_scholar_id']);
 }