<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */


class DataMenuKursHighlightsSlider extends DataMenuKursHighlights
{

    public $highlightedWeighting;
    public $dbworkkurse;

    
    public function __construct($pUrlParameter, $highlightedWeighting)
    {
        parent::__construct($pUrlParameter, $highlightedWeighting);
        $this->highlightedWeighting = $highlightedWeighting;
        $this->dbworkkurse = new DBWorkKurse();
    }


    
    function getsight($pPHP53 = 794)
    {
        $this->sight = SightsAPI::getSight($pPHP53);
    }

    
    public function getKursIDs()
    {
      $masterCourseIdsOfHighlightedCourses = [];

      
      $highlightedCourses = $this->dbwork->getKursHighlights4Date($this->addfdatetime->getDateNow(), $this->settings->highlightAuchAusfall, '', $this->settings->highlightFuerAnmeldungGesperteKurseAusblenden, $this->settings->highlightAussenstellen);

      foreach ($highlightedCourses as $highlightedCourse) {
        
        if ($highlightedCourse->gewichtung == $this->highlightedWeighting) {
          
          $masterCourseId = $this->dbworkkurse->getKursgruppenNr($highlightedCourse->knr);
          if($masterCourseId) {
            
            $masterCourseIdsOfHighlightedCourses[]= $masterCourseId;
          }
        }
      }

      
      if(count($masterCourseIdsOfHighlightedCourses) > 0) {
          return $masterCourseIdsOfHighlightedCourses;
      }

      
      $this->settings->anzahlKurshighlights = 0;
    }
}