<?php
	require_once 'admin_options/admin_options_saving_populating.inc.php';

if ( isset( $_GET['add'] ) && ( $_GET['add'] == 'success' ) ) {
	?>
		<div id="message" class="updated">
			<p class="updated"><?php echo rsvp_pro_get_admin_string( 'event_added_message' ); ?></p>
		</div>
	<?php
} elseif ( isset( $_GET['edit'] ) && ( $_GET['edit'] == 'success' ) ) {
	?>
		<div id="message" class="updated">
			<p class="updated"><?php echo rsvp_pro_get_admin_string( 'event_updated_message' ); ?></p>
		</div>
	<?php
}
?>
	<?php if ( isset( $_GET['id'] ) && ( $_GET['id'] > 0 ) ) : ?>
	  <h3><?php echo rsvp_pro_get_event_name( $_GET['id'] ); ?> <?php echo rsvp_pro_get_admin_string( 'settings_label' ); ?></h3>
	<?php endif; ?>
	<form name="rsvpEventForm" id="rsvpEventForm" method="post" action="<?php echo admin_url( 'admin.php?page=rsvp-pro-admin-manage-event&noheader=true' ); ?>">
	<?php if ( $eventID > 0 ) { ?>
	  <input type="hidden" name="eventID" id="eventID" value="<?php echo $eventID; ?>" />
	<?php } ?>
	<div class="wrap" id="rsvp_pro_admin_settings_tabs">
		<ul>
			<li><a href="#general-tab"><?php echo rsvp_pro_get_admin_string( 'settings_general_tab_text' ); ?></a></li>
			<li><a href="#front-end-tab"><?php echo rsvp_pro_get_admin_string( 'settings_frontend_tab_text' ); ?></a></li>
			<li><a href="#front-end-text-tab"><?php echo rsvp_pro_get_admin_string( 'settings_frontend_text_tab_text' ); ?></a></li>
			<?php if ( ! isset( $event ) || ( $event->parentEventID <= 0 ) ) : ?>
				<li><a href="#public-attendee-list-tab"><?php echo rsvp_pro_get_admin_string( 'settings_public_attendee_tab_text' ); ?></a></li>
			<?php endif; ?>
			<li><a href="#email-tab"><?php echo rsvp_pro_get_admin_string( 'settings_notifications_tab_text' ); ?></a></li>
			<li><a href="#payment-tab"><?php echo rsvp_pro_get_admin_string( 'settings_payment_tab_text' ); ?></a></li>
			<li><a href="#admin-settings-tab"><?php echo rsvp_pro_get_admin_string( 'settings_admin_options_tab_text' ); ?></a></li>
		</ul>

		<div id="general-tab">
			<?php require_once 'admin_options/general_options_form.inc.php'; ?>
		</div>
		<div id="front-end-tab">
			<?php require_once 'admin_options/frontend_options_form.inc.php'; ?>
		</div>
		<div id="front-end-text-tab">
			<?php require_once 'admin_options/frontend_text_options_form.inc.php'; ?>
		</div>
		<div id="public-attendee-list-tab" class="subEventHide">
			<?php require_once 'admin_options/public_attendee_list_options_form.inc.php'; ?>
		</div>
		<div id="email-tab">
			<?php require_once 'admin_options/email_form_options.inc.php'; ?>
		</div>
		<div id="payment-tab">
			<?php require_once 'admin_options/payment_options.inc.php'; ?>
		</div>
		<div id="admin-settings-tab">
			<?php require_once 'admin_options/admin_options_form.inc.php'; ?>
		</div>
	</div>
	<p class="submit"><input type="submit" value="<?php echo $buttonText; ?>" class="button-primary" /></p>
	</form>
	<script type="text/javascript">
		handleParentEventChange();
	</script>
