<?php require_once('includes/requirecompere.inc.php'); $plc_id=0+TGET('plc_id'); $timezone_bias_seconds=get_user_time_zone()*60; $DBConn->connect(true); $place=db_load_place($DBConn,$plc_id); if ($place['mb_id_owner']!=current_mb_id()) return; $classrooms=db_classroom_at_place($DBConn,$plc_id); $summary=db_count_reservations_at_place($DBConn,$plc_id); $countrymap=loadCountryNames(); $dateparts=split_datetime($summary['expire'],get_user_time_zone()*60); $dataset+=$place; $dataset['country_name']=$countrymap[$place['plc_country']]; $dataset['CLASSROOM']=$classrooms; $lectures=db_load_lectures_of_place($DBConn,$plc_id); $dataset['LECTURE']=$lectures; foreach ($dataset['LECTURE'] as &$lec) { $lec+=array_key_prepend(split_datetime($lec['lctr_since'],$timezone_bias_seconds),'since_'); $lec+=array_key_prepend(split_datetime($lec['lctr_expire'],$timezone_bias_seconds),'expire_'); } $dataset['expire_year']=$dateparts['year']; $dataset['expire_month']=$dateparts['month']; $dataset['expire_date']=$dateparts['day']; $dataset['expire_hour']=$dateparts['hour']; $dataset['expire_minute']=$dateparts['minute']; $dataset['reservation_count']=$summary['count']; $dataset['RESERVED']=empty($summary['count'])?array():array(0); $dataset['NON-DELETABLE']=$classrooms || !empty($summary['count']) || $lectures?array(0):array(); $dataset['DELETABLE']=$dataset['NON-DELETABLE']?array():array(0); ?>