<?php require_once('includes/requirecompere.inc.php'); $plc_id=0+TGET('plc_id'); $error=TGET('error'); $st_ids=TGET('st_ids'); $mb_id=current_mb_id(); $DBConn->connect(true); $place=db_load_place($DBConn,$plc_id); if ($place['mb_id_owner']!=$mb_id) return; $seats=db_load_seats_at_place($DBConn,$plc_id); $s_count=db_count_seat($DBConn,$mb_id); $countrymap=loadCountryNames(); $dataset+=$place; $dataset['country_name']=$countrymap[$place['plc_country']]; $dataset['SEAT']=$seats; $dataset['NO-SEAT']=$seats?array():array(0); $dataset['HAVE-SEATS']=$seats?array(0):array(); $dataset['ADD-SEAT']=$s_count<get_compere_limit($DBConn,$mb_id,'seat.count')?array(0):array(); $dataset['count.addable']=get_compere_limit($DBConn,$mb_id,'seat.count')-$s_count; if ($error=='deleteinuse') { $seat_summaries=db_count_seats_reservation($DBConn,$st_ids); $dataset['ERROR-DELETE-INUSE']=array(0); $dataset['INUSESEAT']=array(); foreach ($seat_summaries as $summary) { $dtparts=split_datetime($summary['expire'],get_user_time_zone()*60); array_push($dataset['INUSESEAT'], array( 'st_id'=>$summary['st_id'], 'st_no'=>$summary['st_no'], 'count'=>$summary['count'], 'year'=>$dtparts['year'], 'month'=>$dtparts['month'], 'day'=>$dtparts['day'], 'hour'=>$dtparts['hour'], 'minute'=>$dtparts['minute'] ) ); } } ?>