<?php function prepare_compere_limit_dataset($limit,$expire,$bias_seconds=0) { $dataset=array(); $dataset['course_max']=$limit['course.count']; $dataset['coursegroup_max']=$limit['coursegroup.count']; $dataset['place_max']=$limit['place.count']; $dataset['classroom_max']=$limit['classroom.count']; $dataset['classroom_seat_max']=$limit['classroom.seat.count']; $dataset['lecture_max']=$limit['lecture.count']; $dataset['reservation_max']=$limit['reservation.count']; $dataset['seat_max']=$limit['seat.count']; $dataset['team_max']=$limit['team.size']; $dataset['option_max']=$limit['option.count']; $dataset['question_max']=$limit['question.count']; $dataset['questionnaire_max']=$limit['questionnaire.count']; $dataset['timeavail_max']=$limit['timeavail.count']; if ($expire) { $dataset+=array_key_prepend(split_datetime($expire,$bias_seconds),'expire_'); $dataset['EXPIRE']=array(0); } else $dataset['EXPIRE']=array(); return $dataset; } function prepare_compere_info_dataset($dbconn,$mb_id) { global $Config; $dataset=array(); member_refresh_login($dbconn); $reservation_count=db_count_reservations_of_course_owner($dbconn,$mb_id); $dataset['cp_name']=compere_info('cp_name'); $dataset['mb_id']=$mb_id; $dataset+=prepare_timezone_dataset(compere_info('cp_timezone'),get_user_ipdata()); $dataset['course_count']=db_count_course($dbconn,$mb_id); $dataset['coursegroup_count']=db_count_course_group($dbconn,$mb_id); $dataset['place_count']=db_count_place($dbconn,$mb_id); $dataset['classroom_count']=db_count_classroom($dbconn,$mb_id); $dataset['lecture_count']=db_count_lectures_of_compere($dbconn,$mb_id); $dataset['reservation_count']=$reservation_count['count']; $dataset['seat_count']=db_count_seat($dbconn,$mb_id); $dataset['team_size']=db_count_team_member($dbconn,$mb_id); $dataset['option_count']=db_count_compere_option($dbconn,$mb_id); $dataset['question_count']=db_count_compere_question($dbconn,$mb_id); $dataset['questionnaire_count']=db_count_compere_questionnaire($dbconn,$mb_id); $dataset['timeavail_count']=db_count_timeavail($dbconn,$mb_id); $dataset+=prepare_compere_limit_dataset( get_compere_limits($dbconn,$mb_id), get_compere_limit($dbconn,$mb_id,'cl_expire'), get_user_time_zone()*60 ); $compereinfo=db_load_compere_info($dbconn,$mb_id); $compereinfo=rowset2map($compereinfo,'cpi_key','cpi_value'); foreach ($compereinfo as $key=>$value) $dataset['cpi_value_'.$key]=$value; $dataset['RSS-HIDE-TITLE-CHECKED']=$compereinfo['rss_hide_title']?array(0):array(); $dataset['RSS-HIDE-TITLE-UNCHECKED']=$compereinfo['rss_hide_title']?array():array(0); if ($Config->DISTRIBUTION_ID) { $dataset['DISTRIBUTION-ID-AVAIL']=array(0); $dataset['distributionid']=$Config->DISTRIBUTION_ID; } return $dataset; } ?>