Пример #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
 /**
  * Lists all Event models.
  * @return mixed
  */
 public function actionIndex()
 {
     $events = Event::find()->all();
     $tasks = [];
     foreach ($events as $eve) {
         $event = new \yii2fullcalendar\models\Event();
         $event->id = $eve->id;
         $event->title = $eve->title;
         $event->start = $eve->start_date;
         $event->end = $eve->end_date;
         $tasks[] = $event;
     }
     return $this->render('index', ['events' => $tasks]);
 }
Пример #3
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;
 }
Пример #6
0
	public function actionCalendar()
    {
        $events = Event::find()->all();
		
		
		$tasks = [];
		
		foreach ($events as $eve)
		{
		$event = new \yii2fullcalendar\models\Event();
		$event->id = $eve->event_id;
		$event->backgroundColor = 'blue';
		$event->title = $eve->event_title;
		$event->start = $eve->event_date;
		$tasks[] = $event;
		}

        return $this->render('calendar', [
            'events' => $tasks,
        ]);
    }