<?php require_once('includes/requirecompere.inc.php'); $DBConn->connect(true); $mb_id=current_mb_id(); $places=db_load_place_by_owner($DBConn,$mb_id); $plc_ids=array_projection($places,'plc_id'); $seat_counts=rowset2map(db_count_seats_by_place($DBConn,$plc_ids),'plc_id','count'); $dataset['PLACES']=$places; $dataset['NO-PLACE']=$places?array():array(0); foreach ($dataset['PLACES'] as &$p) { $p['seat_count']=0+$seat_counts[$p['plc_id']]; } $dataset['count.addable']=get_compere_limit($DBConn,$mb_id,'place.count')-sizeof($places); $dataset['ADD-PLACE']=$dataset['count.addable']>0?array(0):array(); ?>