<?php /* Smarty version 2.6.13, created on 2013-02-16 19:12:09
         compiled from admin/subscribers/groups_edit.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('block', 't', 'admin/subscribers/groups_edit.tpl', 9, false),array('modifier', 'escape', 'admin/subscribers/groups_edit.tpl', 26, false),array('modifier', 'pommoDateFormat', 'admin/subscribers/groups_edit.tpl', 116, false),array('function', 'cycle', 'admin/subscribers/groups_edit.tpl', 59, false),)), $this); ?>
<?php ob_start(); ?>
<link type="text/css" rel="stylesheet" href="<?php echo $this->_tpl_vars['url']['theme']['shared']; ?>
css/table.css" />
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "inc/ui.dialog.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
  $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "inc/ui.form.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
  $this->_smarty_vars['capture']['head'] = ob_get_contents(); ob_end_clean();  $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "inc/admin.header.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<ul class="inpage_menu">
<li><a href="<?php echo $this->_tpl_vars['url']['base']; ?>
admin/subscribers/subscribers_groups.php"><?php $this->_tag_stack[] = array('t', array('1' => $this->_tpl_vars['returnStr'])); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Return to %1<?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); ?></a></li>
</ul>

<h2><?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 Group<?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); ?></h2>

<p>
<img src="<?php echo $this->_tpl_vars['url']['theme']['shared']; ?>
images/icons/groups.png" alt="groups icon" class="navimage right" />
<?php $this->_tag_stack[] = array('t', array('escape' => false,'1' => "<a href=\"".($this->_tpl_vars['url']['base'])."admin/setup/setup_fields.php\">",'2' => "</a>")); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>To add subscribers to a group you must create matching rules. Subscribers are automatically added to a group if their %1subscriber field%2 values "match" a Group's rules. For example, if you collect "AGE" and "COUNTRY" as %1subscriber fields%2, you can match those who are 21+ and living in Japan by creating two rules; one which matches "AGE" to greater than 20, and another which matches "Japan" to "COUNTRY". Including or excluding members of other groups is possible.<?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>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "inc/messages.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<form class="json validate" action="ajax/group.rpc.php?call=renameGroup" method="post">
	
	<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(); ?>Change Name<?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="group_name"><?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(); ?>Group name:<?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); ?></label> <input class="pvEmpty" type="text" title="<?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(); ?>type new group name<?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); ?>" maxlength="60" size="30" name="group_name" id="group_name" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['group']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" />
	<input type="submit" name="rename" 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(); ?>Rename<?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 class="output"></div>
	</div>
	</fieldset>
</form>


<form action="" id="addRule" method="post">
<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(); ?>Add Rule<?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="field"><?php $this->_tag_stack[] = array('t', array('escape' => false,'1' => "<strong><a href=\"".($this->_tpl_vars['url']['base'])."admin/setup/setup_fields.php\">",'2' => "</a></strong>")); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Select a %1 field %2 to filter<?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); ?></label>
<select name="field">
<option 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(); ?>Choose Subscriber Field<?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); ?> --</option>
<?php $_from = $this->_tpl_vars['legalFieldIDs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['id'] => $this->_tpl_vars['name']):
?><option value="<?php echo $this->_tpl_vars['id']; ?>
"><?php echo $this->_tpl_vars['fields'][$this->_tpl_vars['id']]['name']; ?>
</option><?php endforeach; endif; unset($_from); ?>
</select>
</div>

<div>
<label for="group"><?php $this->_tag_stack[] = array('t', array('escape' => false,'1' => "<strong><a href=\"".($this->_tpl_vars['url']['base'])."admin/subscribers/subscribers_groups.php\">",'2' => "</a></strong>")); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>or, Select a %1 group %2 to include or exclude<?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); ?></label>
<select name="group">
<option 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(); ?>Choose Group<?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); ?> --</option>
<?php $_from = $this->_tpl_vars['legalGroups']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['id'] => $this->_tpl_vars['name']):
?><option value="<?php echo $this->_tpl_vars['id']; ?>
"><?php echo $this->_tpl_vars['name']; ?>
</option><?php endforeach; endif; unset($_from); ?>
</select>
</div>

</fieldset>
</form>

<?php echo smarty_function_cycle(array('reset' => true,'print' => false,'advance' => false,'values' => "r1,r2,r3"), $this);?>


<form id="rules" class="json" action="ajax/group.rpc.php?call=updateRule" method="post">
<input type="hidden" name="fieldID" value=''>
<input type="hidden" name="logic" value=''>
<input type="hidden" name="type" value=''>
<input type="hidden" name="request" value=''>

<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(); ?>Group Rules<?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>

<table>
<thead>
<tr>
<th><?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(); ?>Delete<?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); ?></th>
<th><?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<?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); ?></th>
<th><?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(); ?>Field<?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); ?></th>
<th><?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(); ?>Logic<?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); ?></th>
<th><?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(); ?>Value<?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); ?></th>
<th><?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(); ?>Type<?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); ?></th>
</tr>
</thead>
<tbody>
<tr class="alert"><td colspan="6" style="padding: 5px;">
	<center>
	<?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(); ?>"AND" RULES<?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); ?> <br />
	<?php $this->_tag_stack[] = array('t', array('escape' => false,'1' => '<strong>','2' => '</strong>')); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>MATCH %1ALL%2 OF THE FOLLOWING<?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); ?>
	</center>
</td>
</tr>

<?php $_from = $this->_tpl_vars['rules']['and']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['field_id'] => $this->_tpl_vars['rule']):
 $_from = $this->_tpl_vars['rule']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['logic_id'] => $this->_tpl_vars['values']):
?>
<tr class="<?php echo smarty_function_cycle(array('values' => "r1,r2,r3"), $this);?>
">
<td>
<img src="<?php echo $this->_tpl_vars['url']['theme']['shared']; ?>
images/icons/delete.png" alt="<?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(); ?>Delete<?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); ?>" onClick="poMMo.callback.updateRule({fieldID:'<?php echo ((is_array($_tmp=$this->_tpl_vars['field_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
',logic:'<?php echo ((is_array($_tmp=$this->_tpl_vars['logic_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
',request:'delete'});" />
</td>
<td>
<?php if ($this->_tpl_vars['logic_id'] != 'true' && $this->_tpl_vars['logic_id'] != 'false'): ?><img src="<?php echo $this->_tpl_vars['url']['theme']['shared']; ?>
images/icons/edit.png" alt="<?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<?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); ?>" onClick="poMMo.callback.editRule({fieldID:'<?php echo ((is_array($_tmp=$this->_tpl_vars['field_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
',logic:'<?php echo ((is_array($_tmp=$this->_tpl_vars['logic_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
', type: 'and'});" />
<?php endif; ?>
</td>

<td><?php echo $this->_tpl_vars['fields'][$this->_tpl_vars['field_id']]['name']; ?>
</td>

<td><?php echo $this->_tpl_vars['logicNames'][$this->_tpl_vars['logic_id']]; ?>
</td>

<td>
<ul>
<?php $_from = $this->_tpl_vars['values']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['vals'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['vals']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['v']):
        $this->_foreach['vals']['iteration']++;
 if ($this->_tpl_vars['v']): ?>
	<?php if (! ($this->_foreach['vals']['iteration'] <= 1)): ?><br />(<?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(); ?>or<?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); ?>)<?php endif; ?>
	
	<?php if ($this->_tpl_vars['fields'][$this->_tpl_vars['field_id']]['type'] == 'date'): ?>
	<?php echo ((is_array($_tmp=$this->_tpl_vars['v'])) ? $this->_run_mod_handler('pommoDateFormat', true, $_tmp) : smarty_modifier_pommoDateFormat($_tmp)); ?>

	<?php else: ?>
	<?php echo $this->_tpl_vars['v']; ?>

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

<td>
<select onChange="poMMo.callback.updateRule({fieldID:'<?php echo ((is_array($_tmp=$this->_tpl_vars['field_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
',logic:'<?php echo ((is_array($_tmp=$this->_tpl_vars['logic_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
',type:'or',request:'update'});">
<option selected><?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(); ?>AND<?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); ?></option>
<option><?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(); ?>OR<?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); ?></option>
</select>
</td>

</tr>
<?php endforeach; endif; unset($_from);  endforeach; else: ?>
<tr class="r1"><td colspan="5"><?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(); ?>No rules have been added<?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); ?></td></tr>
<?php endif; unset($_from); ?>

<?php echo smarty_function_cycle(array('reset' => true,'print' => false,'advance' => false), $this);?>

<tr class="alert"><td colspan="6" style="padding: 5px; position: relative;">
	<center>
	<?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(); ?>"OR" RULES<?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); ?> <br />
	<?php $this->_tag_stack[] = array('t', array('escape' => false,'1' => '<strong>','2' => '</strong>')); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><strong>OR</strong>, MATCH %1ANY%2 OF THE FOLLOWING<?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); ?>
	</center>
</td>
</tr>

<?php $_from = $this->_tpl_vars['rules']['or']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['field_id'] => $this->_tpl_vars['rule']):
 $_from = $this->_tpl_vars['rule']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['logic_id'] => $this->_tpl_vars['values']):
?>
<tr class="<?php echo smarty_function_cycle(array('values' => "r1,r2,r3"), $this);?>
">

<td>
<img src="<?php echo $this->_tpl_vars['url']['theme']['shared']; ?>
images/icons/delete.png" alt="<?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(); ?>Delete<?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); ?>" onClick="poMMo.callback.updateRule({fieldID:'<?php echo ((is_array($_tmp=$this->_tpl_vars['field_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
',logic:'<?php echo ((is_array($_tmp=$this->_tpl_vars['logic_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
',request:'delete'});" />
</td>

<td>
<?php if ($this->_tpl_vars['logic_id'] != 'true' && $this->_tpl_vars['logic_id'] != 'false'): ?><img src="<?php echo $this->_tpl_vars['url']['theme']['shared']; ?>
images/icons/edit.png" alt="<?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<?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); ?>" onClick="poMMo.callback.editRule({fieldID:'<?php echo ((is_array($_tmp=$this->_tpl_vars['field_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
',logic:'<?php echo ((is_array($_tmp=$this->_tpl_vars['logic_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
', type: 'or'});" />
<?php endif; ?>
</td>

<td><?php echo $this->_tpl_vars['fields'][$this->_tpl_vars['field_id']]['name']; ?>
</td>

<td><?php echo $this->_tpl_vars['logicNames'][$this->_tpl_vars['logic_id']]; ?>
</td>

<td>
<ul>
<?php $_from = $this->_tpl_vars['values']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['vals'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['vals']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['v']):
        $this->_foreach['vals']['iteration']++;
 if ($this->_tpl_vars['v']):  if (! ($this->_foreach['vals']['iteration'] <= 1)): ?><br />(<?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(); ?>or<?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); ?>) <?php endif; ?> <?php echo $this->_tpl_vars['v'];  endif;  endforeach; endif; unset($_from); ?>
</ul>
</td>

<td>
<select onChange="poMMo.callback.updateRule({fieldID:'<?php echo ((is_array($_tmp=$this->_tpl_vars['field_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
',logic:'<?php echo ((is_array($_tmp=$this->_tpl_vars['logic_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
',type:'and',request:'update'});">
<option><?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(); ?>AND<?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); ?></option>
<option selected=true><?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(); ?>OR<?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); ?></option>
</select>
</td>

</tr>
<?php endforeach; endif; unset($_from);  endforeach; else: ?>
<tr class="r1"><td colspan="5"><?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(); ?>No rules have been added<?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); ?></td></tr>
<?php endif; unset($_from); ?>

<?php echo smarty_function_cycle(array('reset' => true,'print' => false,'advance' => false), $this);?>

<tr class="alert"><td colspan="6" style="padding: 5px;">
	<center>
	<?php $this->_tag_stack[] = array('t', array('escape' => false,'1' => $this->_tpl_vars['t_include'])); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><strong>AND</strong>, ADD OR SUBTRACT MEMBERS IN OTHER GROUPS<?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); ?> <br />
	</center>
</td>
</tr>

<?php $_from = $this->_tpl_vars['rules']['include']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['field_id'] => $this->_tpl_vars['rule']):
 $_from = $this->_tpl_vars['rule']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['logic_id'] => $this->_tpl_vars['values']):
?>
<tr class="<?php echo smarty_function_cycle(array('values' => "r1,r2,r3"), $this);?>
">

<td colspan="2">
<img src="<?php echo $this->_tpl_vars['url']['theme']['shared']; ?>
images/icons/delete.png" alt="<?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(); ?>Delete<?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); ?>" onClick="poMMo.callback.updateRule({fieldID:'<?php echo ((is_array($_tmp=$this->_tpl_vars['field_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
',logic:'is_in',request:'delete'});" />
</td>

<td colspan="4"><?php $this->_tag_stack[] = array('t', array('escape' => false,'1' => "<strong>",'2' => "</strong>",'3' => $this->_tpl_vars['values'])); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>%1Add%2 members matching %3<?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); ?></td>

</tr>
<?php endforeach; endif; unset($_from);  endforeach; else: ?>
<tr class="r1"><td colspan="5"><?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(); ?>No rules have been added<?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); ?></td></tr>
<?php endif; unset($_from); ?>

<?php $_from = $this->_tpl_vars['rules']['exclude']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['field_id'] => $this->_tpl_vars['rule']):
 $_from = $this->_tpl_vars['rule']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['logic_id'] => $this->_tpl_vars['values']):
?>
<tr class="<?php echo smarty_function_cycle(array('values' => "r1,r2,r3"), $this);?>
">

<td colspan="2">
<img src="<?php echo $this->_tpl_vars['url']['theme']['shared']; ?>
images/icons/delete.png" alt="<?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(); ?>Delete<?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); ?>" onClick="poMMo.callback.updateRule({fieldID:'<?php echo ((is_array($_tmp=$this->_tpl_vars['field_id'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
',logic:'not_in',request:'delete'});" />
</td>

<td colspan="4"><?php $this->_tag_stack[] = array('t', array('escape' => false,'1' => "<strong>",'2' => "</strong>",'3' => $this->_tpl_vars['values'])); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>%1Subtract%2 members matching %3<?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); ?></td>

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

</table>

</fieldset>
</form>

<p><?php $this->_tag_stack[] = array('t', array('escape' => false,'1' => "<em>".($this->_tpl_vars['ruleCount'])."</em>",'2' => "<strong>".($this->_tpl_vars['tally'])."</strong>")); $_block_repeat=true;smarty_block_t($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>%1 rules match a total of %2 active subscribers<?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>

<?php echo '
<script type="text/javascript">
$().ready(function(){
	// assign ajax + json forms
	poMMo.form.assign();
	
	// Setup Modal Dialogs
	PommoDialog.init(\'#dialog\',{modal: true});

	$(\'#addRule select\').change(function(){
		var type = this.name, fieldID = $(this).val();
		if($.trim(fieldID) != \'\')
			$(\'#dialog\')
				.jqm({ajax: \'ajax/group.rpc.php?call=displayRule&ruleType=\'+type+\'&fieldID=\'+fieldID})
				.jqmShow();
	});
	
});

poMMo.callback.updateRule = function(p) {
	$(\'#rules input[@name=fieldID]\').val(p.fieldID);
	$(\'#rules input[@name=logic]\').val(p.logic);
	$(\'#rules input[@name=type]\').val(p.type);
	$(\'#rules input[@name=request]\').val(p.request);
	
	poMMo.callback.pause();
	$(\'#rules\').submit();
	return false;
};

poMMo.callback.editRule = function(p) {
	console.log(p.logic);
	$(\'#dialog\')
		.jqm({ajax: \'ajax/group.rpc.php?call=displayRule&ruleType=field&fieldID=\'+p.fieldID+\'&logic=\'+p.logic+\'&type=\'+p.type})
		.jqmShow();	
	return false;
};


</script>
'; ?>


<?php ob_start();  $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "inc/dialog.tpl", 'smarty_include_vars' => array('id' => 'dialog','wide' => true)));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
  $this->_smarty_vars['capture']['dialogs'] = ob_get_contents(); ob_end_clean(); ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "inc/admin.footer.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>