<?php /* Smarty version 2.6.28, created on 2017-04-01 23:36:04
         compiled from /home/solusito/public_html/modules/servers/gogetssl/templates/reissue_email.tpl */ ?>
<h2>
	<?php echo $this->_tpl_vars['LANG']['gogetssl_reissue_for']; ?>
 <?php echo $this->_tpl_vars['goget_order']['domain']; ?>

</h2>
<form action="" method="POST">
	<fieldset class="onecol">
		
		<?php $_from = $this->_tpl_vars['goget_approver_emails']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['approver_emails_loop'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['approver_emails_loop']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['domain'] => $this->_tpl_vars['approver_emails']):
        $this->_foreach['approver_emails_loop']['iteration']++;
?>
			<div class="control-group">
				<label class="control-label" for="approver_email"><?php if ($this->_foreach['approver_emails_loop']['total'] == 1): ?><?php echo $this->_tpl_vars['LANG']['gogetssl_approver_email']; ?>
<?php else: ?><?php echo $this->_tpl_vars['LANG']['gogetssl_approver_email_for']; ?>
 <?php echo $this->_tpl_vars['domain']; ?>
<?php endif; ?></label>
				<div class="controls">
					<select name="approver_email_<?php echo ($this->_foreach['approver_emails_loop']['iteration']-1); ?>
" data-domain="<?php echo $this->_tpl_vars['domain']; ?>
">
						<option value="" selected disabled><?php echo $this->_tpl_vars['LANG']['pleasechooseone']; ?>
</option>
						<?php $_from = $this->_tpl_vars['approver_emails']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['email_id'] => $this->_tpl_vars['email_value']):
?><option value="<?php echo $this->_tpl_vars['email_value']; ?>
"><?php echo $this->_tpl_vars['email_value']; ?>
</option><?php endforeach; endif; unset($_from); ?>
					</select>
				</div>
			</div>
		<?php endforeach; endif; unset($_from); ?>

	</fieldset>
	<p align="center"><input type="submit" value="<?php echo $this->_tpl_vars['LANG']['ordercontinuebutton']; ?>
" class="btn btn-primary" /></p>
</form>

<?php echo '
<script>
$(function() {
	var changed = false;
	
    $(\'select[name=approver_email_0]\').change(function() {
		if ($(\'select[name=approver_email_1]\').length && !changed) {
			
			var email = $(this).val().split(\'@\')[0];
			var domain = $(this).data(\'domain\');
			
			$(\'select[name^=approver_email]\').each(function() {
				
				if ($(this).attr(\'name\').split(\'_\')[2] != 0) {
			
					var selected = false;
					
					$(this).children(\'option\').each(function() {
						var subemail = $(this).val().split(\'@\')[0];
						var subdomain = $(this).val().split(\'@\')[1];
						
						if (subemail == email && domain == subdomain && !selected) {
							$(this).attr(\'selected\', \'selected\');
							selected = true;
						}
						
					});
					
					if (!selected) {
						$(this).children(\'option\').each(function() {
							var subemail = $(this).val().split(\'@\')[0];
							var subdomain = $(this).val().split(\'@\')[1];
							
							if (subemail == email && !selected) {
								$(this).attr(\'selected\', \'selected\');
								selected = true;
							}
							
						});
					}
					
					changed = selected;
					
				}
			});
		}
		
    });
		
	$(\'#\' + $(\'input[name=validation_method]:checked\').attr(\'id\') + \'_fields\').show();
});
</script>
'; ?>
