<?php
if (isset($tpl['status']))
{
	$status = __('status', true);
	switch ($tpl['status'])
	{
		case 2:
			pjUtil::printNotice(NULL, $status[2]);
			break;
	}
} else {
	if (isset($_GET['err']))
	{
		$titles = __('error_titles', true);
		$bodies = __('error_bodies', true);
		pjUtil::printNotice(@$titles[$_GET['err']], @$bodies[$_GET['err']]);
	}
	include_once PJ_VIEWS_PATH . 'pjLayouts/elements/optmenu.php';
	?>
	<form id="frmEmailNotify" action="<?php echo PJ_INSTALL_URL; ?>index.php?controller=pjAdminOptions&amp;action=pjActionUpdate" method="post" class="pj-form form">
		<input type="hidden" name="options_update" value="1" />
		<input type="hidden" name="next_action" value="pjActionNotifications" />
		
		<div id="tabs">
			<ul>
				<li><a href="#tabs-1"><?php __('tabEmails'); ?></a></li>
				<li><a href="#tabs-2"><?php __('tabSms'); ?></a></li>
			</ul>
			
			<div id="tabs-1">
				<?php pjUtil::printNotice(__('infoNotificationsEmailTitle', true), __('infoNotificationsEmailBody', true)); ?>
				<?php
				$notify_arr = array(
					'new_user'=>__('opt_o_email_new_user', true),
					'new_property'=>__('opt_o_email_new_property', true),
					'new_reservation'=>__('opt_o_email_new_reservation', true),
					'reservation_cancelled'=>__('opt_o_email_reservation_cancelled', true),
					'password_reminder'=>__('opt_o_email_password_reminder', true),
					'welcome_msg'=>__('opt_o_email_welcome_msg', true)
				); 
				?>
				<p>
					<label class="title"><?php __('lblNotifyEmail'); ?></label>
					<span class="inline_block">
						<select name="email_types" class="pj-form-field w300">
							<?php
							foreach($notify_arr as $k => $v)
							{
								?><option value="<?php echo $k;?>"><?php echo $v;?></option><?php
							} 
							?>
						</select>
					</span>
				</p>
				<div class="emailBox_new_user" style="display: none;">
					<p>
						<label class="title"><?php __('opt_subject'); ?></label>
						<input type="text" name="value-string-o_email_new_user_subject" class="pj-form-field w500" value="<?php echo htmlspecialchars(stripslashes($tpl['o_arr']['o_email_new_user_subject'])); ?>" />
					</p>
					<p>
						<label class="title"><?php __('opt_body_new_user'); ?></label>
						<textarea name="value-text-o_email_new_user" class="pj-form-field w500 h150"><?php echo stripslashes($tpl['o_arr']['o_email_new_user']); ?></textarea>
					</p>
					<p>
						<label class="title">&nbsp;</label>
						<input type="submit" value="<?php __('btnSave'); ?>" class="pj-button" />
					</p>
				</div>
				
				<div class="emailBox_new_property" style="display: none;">
					<p>
						<label class="title"><?php __('opt_subject'); ?></label>
						<input type="text" name="value-string-o_email_new_property_subject" class="pj-form-field w500" value="<?php echo htmlspecialchars(stripslashes($tpl['o_arr']['o_email_new_property_subject'])); ?>" />
					</p>
					<p>
						<label class="title"><?php __('opt_body_new_property'); ?></label>
						<textarea name="value-text-o_email_new_property" class="pj-form-field w500 h150"><?php echo stripslashes($tpl['o_arr']['o_email_new_property']); ?></textarea>
					</p>
					<p>
						<label class="title">&nbsp;</label>
						<input type="submit" value="<?php __('btnSave'); ?>" class="pj-button" />
					</p>
				</div>
				
				<div class="emailBox_new_reservation" style="display: none;">
					<p>
						<label class="title"><?php __('opt_subject'); ?></label>
						<input type="text" name="value-string-o_email_new_reservation_subject" class="pj-form-field w500" value="<?php echo htmlspecialchars(stripslashes($tpl['o_arr']['o_email_new_reservation_subject'])); ?>" />
					</p>
					<p>
						<label class="title"><?php __('lblListingConfirmTokens'); ?></label>
						<textarea name="value-text-o_email_new_reservation" class="pj-form-field w500 h400"><?php echo stripslashes($tpl['o_arr']['o_email_new_reservation']); ?></textarea>
					</p>
					<p>
						<label class="title">&nbsp;</label>
						<input type="submit" value="<?php __('btnSave'); ?>" class="pj-button" />
					</p>
				</div>
				
				<div class="emailBox_reservation_cancelled" style="display: none;">
					<p>
						<label class="title"><?php __('opt_subject'); ?></label>
						<input type="text" name="value-string-o_email_reservation_cancelled_subject" class="pj-form-field w500" value="<?php echo htmlspecialchars(stripslashes($tpl['o_arr']['o_email_reservation_cancelled_subject'])); ?>" />
					</p>
					<p>
						<label class="title"><?php __('opt_body_new_reservation'); ?></label>
						<textarea name="value-text-o_email_reservation_cancelled" class="pj-form-field w500 h150"><?php echo stripslashes($tpl['o_arr']['o_email_reservation_cancelled']); ?></textarea>
					</p>
					<p>
						<label class="title">&nbsp;</label>
						<input type="submit" value="<?php __('btnSave'); ?>" class="pj-button" />
					</p>
				</div>
				
				<div class="emailBox_password_reminder" style="display: none;">
					<p>
						<label class="title"><?php __('opt_subject'); ?></label>
						<input type="text" name="value-string-o_email_password_reminder_subject" class="pj-form-field w500" value="<?php echo htmlspecialchars(stripslashes($tpl['o_arr']['o_email_password_reminder_subject'])); ?>" />
					</p>
					<p>
						<label class="title"><?php __('opt_body_forgot_password'); ?></label>
						<textarea name="value-text-o_email_password_reminder" class="pj-form-field w500 h150"><?php echo stripslashes($tpl['o_arr']['o_email_password_reminder']); ?></textarea>
					</p>
					<p>
						<label class="title">&nbsp;</label>
						<input type="submit" value="<?php __('btnSave'); ?>" class="pj-button" />
					</p>
				</div>
				
				<div class="emailBox_welcome_msg" style="display: none;">
					<p>
						<label class="title"><?php __('opt_subject'); ?></label>
						<input type="text" name="value-string-o_email_welcome_msg_subject" class="pj-form-field w500" value="<?php echo htmlspecialchars(stripslashes($tpl['o_arr']['o_email_welcome_msg_subject'])); ?>" />
					</p>
					<p>
						<label class="title"><?php __('opt_body_welcome_msg'); ?></label>
						<textarea name="value-text-o_email_welcome_msg" class="pj-form-field w500 h150"><?php echo stripslashes($tpl['o_arr']['o_email_welcome_msg']); ?></textarea>
					</p>
					<p>
						<label class="title">&nbsp;</label>
						<input type="submit" value="<?php __('btnSave'); ?>" class="pj-button" />
					</p>
				</div>
			</div>
			<div id="tabs-2">
				<?php pjUtil::printNotice(__('infoNotificationsSmsTitle', true), __('infoNotificationsSmsBody', true)); ?>
				<p>
					<label class="title"><?php __('opt_o_email_new_user'); ?></label>
					<textarea name="value-text-o_sms_new_user" class="pj-form-field w550 h50"><?php echo stripslashes($tpl['o_arr']['o_sms_new_user']); ?></textarea>
				</p>
				<p>
					<label class="title"><?php __('opt_o_email_new_property'); ?></label>
					<textarea name="value-text-o_sms_new_property" class="pj-form-field w550 h50"><?php echo stripslashes($tpl['o_arr']['o_sms_new_property']); ?></textarea>
				</p>
				<p>
					<label class="title"><?php __('opt_o_email_new_reservation'); ?></label>
					<textarea name="value-text-o_sms_new_reservation" class="pj-form-field w550 h50"><?php echo stripslashes($tpl['o_arr']['o_sms_new_reservation']); ?></textarea>
				</p>
				<p>
					<label class="title"><?php __('opt_o_email_reservation_cancelled'); ?></label>
					<textarea name="value-text-o_sms_reservation_cancelled" class="pj-form-field w550 h50"><?php echo stripslashes($tpl['o_arr']['o_sms_reservation_cancelled']); ?></textarea>
				</p>
				<p>
					<label class="title">&nbsp;</label>
					<input type="submit" value="<?php __('btnSave'); ?>" class="pj-button" />
				</p>
			</div>
		</div>
	
	</form>
	<?php
}
?>