<?php /* Smarty version 2.6.13, created on 2016-06-10 16:15:06
         compiled from admin/subscribers/ajax/subscriber_edit.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('block', 't', 'admin/subscribers/ajax/subscriber_edit.tpl', 6, false),array('modifier', 'escape', 'admin/subscribers/ajax/subscriber_edit.tpl', 28, false),)), $this); ?>
<form class="json validate" action="ajax/manage.rpc.php?call=editSubscriber" method="post" id="edForm">

<div class="output alert"></div>

<fieldset>
<legend><?php $this->_tag_stack[] = array('t', array()); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Edit Subscriber<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></legend>

<div>
<label for="email"><strong class="required"><?php $this->_tag_stack[] = array('t', array()); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Email:<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></strong></label>
<input type="text" class="pvEmail pvEmpty" size="32" maxlength="60" name="email" />
</div>

<?php $_from = $this->_tpl_vars['fields']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['fields'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['fields']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['field']):
        $this->_foreach['fields']['iteration']++;
?>
<div>
<label for="field<?php echo $this->_tpl_vars['key']; ?>
"><?php if ($this->_tpl_vars['field']['required'] == 'on'): ?><strong class="required"><?php endif;  echo $this->_tpl_vars['field']['name']; ?>
:<?php if ($this->_tpl_vars['field']['required'] == 'on'): ?></strong><?php endif; ?></label>

<?php if ($this->_tpl_vars['field']['type'] == 'checkbox'): ?>
<input type="checkbox" name="d[<?php echo $this->_tpl_vars['key']; ?>
]"<?php if ($this->_tpl_vars['field']['normally'] == 'on'): ?> checked="checked"<?php endif;  if ($this->_tpl_vars['field']['required'] == 'on'): ?> class="pvEmpty"<?php endif; ?> />

<?php elseif ($this->_tpl_vars['field']['type'] == 'multiple'): ?>
<select name="d[<?php echo $this->_tpl_vars['key']; ?>
]">
<?php $_from = $this->_tpl_vars['field']['array']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['option']):
?>
<option<?php if ($this->_tpl_vars['field']['normally'] == $this->_tpl_vars['option']): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['option']; ?>
</option>
<?php endforeach; endif; unset($_from); ?>
</select>

<?php elseif ($this->_tpl_vars['field']['type'] == 'date'): ?>
<input type="text" class="pvDate<?php if ($this->_tpl_vars['field']['required'] == 'on'): ?> pvEmpty<?php endif; ?>" size="12" name="d[<?php echo $this->_tpl_vars['key']; ?>
]" value=<?php if ($this->_tpl_vars['field']['normally']): ?>"<?php echo ((is_array($_tmp=$this->_tpl_vars['field']['normally'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"<?php else: ?>"<?php echo $this->_tpl_vars['config']['app']['dateformat']; ?>
"<?php endif; ?> />

<?php elseif ($this->_tpl_vars['field']['type'] == 'number'): ?>
<input type="text" class="pvNumber<?php if ($this->_tpl_vars['field']['required'] == 'on'): ?> pvEmpty<?php endif; ?>" size="12" name="d[<?php echo $this->_tpl_vars['key']; ?>
]" value="<?php if ($this->_tpl_vars['field']['normally']):  echo ((is_array($_tmp=$this->_tpl_vars['field']['normally'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp));  endif; ?>" />

<?php else: ?>
<input type="text" size="32"<?php if ($this->_tpl_vars['field']['required'] == 'on'): ?> class="pvEmpty"<?php endif; ?> name="d[<?php echo $this->_tpl_vars['key']; ?>
]" value="<?php if ($this->_tpl_vars['field']['normally']):  echo ((is_array($_tmp=$this->_tpl_vars['field']['normally'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp));  endif; ?>" />
<?php endif; ?>

</div>

<?php endforeach; endif; unset($_from); ?>

</fieldset>

<fieldset>
	<input type="checkbox" name="force" /><?php $this->_tag_stack[] = array('t', array()); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Force (bypasses validation)<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
</fieldset>

<div class="buttons">

<input type="hidden" name="id" value="0" />

<input type="submit" value="<?php $this->_tag_stack[] = array('t', array()); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Update Subscriber<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>" />


</div>

<p><?php $this->_tag_stack[] = array('t', array('escape' => false,'1' => "<span class=\"required\">",'2' => "</span>")); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Fields marked like %1 this %2 are required.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></p>

</form>

<?php echo '
<script type="text/javascript">


$().ready(function(){

	poMMo.callback.editSubscriber = function(p) {
		poMMo.grid.setRow(p);
	};
	
	// populate form with first selected row... 
	// TODO; add support for multiple subscriber editing at a time.
	var data = poMMo.grid.getRow();
	var scope = $(\'#edForm\')[0];
	
	for (var i in data)  {
		
		// skip empty values/data
		if($.trim(data[i]) == \'\')
			continue;
			
		// transform "d#" to "d[#]"
		var name = (i.match(/^d\\d+$/)) ? \'d[\'+i.substr(1)+\']\' : i;
		$(\':input[@name="\'+name+\'"]\',scope).each(function(){
			if($(this).attr(\'type\') == \'checkbox\')
				this.checked = (data[i] == \'on\') ? true : false;
			else
				$(this).val(""+data[i]+"");
		}); 
	}
	
	$(\'input[@name="force"]\',scope).click(function(){
		if(this.checked)
			$(this).jqvDisable();
		else
			$(this).jqvEnable();
	});
		
});
</script>
'; ?>