Ejemplo n.º 1
0
 function getFirstDate($seminar_id)
 {
     $termine = array();
     $presence_types = getPresenceTypes();
     if (count($presence_types) > 0) {
         $query = "SELECT termin_id, date, end_time\n                      FROM termine\n                      WHERE range_id = ? AND date_typ IN (?)\n                      ORDER BY date";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($seminar_id, $presence_types));
         $start = 0;
         $end = 0;
         while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
             if ($start == 0 && $end == 0 || $start == $row['date'] && $end == $row['end_time']) {
                 $termine[] = $row['termin_id'];
                 $start = $row['date'];
                 $end = $row['end_time'];
             }
         }
     }
     return $termine ?: false;
 }
Ejemplo n.º 2
0
                $cycle_output .= ', <i>' . htmlReady($cycle['desc']) . '</i>';

            if ($show_room) :
                $cycle_output .= $this->render_partial('dates/_seminar_rooms', array('assigned' => $cycle['assigned_rooms'],
                    'freetext' => $cycle['freetext_rooms'],
                    'link' => $link
                ));
            endif;

            $output[] = $cycle_output;
        endforeach;

    echo implode('<br>', $output);
    echo sizeof($output) ? '<br>' : '';

    $presence_types = getPresenceTypes();
    $freetext_rooms = array();

    if (is_array($dates['irregular'])):
        foreach ($dates['irregular'] as $date) :
            if (in_array($date['typ'], $presence_types) !== false) :
                $irregular[] = $date;
                $irregular_strings[] = $date['tostring'];
                if ($date['resource_id']) :
                    $irregular_rooms[$date['resource_id']]++;
                elseif ($date['raum']) :
                    $freetext_rooms['(' . htmlReady($date['raum']) . ')']++;
                endif;
            endif;
        endforeach;
        unset($irregular_rooms['']);
Ejemplo n.º 3
0
/**
* this functions extracts all the dates, which are corresponding to a metadate
*
* @param        string  seminar_id
* @return       array   ["metadate_numer"]["termin_id"]
*               "metadate_number" the numerber of the corresponding metadate. first metadate (in chronological order) is always 0
*               "termin_id" the termin_id that are corresponding to the given metdat_number
*
*/
function getMetadateCorrespondingDates($sem_id, $presence_dates_only)
{
    $sem = Seminar::GetInstance($sem_id);
    $types = getPresenceTypes();
    foreach ($sem->getMetaDates() as $key => $val) {
        $termine = $sem->getSingleDatesForCycle($key);
        foreach ($termine as $val) {
            if ($presence_dates_only) {
                foreach ($types as $tp) {
                    if ($val->getDateType() == $tp) {
                        $zw[$val->getSingleDateID()] = TRUE;
                        break;
                    }
                }
            } else {
                $zw[$val->getSingleDateID()] = TRUE;
            }
        }
        $result[] = $zw;
        $zw = '';
    }
    return $result;
}