<?php require_once('includes/requirecompere.inc.php'); $mb_id=current_mb_id(); $CMD_TMPL_NAME='place.compose'; $dataset['ADDNEW']=array(0); $dataset['ENTERING']=array(0); $countrymap=loadCountryNames(); $countries=array_deassociate($countrymap,'code','name'); array_unshift($countries,array('code'=>'','name'=>'')); $DBConn->connect(true); $mbinfo=db_load_member_info($DBConn,$mb_id); if (TGET('op')=='revise' && $_SESSION['reserv.inputcache.domain']=='place') { $dataset+=$_SESSION['reserv.inputcache.data']; $dataset+=$_SESSION['reserv.inputcache.errorareas']; array_assoc_set_iif( $countries, 'code', $dataset['plc_country'], 'SELECTED', array(0), 'UNSELECTED', array(0) ); $dataset['country_name']=$countrymap[$dataset['plc_country']]; $dataset['NOT-SAVED']=array(0); } else { $dataset['iscreateclassroom']=1; array_assoc_set_iif( $countries, 'code', $mbinfo['mb_country'], 'SELECTED', array(0), 'UNSELECTED', array(0) ); $p_count=db_count_place($DBConn,$mb_id); $dataset['ERROR-COUNT-LIMIT']=$p_count>=get_compere_limit($DBConn,$mb_id,'place.count')?array(0):array(); } $dataset['COUNTRIES']=$countries; if ($dataset['iscreateclassroom']) $dataset['ISCREATEClASSROOM-CHECKED']=array(0); else $dataset['ISCREATEClASSROOM-UNCHECKED']=array(0); $classroom_count=db_count_classroom($DBConn,$mb_id); $dataset['ADDNEW-CLASSROOM']=$classroom_count<get_compere_limit($DBConn,$mb_id,'classroom.count')?array(0):array(); $total_seat_count=db_count_seat($DBConn,$mb_id); $seat_limit=get_compere_limit($DBConn,$mb_id,'seat.count'); $classroom_seat_limit=get_compere_limit($DBConn,$mb_id,'classroom.seat.count'); $dataset['seat_max']=min($seat_limit-$total_seat_count,$classroom_seat_limit); if (!$dataset['seat_count']) $dataset['seat_count']=$dataset['seat_max']; $dataset+=prepare_wizard_dataset(); ?>