<?php /* Smarty version 2.6.26, created on 2017-04-06 05:55:11
         compiled from controllers/membership_services.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'rlHook', 'controllers/membership_services.tpl', 5, false),array('modifier', 'cat', 'controllers/membership_services.tpl', 18, false),array('modifier', 'count', 'controllers/membership_services.tpl', 35, false),)), $this); ?>
<!-- membership services tpl -->

<!-- navigation bar -->
<div id="nav_bar">
	<?php echo rlHook::load(array('name' => 'apTplMembershipServiceBar'), $this);?>

	
	<?php if ($_GET['action']): ?>
		<a href="<?php echo $this->_tpl_vars['rlBase']; ?>
index.php?controller=<?php echo $_GET['controller']; ?>
" class="button_bar"><span class="left"></span><span class="center_list"><?php echo $this->_tpl_vars['lang']['services_list']; ?>
</span><span class="right"></span></a>	
	<?php endif; ?>
</div>
<!-- navigation bar end -->

<?php if ($_GET['action']): ?>

	<?php $this->assign('sPost', $_POST); ?>

	<!-- add new/edit service -->
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_start.tpl') : smarty_modifier_cat($_tmp, 'm_block_start.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
	<form onsubmit="return submitHandler()" action="<?php echo $this->_tpl_vars['rlBaseC']; ?>
action=<?php if ($_GET['action'] == 'add'): ?>add<?php elseif ($_GET['action'] == 'edit'): ?>edit&amp;id=<?php echo $_GET['id']; ?>
<?php endif; ?>" method="post">
	<input type="hidden" name="submit" value="1" />
	<?php if ($_GET['action'] == 'edit'): ?>
		<input type="hidden" name="fromPost" value="1" />
		<input type="hidden" name="key" value="<?php echo $this->_tpl_vars['sPost']['Key']; ?>
" />
	<?php endif; ?>
	<table class="form">
		<tr>
			<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['key']; ?>
</td>
			<td class="field">
				<input <?php if ($_GET['action'] == 'edit'): ?>readonly="readonly"<?php endif; ?> class="<?php if ($_GET['action'] == 'edit'): ?>disabled<?php endif; ?>" name="key" type="text" style="width: 150px;" value="<?php echo $this->_tpl_vars['sPost']['key']; ?>
" maxlength="30" />
			</td>
		</tr>
		<tr>
			<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['name']; ?>
</td>
			<td class="field">
				<?php if (count($this->_tpl_vars['allLangs']) > 1): ?>
					<ul class="tabs">
						<?php $_from = $this->_tpl_vars['allLangs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['langF'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['langF']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['language']):
        $this->_foreach['langF']['iteration']++;
?>
						<li lang="<?php echo $this->_tpl_vars['language']['Code']; ?>
" <?php if (($this->_foreach['langF']['iteration'] <= 1)): ?>class="active"<?php endif; ?>><?php echo $this->_tpl_vars['language']['name']; ?>
</li>
						<?php endforeach; endif; unset($_from); ?>
					</ul>
				<?php endif; ?>

				<?php $_from = $this->_tpl_vars['allLangs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['langF'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['langF']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['language']):
        $this->_foreach['langF']['iteration']++;
?>
					<?php if (count($this->_tpl_vars['allLangs']) > 1): ?><div class="tab_area<?php if (! ($this->_foreach['langF']['iteration'] <= 1)): ?> hide<?php endif; ?> <?php echo $this->_tpl_vars['language']['Code']; ?>
"><?php endif; ?>
					<input type="text" name="name[<?php echo $this->_tpl_vars['language']['Code']; ?>
]" value="<?php echo $this->_tpl_vars['sPost']['name'][$this->_tpl_vars['language']['Code']]; ?>
" maxlength="350" />
					<?php if (count($this->_tpl_vars['allLangs']) > 1): ?>
							<span class="field_description_noicon"><?php echo $this->_tpl_vars['lang']['name']; ?>
 (<b><?php echo $this->_tpl_vars['language']['name']; ?>
</b>)</span>
						</div>
					<?php endif; ?>
				<?php endforeach; endif; unset($_from); ?>
			</td>
		</tr>

		<?php echo rlHook::load(array('name' => 'apTplMembershipServiceForm'), $this);?>


		<tr>
			<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['status']; ?>
</td>
			<td class="field">
				<select name="status">
					<option value="active" <?php if ($this->_tpl_vars['sPost']['status'] == 'active'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['active']; ?>
</option>
					<option value="approval" <?php if ($this->_tpl_vars['sPost']['status'] == 'approval'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['approval']; ?>
</option>
				</select>
			</td>
		</tr>
		<tr>
			<td></td>
			<td class="field">
				<input type="submit" value="<?php if ($_GET['action'] == 'edit'): ?><?php echo $this->_tpl_vars['lang']['edit']; ?>
<?php else: ?><?php echo $this->_tpl_vars['lang']['add']; ?>
<?php endif; ?>" />
			</td>
		</tr>
	</table>
	</form>
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'm_block_end.tpl') : smarty_modifier_cat($_tmp, 'm_block_end.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
	<!-- add new/edit service end -->

<?php else: ?>

	<!-- membership services grid -->
	<div id="grid"></div>
	<script type="text/javascript">//<![CDATA[
	var membershipServicesGrid;
	
	<?php echo '
	$(document).ready(function(){
		
		membershipServicesGrid = new gridObj({
			key: \'news\',
			id: \'grid\',
			ajaxUrl: rlUrlHome + \'controllers/membership_services.inc.php?q=ext\',
			defaultSortField: \'Position\',
			defaultSortType: \'ASC\',
			title: lang[\'ext_membership_services_manager\'],
			fields: [
				{name: \'ID\', mapping: \'ID\'},
				{name: \'name\', mapping: \'name\', type: \'string\'},
				{name: \'Price\', mapping: \'Price\', type: \'float\'},
				{name: \'Position\', mapping: \'Position\', type: \'integer\'},
				{name: \'Status\', mapping: \'Status\'}
			],
			columns: [
				{
					header: lang[\'ext_name\'],
					dataIndex: \'name\',
					width: 60,
					id: \'rlExt_item_bold\'
				},{
					header: lang[\'ext_position\'],
					dataIndex: \'Position\',
					width: 10,
					editor: new Ext.form.NumberField({
						allowBlank: false,
						allowDecimals: false
					}),
					renderer: function(val){
						return \'<span ext:qtip="\'+lang[\'ext_click_to_edit\']+\'">\'+val+\'</span>\';
					}
				},{
					header: lang[\'ext_status\'],
					dataIndex: \'Status\',
					width: 100,
					fixed: true,
					editor: new Ext.form.ComboBox({
						store: [
							[\'active\', lang[\'ext_active\']],
							[\'approval\', lang[\'ext_approval\']]
						],
						displayField: \'value\',
						valueField: \'key\',
						typeAhead: true,
						mode: \'local\',
						triggerAction: \'all\',
						selectOnFocus:true
					})
				},{
					header: lang[\'ext_actions\'],
					width: 70,
					fixed: true,
					dataIndex: \'ID\',
					sortable: false,
					renderer: function(data) {
						var out = "<center>";
						var splitter = false;
						
						if ( rights[cKey].indexOf(\'edit\') >= 0 )
						{
							out += "<a href=\'"+rlUrlHome+"index.php?controller="+controller+"&action=edit&id="+data+"\'><img class=\'edit\' ext:qtip=\'"+lang[\'ext_edit\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' /></a>";
						}
						out += "</center>";
						
						return out;
					}
				}
			]
		});
		
		'; ?>
<?php echo rlHook::load(array('name' => 'apTplMembershipServicesGrid'), $this);?>
<?php echo '
		
		membershipServicesGrid.init();
		grid.push(membershipServicesGrid.grid);
		
	});
	'; ?>

	//]]>
	</script>
	<!-- membership services grid end -->
	
	<?php echo rlHook::load(array('name' => 'apTplMembershipServicesBottom'), $this);?>


<?php endif; ?>

<!-- membership services tpl end -->