<div class="ajax_dialog">

	<?php if (count($info['subscriptions']) > 0): ?>
		<h2>Current Subscriptions</h2>
		You are currently subscribed to receive OSAA Heat Index Notifications for the following <?php echo (count($info['subscriptions']) > 1) ? 'areas' : 'area'; ?>:
		<ul>
			<?php foreach ($info['subscriptions'] as $subscription): ?>
				<li><?php echo $subscription->area->name; ?></li>
			<?php endforeach; ?>
		</ul>		

	<?php endif; ?>


	<?php if ($info['already_subscribed']): ?>
		
		<br />

		You are already subscribed to receive OSAA Heat Index Notifications for the location named "<?php echo $info['area']->name; ?>".

		<br /><br />

		You can manage your subscriptions by clicking the "My Subscriptions" tab after closing this dialog.

		<br /><br />

		<div style="text-align: center;">
			<div class="ok_close_button">OK</div>
		</div>

	<?php else: ?>

		<?php echo Form::open(array('url' => url('/heat-index/subscribe'))); ?>

			<?php echo Form::hidden('user_id', Auth::user()->id); ?>
			<?php echo Form::hidden('found_zmw_link', null); ?>
			<?php echo Form::hidden('found_query', null); ?>

			<h2>Subscribe</h2>

			<b>Area</b>: <span id="subscribe_form_area_name"></span>
			<br />
			<b>User Name</b>: <?php echo Auth::user()->first_name; ?> <?php echo Auth::user()->last_name; ?>
			
			<br /><br />
			
			<?php echo Form::checkbox('is_notify_email',
			                  true,
			                  true,
			                  array('id' => 'is_notify_email',
			                        'style' => 'vertical-align: middle;')); ?>

			<img src="<?php echo asset('/images/icons/email_alert_2_16px.png'); ?>" alt="" title="" style="vertical-align: middle;" />

			<?php echo Form::label('is_notify_email', 'Send E-mail Alerts To:', array('style' => 'width: auto;')); ?>
			<?php echo Auth::user()->email; ?>

			<br /><br />

			<?php echo Form::checkbox('is_notify_sms',
			                  true,
			                  true,
			                  array('id' => 'is_notify_sms',
			                        'style' => 'vertical-align: middle;')); ?>
			
			<img src="<?php echo asset('/images/icons/sms_icon_16px.png'); ?>" alt="" title="" style="vertical-align: middle;" />

			<?php echo Form::label('is_notify_sms', 'Send SMS/TXT Alerts To:', array('style' => 'width: auto;')); ?>

			<?php echo Form::text('mobile',
			              $info['phone_number'],
			              array('id' => 'subscribe_mobile',
			                    'style' => 'width: 120px;')); ?>

            <?php echo Form::select('carrier', $info['carriers'], $info['carrier']); ?>
            <br />
            <div class="small gray note">If you change this number here, we will remember it on your OSAA account.</div>

            <br />

            <div style="text-align: center;">
            	<?php echo Form::submit('Subscribe', array('id' => 'subscribe_submit_button')); ?>
            </div>

		<?php echo Form::close(); ?>

		
	<?php endif; ?>

	<br class="clear" />

</div>