fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [11803] bkbooking: hall calendar


From: Kjell Arne Espedal
Subject: [Fmsystem-commits] [11803] bkbooking: hall calendar
Date: Tue, 11 Mar 2014 11:27:07 +0000

Revision: 11803
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11803
Author:   kjell
Date:     2014-03-11 11:27:07 +0000 (Tue, 11 Mar 2014)
Log Message:
-----------
bkbooking: hall calendar

Modified Paths:
--------------
    branches/stavangerkommune/booking/inc/class.bobooking.inc.php
    branches/stavangerkommune/booking/inc/class.sobooking.inc.php
    branches/stavangerkommune/bookingfrontend/inc/class.uibuilding.inc.php

Modified: branches/stavangerkommune/booking/inc/class.bobooking.inc.php
===================================================================
--- branches/stavangerkommune/booking/inc/class.bobooking.inc.php       
2014-03-09 21:38:29 UTC (rev 11802)
+++ branches/stavangerkommune/booking/inc/class.bobooking.inc.php       
2014-03-11 11:27:07 UTC (rev 11803)
@@ -348,6 +348,8 @@
                 unset($event['comments']);
                 unset($event['audience']);
                 unset($event['agegroups']);
+                unset($event['dates']);
+
             }
 
             $bookings = array_merge($allocations, $bookings);
@@ -374,73 +376,220 @@
 
                function building_infoscreen_schedule($building_id, $date)
                {
-
                        $from = clone $date;
                        $from->setTime(0, 0, 0);
                        // Make sure $from is a monday
-//                     if($from->format('w') != 1)
-//                     {
-//                             $from->modify('last monday');
-//                     }
+                       if($from->format('w') != 1)
+                       {
+                               $from->modify('last monday');
+                       }
                        $to = clone $from;
                        $to->modify('+7 days');
-                       $allocation_ids = 
$this->so->allocation_ids_for_building($building_id, $from, $to);
-                       $allocations = 
$this->allocation_so->read(array('filters'=> array('id' => $allocation_ids), 
'sort'=>'from_'));
-                       $allocations = $allocations['results'];
-                       foreach($allocations as &$allocation)
+
+            $allocations = $this->so->get_screen_allocation($building_id, 
$from, $to);
+            $bookings = $this->so->get_screen_booking($building_id, $from, 
$to);
+            $events = $this->so->get_screen_event($building_id, $from, $to);
+
+            $results = array();
+
+            foreach($allocations as &$allocation)
                        {
                                $allocation['name'] = 
$allocation['organization_name'];
                                $allocation['shortname'] = 
$allocation['organization_shortname'];
-                               $allocation['type'] = 'allocation';
+                $allocation['type'] = 'allocation';
+
+                $datef = strtotime($allocation['from_']);
+                $allocation['weekday'] = date('D',$datef);
                        }
-                       $booking_ids = 
$this->so->booking_ids_for_building($building_id, $from, $to);
-                       $bookings = $this->so->read(array('filters'=> 
array('id' => $booking_ids), 'sort'=>'from_'));
-                       $bookings = $bookings['results'];
+
                        foreach($bookings as &$booking)
                        {
                                $booking['name'] = $booking['group_name'];
                                $booking['shortname'] = 
$booking['group_shortname'];
                                $booking['type'] = 'booking';
-                unset($booking['audience']);
-                unset($booking['agegroups']);
 
+                $datef = strtotime($booking['from_']);
+                $booking['weekday'] = date('D',$datef);
             }
-                       $allocations = $this->split_allocations($allocations, 
$bookings);
 
-                       $event_ids = 
$this->so->event_ids_for_building($building_id, $from, $to);
-                       $events = $this->event_so->read(array('filters'=> 
array('id' => $event_ids), 'sort'=>'from_'));
-                       $events = $events['results'];
-                       foreach($events as &$event)
-                       {
+            foreach($events as &$event)
+            {
                 $event['description'] = substr($event['description'], 0, 22);
-                               $event['name'] = substr($event['description'], 
0, 22);
-                               $event['type'] = 'event';
-                unset($event['comments']);
-                unset($event['audience']);
-                unset($event['agegroups']);
-                unset($event['dates']);
-                       }
-                       $bookings = array_merge($allocations, $bookings);
-                       $bookings = $this->_remove_event_conflicts($bookings, 
$events);
-                       $bookings = array_merge($events, $bookings);
+                $event['name'] = substr($event['description'], 0, 22);
+                $event['type'] = 'event';
+                $datef = strtotime($event['from_']);
+                $event['weekday'] = date('D',$datef);
+            }
 
-                       $resource_ids = 
$this->so->resource_ids_for_bookings($booking_ids);
-                       $resource_ids = array_merge($resource_ids, 
$this->so->resource_ids_for_allocations($allocation_ids));
-                       $resource_ids = array_merge($resource_ids, 
$this->so->resource_ids_for_events($event_ids));
-                       $resources = $this->resource_so->read(array('filters' 
=> array('id' => $resource_ids, 'active' => 1)));
-                       $resources = $resources['results'];
-                       foreach ($resources as $key => $row) {
-                       $sort[$key] = $row['sort'];
-                       }
+            $allocations = $this->split_allocations2($allocations, $bookings);
+            $bookings = array_merge($allocations, $bookings);
+            $bookings = $this->_remove_event_conflicts2($bookings, $events);
+            $bookings = array_merge($bookings, $events);
+            $bookings = $this->_split_multi_day_bookings2($bookings, $from, 
$to);
 
-                       // Sort the resources with sortkey ascending
-                       // Add $resources as the last parameter, to sort by the 
common key
-                       array_multisort($sort, SORT_ASC, $resources);
-                       $bookings = $this->_split_multi_day_bookings($bookings, 
$from, $to);
-                       $results = build_schedule_screen_table($bookings, 
$resources);
+            foreach($bookings as &$allocation)
+            {
+                $datef = strtotime($allocation['from_']);
+                $datet = strtotime($allocation['to_']);
+                $timef = date('H:i:s',$datef);
+                $timet = date('H:i:s',$datet);
+                $weekday = $allocation['weekday'];
+                $resname = $allocation['resource_name'];
+                $ft = $timef;
+                $from = explode(':',$timef);
+                $to = explode(':',$timet);
+                $from  = $from[0]*60+$from[1];
+                $to  = $to[0]*60+$to[1];
+                if ($to == 0)
+                    $to = 24*60;
+                $colspan = ($to-$from)/30;
+
+                $allocation['colspan'] = $colspan;
+                $results[$weekday][$resname][$ft] = $allocation;
+            }
+
+            foreach ($results as &$day) {
+                foreach ($day as &$res) {
+                    ksort($res);
+                }
+            }
+
                        return array('total_records'=>count($results), 
'results'=>$results);
                }
 
+        function split_allocations2($allocations, $all_bookings)
+        {
+            function get_from2($a) {return $a['from_'];};
+            function get_to2($a) {return $a['to_'];};
+            $new_allocations = array();
+            foreach($allocations as $allocation)
+            {
+                // $ Find all associated bookings
+                $bookings = array();
+
+                foreach($all_bookings as $b)
+                {
+                    if($b['allocation_id'] == $allocation['id'])
+                        $bookings[] = $b;
+                }
+                $times = array($allocation['from_'], $allocation['to_']);
+
+                $times = array_merge(array_map("get_from2", $bookings), 
$times);
+                $times = array_merge(array_map("get_to2", $bookings), $times);
+                $times = array_unique($times);
+                sort($times);
+                while(count($times) >= 2)
+                {
+                    $from_ = $times[0];
+                    $to_ = $times[1];
+                    $resources = array($allocation['resource_id']);
+                    foreach($all_bookings as $b)
+                    {
+
+                        if(($b['from_'] >= $from_ && $b['from_'] < $to_) || 
($b['to_'] > $from_ && $b['to_'] <= $to_) || ($b['from_'] <= $from_ && 
$b['to_'] >= $to_))
+                            $resources = array_minus($resources, 
array($b['resource_id']));
+                    }
+                    if($resources)
+                    {
+                        $a = $allocation;
+                        $a['from_'] = $times[0];
+                        $a['to_'] = $times[1];
+                        $new_allocations[] = $a;
+                    }
+                    array_shift($times);
+                }
+            }
+            return $new_allocations;
+        }
+
+        function _remove_event_conflicts2($bookings, &$events)
+        {
+            $new_bookings = array();
+            foreach($bookings as $b)
+            {
+                $keep = true;
+                foreach($events as &$e)
+                {
+                    if((($b['from_'] >= $e['from_'] && $b['from_'] < 
$e['to_']) ||
+                            ($b['to_'] > $e['from_'] && $b['to_'] <= 
$e['to_']) ||
+                            ($b['from_'] <= $e['from_'] && $b['to_'] >= 
$e['to_'])) && ( $b['resource_id'] == $e['resource_id']))
+                    {
+                        $keep = false;
+                        break;
+                    }
+                }
+                if($keep)
+                {
+                    $new_bookings[] = $b;
+                }
+            }
+            return $new_bookings;
+        }
+
+        function _split_multi_day_bookings2($bookings, $t0, $t1)
+        {
+            if($t1->format('H:i') == '00:00')
+                $t1->modify('-1 day');
+            $new_bookings = array();
+            foreach($bookings as $booking)
+            {
+                $from = new DateTime($booking['from_']);
+                $to = new DateTime($booking['to_']);
+                // Basic one-day booking
+                if($from->format('Y-m-d') == $to->format('Y-m-d'))
+                {
+                    $booking['date'] = $from->format('Y-m-d');
+                    $booking['weekday']  = 
date_format(date_create($booking['date']), 'D');
+                    $booking['from_'] = $from->format('H:i');
+                    $booking['to_'] = $to->format('H:i');
+                    // We need to use 24:00 instead of 00:00 to sort correctly
+                    $booking['to_'] = $booking['to_'] == '00:00' ? '24:00' : 
$booking['to_'];
+                    $new_bookings[] = $booking;
+                }
+                // Multi-day booking
+                else
+                {
+                    $start = clone max($from, $t0);
+                    $end = clone min($to, $t1);
+                    $date = clone $start;
+                    do
+                    {
+                        $new_booking = $booking;
+                        $new_booking['date'] = $date->format('Y-m-d');
+                        $new_booking['weekday']  = date_format($date, 'D');
+                        $new_booking['from_'] = '00:00';
+                        $new_booking['to_'] = '00:00';
+                        if($new_booking['date'] == $from->format('Y-m-d'))
+                        {
+                            $new_booking['from_'] = $from->format('H:i');
+                        }
+                        else if($new_booking['date'] == $to->format('Y-m-d'))
+                        {
+                            $new_booking['to_'] = $to->format('H:i');
+                        }
+                        // We need to use 24:00 instead of 00:00 to sort 
correctly
+                        $new_booking['to_'] = $new_booking['to_'] == '00:00' ? 
'24:00' : $new_booking['to_'];
+                        $new_bookings[] = $new_booking;
+
+                        if($date->format('Y-m-d') == $end->format('Y-m-d'))
+                        {
+                            break;
+                        }
+
+                        //             if($date->getTimestamp() > 
$end->getTimestamp()) // > php 5.3.0
+                        if($date->format("U") > $end->format("U"))
+                        {
+                            throw new InvalidArgumentException('start time( ' 
. $date->format('Y-m-d') . ' ) later than end time( ' . $end->format('Y-m-d') . 
" ) for {$booking['type']}#{$booking['id']}::{$booking['name']}");
+                        }
+
+                        $date->modify('+1 day');
+                    }
+                    while(true);
+                }
+            }
+            return $new_bookings;
+        }
+
                function building_extraschedule($building_id, $date)
                {
                        $config = CreateObject('phpgwapi.config','booking');

Modified: branches/stavangerkommune/booking/inc/class.sobooking.inc.php
===================================================================
--- branches/stavangerkommune/booking/inc/class.sobooking.inc.php       
2014-03-09 21:38:29 UTC (rev 11802)
+++ branches/stavangerkommune/booking/inc/class.sobooking.inc.php       
2014-03-11 11:27:07 UTC (rev 11803)
@@ -544,4 +544,137 @@
                        $sql = "UPDATE $table_name SET completed = 1 WHERE 
{$table_name}.id IN ($ids);";
                        $db->query($sql, __LINE__, __FILE__);
                }
+
+        function get_screen_allocation($building_id, $start, $end)
+        {
+            $start = $start->format('Y-m-d H:i');
+            $end = $end->format('Y-m-d H:i');
+            $building_id = intval($building_id);
+            $results = array();
+            $sql = "SELECT
+                    bb_allocation.id AS id,
+                    bb_allocation.building_name AS building_name,
+                    bb_allocation.from_ AS from_,
+                    bb_allocation.to_ AS to_,
+                    bb_allocation.organization_id AS organization_id,
+                    bb_resource.id AS resource_id,
+                    bb_resource.name AS resource_name,
+                    bb_resource.sort AS sort,
+                    bb_resource.building_id AS building_id,
+                    bb_organization.name AS organization_name,
+                    bb_organization.shortname AS organization_shortname
+                    FROM bb_allocation
+                    INNER JOIN bb_allocation_resource ON (bb_allocation.id = 
bb_allocation_resource.allocation_id)
+                    INNER JOIN bb_resource ON  
(bb_allocation_resource.resource_id  = bb_resource.id)
+                    INNER JOIN bb_organization ON  (bb_organization.id  = 
bb_allocation.organization_id)
+                    WHERE bb_allocation.from_ > '".$start."' AND 
bb_allocation.to_ < '".$end."'
+                    AND bb_resource.building_id = (".$building_id.")
+                    AND bb_allocation.active = 1
+                    ORDER BY building_name,sort, from_;";
+            $this->db->query($sql, __LINE__, __FILE__);
+            while ($this->db->next_record())
+            {
+                $results[] = array(
+                                    'id' => $this->db->f('id', false),
+                                    'building_id' => 
$this->db->f('building_id', false),
+                                    'resource_id' => 
$this->db->f('resource_id', false),
+                                    'organization_id' => 
$this->db->f('organization_id', false),
+                                    'building_name' => 
$this->db->f('building_name', false),
+                                    'resource_name' => 
$this->db->f('resource_name', false),
+                                    'organization_name' => 
$this->db->f('organization_name', false),
+                                    'organization_shortname' => 
$this->db->f('organization_shortname', false),
+                                    'from_' => $this->db->f('from_', false),
+                                    'to_' => $this->db->f('to_', false),
+                                  );
+            }
+            return $results;
+        }
+        function get_screen_booking($building_id, $start, $end)
+        {
+            $start = $start->format('Y-m-d H:i');
+            $end = $end->format('Y-m-d H:i');
+            $building_id = intval($building_id);
+            $results = array();
+            $sql = "SELECT
+                    bb_booking.id AS id,
+                    bb_booking.allocation_id AS allocation_id,
+                    bb_booking.building_name as buidling_name,
+                    bb_booking.from_ AS from_,
+                    bb_booking.to_ AS to_,
+                    bb_booking.group_id AS group_id,
+                    bb_resource.id AS resource_id,
+                    bb_resource.name AS resource_name,
+                    bb_resource.sort AS sort,
+                    bb_resource.building_id AS building_id,
+                    bb_group.name AS group_name,
+                    bb_group.shortname AS group_shortname
+                    FROM bb_booking
+                    INNER JOIN bb_booking_resource ON 
(bb_booking_resource.booking_id = bb_booking.id)
+                    INNER JOIN bb_resource ON  
(bb_booking_resource.resource_id  = bb_resource.id)
+                    INNER JOIN bb_group ON (bb_group.id = bb_booking.group_id)
+                    WHERE bb_booking.from_ > '".$start."' AND bb_booking.to_ < 
'".$end."'
+                    AND bb_resource.building_id = (".$building_id.")
+                    AND bb_booking.active = 1
+                    ORDER BY building_name,sort, from_;";
+            $this->db->query($sql, __LINE__, __FILE__);
+            while ($this->db->next_record())
+            {
+                $results[] = array(
+                    'id' => $this->db->f('id', false),
+                    'building_id' => $this->db->f('building_id', false),
+                    'resource_id' => $this->db->f('resource_id', false),
+                    'group_id' => $this->db->f('group_id', false),
+                    'allocation_id' => $this->db->f('allocation_id', false),
+                    'building_name' => $this->db->f('building_name', false),
+                    'resource_name' => $this->db->f('resource_name', false),
+                    'group_name' => $this->db->f('group_name', false),
+                    'group_shortname' => $this->db->f('group_shortname', 
false),
+                    'from_' => $this->db->f('from_', false),
+                    'to_' => $this->db->f('to_', false),
+                );
+            }
+            return $results;
+        }
+
+        function get_screen_event($building_id, $start, $end)
+        {
+            $start = $start->format('Y-m-d H:i');
+            $end = $end->format('Y-m-d H:i');
+            $building_id = intval($building_id);
+            $results = array();
+            $sql = "SELECT
+                    bb_event.id AS id,
+                    bb_event.building_name as building_name,
+                    bb_event.description as description,
+                    bb_event.from_ AS from_,
+                    bb_event.to_ AS to_,
+                    bb_resource.sort AS sort,
+                    bb_resource.id AS resource_id,
+                    bb_resource.name AS resource_name,
+                    bb_resource.building_id AS building_id
+                    FROM bb_event
+                    INNER JOIN bb_event_resource ON 
(bb_event_resource.event_id = bb_event.id)
+                    INNER JOIN bb_resource ON (bb_resource.id = 
bb_event_resource.resource_id)
+                    WHERE bb_event.from_ > '".$start."' AND bb_event.to_ < 
'".$end."'
+                    AND bb_resource.building_id = (".$building_id.")
+                    AND bb_event.active = 1
+                    ORDER BY building_name,sort,from_;";
+            $this->db->query($sql, __LINE__, __FILE__);
+            while ($this->db->next_record())
+            {
+                $results[] = array(
+                    'id' => $this->db->f('id', false),
+                    'building_id' => $this->db->f('building_id', false),
+                    'resource_id' => $this->db->f('resource_id', false),
+                    'building_name' => $this->db->f('building_name', false),
+                    'resource_id' => $this->db->f('resource_id', false),
+                    'resource_name' => $this->db->f('resource_name', false),
+                    'description' => $this->db->f('description', false),
+                    'from_' => $this->db->f('from_', false),
+                    'to_' => $this->db->f('to_', false),
+                );
+            }
+            return $results;
+        }
+
        }

Modified: branches/stavangerkommune/bookingfrontend/inc/class.uibuilding.inc.php
===================================================================
--- branches/stavangerkommune/bookingfrontend/inc/class.uibuilding.inc.php      
2014-03-09 21:38:29 UTC (rev 11802)
+++ branches/stavangerkommune/bookingfrontend/inc/class.uibuilding.inc.php      
2014-03-11 11:27:07 UTC (rev 11803)
@@ -6,11 +6,161 @@
                public $public_functions = array(
                         'index'                => true,
                         'schedule'             => true,
+             'information_screen' => true,
                         'extraschedule'                => true,
                         'show'         => true,
                        'find_buildings_used_by' => true,
                );
+        protected $module;
 
+        public function __construct()
+        {
+            parent::__construct();
+            $this->booking_bo = CreateObject('booking.bobooking');
+            $this->resource_bo = CreateObject('booking.boresource');
+        }
+
+               public function information_screen()
+               {
+            $today = new DateTime(phpgw::get_var('date', 'GET'), new 
DateTimeZone('Europe/Oslo'));
+            $date = $today;
+            $from = $date->format('d-m-Y');
+
+            $building = $this->bo->read_single(phpgw::get_var('id', 'GET'));
+            $start = phpgw::get_var('start', 'GET');
+
+            if ($start == 0) {
+                $timestart = 0.0;
+                $timeend = 8.0;
+            } elseif ($start == 1) {
+                $timestart = 8.0;
+                $timeend = 16.0;
+            } elseif ($start == 2) {
+                $timestart = 16.0;
+                $timeend = 24.0;
+            }
+
+            $days = array(
+                "Mon" => "Mandag",
+                "Tue" => "Tirsdag",
+                "Wed" => "Onsdag",
+                "Thu" => "Torsdag",
+                "Fri" => "Fredag",
+                "Sat" => "Lørdag",
+                "Sun" => "Søndag"
+            );
+
+            $bookings = 
$this->booking_bo->building_infoscreen_schedule(phpgw::get_var('id', 
'GET'),$date);
+
+            $time = $timestart;
+            $html = '<html><head><title>Kalender for 
'.$building['name'].'</title>';
+            $html .= '<meta http-equiv="Content-Type" content="text/html; 
charset=utf-8">';
+            $html .= '<meta name="author" content="Stavanger Kommune">';
+            $html .= '<style>body { font-size: 12px; padding: 0px; 
border-spacing: 0px;} table { width: 100%; margin: 0px; font-size: 14px; 
border-collapse: collapse;} tr {  } th { text-align: left; padding: 2px 16px; 
border: 1px solid black;} td { text-align: left; padding: 3px 8px; border: 1px 
solid black;}</style>';
+            $html .= '</head><body style="color: black; margin: 20px; 
background-color: #ffffff;">';
+//            $html .= '<div style="font-size: 30px;">Vi tester 
'.$building['name'].' '.$from.'</div>';
+            $html .= '<pre style="color: black; font-weight: bold;">';
+            $html .= '<table class="calender">';
+            $html .= '<thead>';
+            $html .= '<tr>';
+            $html .= '<th style="text-align: left; width: 10%;">Bane</th>';
+            while ($time < $timeend) {
+                $html .= '<th colspan="2" style="width: 11%; text-align: 
left;">'.str_pad($time,2,'0', STR_PAD_LEFT).':00</th>';
+                $time += 1;
+            }
+            $html .= '</tr>';
+            $html .= '</thead>';
+            $html .= '<tbody>';
+            $first = '';
+            $len =  (($timeend-$timestart)*2)+1;
+            foreach ($bookings['results'] as $day => $resources) {
+                if ($first != $day) {
+                    $first = $day;
+                    $html .= '<tr style="background-color: #999; color: 
white;">';
+                    $html .= '<td colspan="'.$len.'" width="10%">';
+                    $html .= $days[$day];
+                    $html .= '</td>';
+                    $html .= '</tr>';
+                }
+                foreach ($resources as $res => $booking) {
+                    $html .= '<tr>';
+                    $html .= '<td>';
+                    $html .= $res;
+                    $html .= '</td>';
+                    $last = -1;
+                    foreach ($booking as $date =>  $value){
+                        $time2 = $timestart;
+
+                        $bftime = explode(':',substr($value['from_'],-8));
+                        $bttime = explode(':',substr($value['to_'],-8));
+
+                        if($bftime[1] == 30)
+                            $bftime = $bftime[0] + 0.5;
+                        else
+                            $bftime = intval($bftime[0]);
+
+                        if($bttime[1] == 30)
+                            $bttime = $bttime[0] + 0.5;
+                        else
+                            $bttime = intval($bttime[0]);
+
+                        while ($time2 < $timeend) {
+
+                            if( $bftime == $time2 && $time2 < $timeend) {
+                                $last = $bttime;
+                                $colspan = $value['colspan'];
+                                if ($bttime > $timeend) {
+                                    $colspan = $value['colspan'] - ($bttime - 
$timeend);
+                                }
+                                $html .= '<td colspan="'.$colspan.'" 
style="background-color: cyan;">';
+                                $html .= $value['name']." ";
+//                                $html .= substr($value['from_'],-8)." - ";
+//                                $html .= substr($value['to_'],-8);
+                                $html .= '</td>';
+                            } elseif ($last === -1 && $bftime < $timestart && 
$bttime > $timestart) {
+                                $last = $bttime;
+                                $colspan = ($bttime - $timestart)*2;
+                                $html .= '<td colspan="'.$colspan.'" 
style="background-color: cyan;">';
+                                $html .= $value['name']." ";
+//                                $html .= substr($value['from_'],-8)." - ";
+//                                $html .= substr($value['to_'],-8);
+                                $html .= '</td>';
+                            } elseif ($last === -1 && $bftime != $timestart && 
$bftime < $timeend && $bftime > $timestart) {
+                                $colspan = ($bftime - $timestart)*2;
+
+                                $html .= '<td colspan="'.$colspan.'">';
+                                $html .= " ";
+                                $html .= '</td>';
+                                $last = $bttime;
+
+                            } elseif ($last != -1 && $bftime != $last && 
$time2 > $last && $last < $bftime && $bftime < $timeend) {
+                                $colspan = ($bftime - $last)*2;
+                                $html .= '<td colspan="'.$colspan.'">';
+                                $html .= " ";
+                                $html .= '</td>';
+                                $last = $bttime;
+                            }
+
+                            if ($time2 >= $timeend) {
+                                $last = $timestart-1;
+                            }
+                            $time2 += 0.5;
+                        }
+                    }
+                    $html .= '</tr>';
+                }
+
+            }
+            $html .= '</tbody>';
+            $html .= '</table>';
+            $html .= '</pre>';
+            $html .= '</body></html>';
+
+            header('Content-type: text/html');
+            echo $html;
+            exit;
+               }
+
                public function schedule()
                {
                        $backend = phpgw::get_var('backend', 'GET');
@@ -71,7 +221,7 @@
                public function show()
                {
                        $this->check_active('booking.uibuilding.show');
-                       $building                  = 
$this->bo->read_single(phpgw::get_var('id', 'GET'));
+                       $building = $this->bo->read_single(phpgw::get_var('id', 
'GET'));
                        $building['schedule_link'] = 
self::link(array('menuaction' => 'bookingfrontend.uibuilding.schedule', 'id' => 
$building['id']));
                        $building['extra_link'] = self::link(array('menuaction' 
=> 'bookingfrontend.uibuilding.extraschedule', 'id' => $building['id']));
                        $building['message_link']  = 
self::link(array('menuaction' => 'bookingfrontend.uisystem_message.edit', 
'building_id' => $building['id'],'building_name' => $building['name']));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]