Пример #1
0
    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Event::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([
            'event_id' => $this->event_id,
            'event_date' => $this->event_date,
            'employee_employee_id' => $this->employee_employee_id,
        ]);

        $query->andFilterWhere(['like', 'event_title', $this->event_title])
            ->andFilterWhere(['like', 'event_descript', $this->event_descript])
            ->andFilterWhere(['like', 'event_place', $this->event_place]);

        return $dataProvider;
    }
Пример #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Event::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, 'start_date' => $this->start_date, 'end_date' => $this->end_date]);
     $query->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'description', $this->description]);
     return $dataProvider;
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Event::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['event_no' => $this->event_no, 'start_date_time' => $this->start_date_time, 'end_date_time' => $this->end_date_time]);
     $query->andFilterWhere(['like', 'venue', $this->venue])->andFilterWhere(['like', 'type', $this->type]);
     return $dataProvider;
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Event::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'event_name', $this->event_name])->andFilterWhere(['like', 'event_type', $this->event_type])->andFilterWhere(['like', 'date', $this->date])->andFilterWhere(['like', 'event_first_reading', $this->event_first_reading])->andFilterWhere(['like', 'event_first_audio', $this->event_first_audio])->andFilterWhere(['like', 'event_second_reading', $this->event_second_reading])->andFilterWhere(['like', 'event_second_audio', $this->event_second_audio])->andFilterWhere(['like', 'event_alleluia_verse', $this->event_alleluia_verse])->andFilterWhere(['like', 'event_alleluia_audio', $this->event_alleluia_audio])->andFilterWhere(['like', 'event_responsorial_psalm', $this->event_responsorial_psalm])->andFilterWhere(['like', 'event_responsorial_audio', $this->event_responsorial_audio])->andFilterWhere(['like', 'event_gospel', $this->event_gospel])->andFilterWhere(['like', 'event_gospel_audio', $this->event_gospel_audio])->andFilterWhere(['like', 'event_first_optional', $this->event_first_optional])->andFilterWhere(['like', 'event_second_optional', $this->event_second_optional])->andFilterWhere(['like', 'event_responsorial_optional', $this->event_responsorial_optional])->andFilterWhere(['like', 'event_alleluia_optional', $this->event_alleluia_optional])->andFilterWhere(['like', 'event_gospel_optional', $this->event_gospel_optional]);
     return $dataProvider;
 }
 /**
  * Finds the Event model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Event the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Event::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 public function actionApprove($id = NULL)
 {
     $model = User::findOne($id);
     if (isset($model) && !empty($model)) {
         $model->approved = $model->approved == ACTIVE ? INACTIVE : ACTIVE;
         $result = $model->approved == ACTIVE ? 'approved' : 'disapproved';
         $model->scenario = 'approve';
         if ($model->update()) {
             /*                 * * SMS/MAIL EVENTS starts here *** */
             $eventDetail['role'] = ucwords(Helper::findUserRole($model->id));
             $eventDetail['receiver_id'] = $model->id;
             $eventDetail['receiver_email'] = $model->email;
             \frontend\models\Event::addEvent(EVENT_MAIL_TYPE, EVENT_ACCOUNT_APPROVAL, $eventDetail);
             /*                 * * SMS/MAIL EVENTS ends here *** */
             $message = str_replace('%OPERATION%', $result, FLASH_1034);
             Yii::$app->session->setFlash("success", $message, true);
         } else {
             $message = str_replace('%OPERATION%', $result, FLASH_1035);
             Yii::$app->session->setFlash("danger", $message, true);
         }
         return $this->redirect(Url::toRoute(['/usermgmt/user/'], true));
     }
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEvent()
 {
     return $this->hasOne(Event::className(), ['id' => 'event_id']);
 }
Пример #8
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getEvents()
 {
     return $this->hasMany(Event::className(), ['employee_employee_id' => 'employee_id']);
 }