/**
  *
  */
 public function actionIndex()
 {
     $this->top_menu = "termine";
     $this->load_calendar = true;
     $tage_zukunft = 30;
     $tage_vergangenheit = 30;
     $termine_zukunft = Termin::model()->termine_stadtrat_zeitraum(null, date("Y-m-d 00:00:00", time()), date("Y-m-d 00:00:00", time() + $tage_zukunft * 24 * 3600), true)->findAll();
     $termine_vergangenheit = Termin::model()->termine_stadtrat_zeitraum(null, date("Y-m-d 00:00:00", time() - $tage_vergangenheit * 24 * 3600), date("Y-m-d 00:00:00", time()), false)->findAll();
     $termin_dokumente = Termin::model()->neueste_str_protokolle(0, date("Y-m-d 00:00:00", time() - 60 * 24 * 3600), date("Y-m-d 00:00:00", time()), false)->findAll();
     /** @var Termin[] $termine_zukunft */
     /** @var Termin[] $termine_vergangenheit */
     /** @var Termin[] $termin_dokumente */
     $gruppiert_zukunft = Termin::groupAppointments($termine_zukunft);
     $gruppiert_vergangenheit = Termin::groupAppointments($termine_vergangenheit);
     $fullcalendar_struct = $this->getFullCalendarStructByMonth(date("Y"), date("m"));
     $this->render("index", ["termine_zukunft" => $gruppiert_zukunft, "termine_vergangenheit" => $gruppiert_vergangenheit, "termin_dokumente" => $termin_dokumente, "fullcalendar_struct" => $fullcalendar_struct, "tage_vergangenheit" => $tage_vergangenheit, "tage_zukunft" => $tage_zukunft]);
 }
 /**
  * @param int $ba_nr
  * @param string $datum_max
  */
 public function actionBa($ba_nr, $datum_max = "")
 {
     $this->top_menu = "ba";
     $this->load_leaflet_css = true;
     $this->load_leaflet_draw_css = true;
     $tage_zukunft = 60;
     $tage_vergangenheit = 60;
     $antraege_data = $this->ba_dokumente_nach_datum($ba_nr, $datum_max);
     $termine = Termin::model()->termine_stadtrat_zeitraum($ba_nr, date("Y-m-d 00:00:00", time() - $tage_vergangenheit * 24 * 3600), date("Y-m-d 00:00:00", time() + $tage_zukunft * 24 * 3600), true)->findAll(['order' => 'termin DESC']);
     $termin_dokumente = Termin::model()->neueste_ba_dokumente($ba_nr, date("Y-m-d 00:00:00", time() - $tage_vergangenheit * 24 * 3600), date("Y-m-d H:i:s", time()), false)->findAll();
     $termine = Termin::groupAppointments($termine);
     /** @var Termin[] $bvs */
     $bvs = Termin::model()->findAllByAttributes(["ba_nr" => $ba_nr, "typ" => Termin::$TYP_BUERGERVERSAMMLUNG], ["order" => "termin DESC"]);
     $bvs_arr = [];
     foreach ($bvs as $bv) {
         $bvs_arr[] = $bv->toArr();
     }
     /** @var Bezirksausschuss $ba */
     $ba = Bezirksausschuss::model()->findByPk($ba_nr);
     $gremien = $ba->gremien;
     $this->render("ba_startseite", array_merge(["ba" => $ba, "gremien" => $gremien, "termine" => $termine, "termin_dokumente" => $termin_dokumente, "bvs" => $bvs_arr, "tage_vergangenheit" => $tage_vergangenheit, "tage_zukunft" => $tage_zukunft, "tage_vergangenheit_dokumente" => static::$BA_DOKUMENTE_TAGE_PRO_SEITE, "fraktionen" => StadtraetIn::getGroupedByFraktion(date("Y-m-d"), $ba_nr), "explizites_datum" => $datum_max != ""], $antraege_data));
 }