<?php /* Smarty version 2.6.26, created on 2017-04-13 01:16:18
         compiled from /home3/bargaip4/public_html/gevimmo/plugins/androidConnect/admin/android_adsense.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'cat', '/home3/bargaip4/public_html/gevimmo/plugins/androidConnect/admin/android_adsense.tpl', 15, false),array('modifier', 'in_array', '/home3/bargaip4/public_html/gevimmo/plugins/androidConnect/admin/android_adsense.tpl', 64, false),array('modifier', 'ceil', '/home3/bargaip4/public_html/gevimmo/plugins/androidConnect/admin/android_adsense.tpl', 66, false),)), $this); ?>
<!-- navigation bar -->
<div id="nav_bar">
	
	<?php if ($this->_tpl_vars['aRights'][$this->_tpl_vars['cKey']]['add'] && $_GET['action'] != 'add'): ?>
		<a href="<?php echo $this->_tpl_vars['rlBaseC']; ?>
action=add" class="button_bar"><span class="left"></span><span class="center_add"><?php echo $this->_tpl_vars['lang']['add_new_adsense']; ?>
</span><span class="right"></span></a>
	<?php endif; ?>	
	<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']['show_list']; ?>
</span><span class="right"></span></a>
</div>
<!-- navigation bar end -->
<?php if ($_GET['action'] == 'add' || $_GET['action'] == 'edit'): ?>
	
<?php $this->assign('sPost', $_POST); ?>

	<!-- add new/edit adsense -->
	<?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 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="id" value="<?php echo $this->_tpl_vars['sPost']['id']; ?>
" />
			<?php endif; ?>
			<table class="form">
			<tr>
				<td class="name">
					<span class="red">*</span><?php echo $this->_tpl_vars['lang']['name']; ?>

				</td>
				<td>
					<input type="text" name="name" value="<?php echo $this->_tpl_vars['sPost']['name']; ?>
" maxlength="350" />
				</td>
			</tr>
			<tr>
				<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['position']; ?>
</td>
				<td class="field">
					<select name="side">
						<option value=""><?php echo $this->_tpl_vars['lang']['select']; ?>
</option>
						<?php $_from = $this->_tpl_vars['side']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['sides_f'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['sides_f']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['sKey'] => $this->_tpl_vars['side']):
        $this->_foreach['sides_f']['iteration']++;
?>
							<option value="<?php echo $this->_tpl_vars['sKey']; ?>
" <?php if ($this->_tpl_vars['sKey'] == $this->_tpl_vars['sPost']['side']): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['side']; ?>
</option>
						<?php endforeach; endif; unset($_from); ?>
					</select>
				</td>
			</tr>
			<tr>
				<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['adsense_code']; ?>
</td>
				<td class="field">
					<input type="text" name="code" value="<?php echo $this->_tpl_vars['sPost']['code']; ?>
" maxlength="350" />
					<span class="field_description_noicon"><?php echo $this->_tpl_vars['lang']['admob_unit_id_help']; ?>
</span>
				</td>
			</tr>
			<tr>
				<td class="name"><?php echo $this->_tpl_vars['lang']['show_on_pages']; ?>
</td>
				<td class="field" id="pages_obj">
					<fieldset class="light">
						<?php $this->assign('pages_phrase', 'admin_controllers+name+pages'); ?>
						<legend id="legend_pages" class="up"><?php echo $this->_tpl_vars['lang'][$this->_tpl_vars['pages_phrase']]; ?>
</legend>
						<div id="pages">
							<div id="pages_cont" <?php if (! empty ( $this->_tpl_vars['sPost']['show_on_all'] )): ?>style="display: none;"<?php endif; ?>>
								<?php $this->assign('bPages', $this->_tpl_vars['sPost']['pages']); ?>
								<table class="sTable" style="margin-bottom: 15px;">
								<tr>
									<td valign="top">
									<?php $_from = $this->_tpl_vars['android_pages']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['pagesF'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['pagesF']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['page']):
        $this->_foreach['pagesF']['iteration']++;
?>
									<div style="padding: 2px 8px;">
										<label class="cLabel<?php if (! isset ( $this->_tpl_vars['bPages'][$this->_tpl_vars['key']] ) && ((is_array($_tmp=$this->_tpl_vars['key'])) ? $this->_run_mod_handler('in_array', true, $_tmp, $this->_tpl_vars['used_screens']) : in_array($_tmp, $this->_tpl_vars['used_screens']))): ?> disabled<?php endif; ?>" for="page_<?php echo $this->_tpl_vars['key']; ?>
" <?php if (! isset ( $this->_tpl_vars['bPages'][$this->_tpl_vars['key']] ) && ((is_array($_tmp=$this->_tpl_vars['key'])) ? $this->_run_mod_handler('in_array', true, $_tmp, $this->_tpl_vars['used_screens']) : in_array($_tmp, $this->_tpl_vars['used_screens']))): ?>title="<?php echo $this->_tpl_vars['lang']['page_used']; ?>
"<?php endif; ?>><input class="checkbox disabled" <?php if (! isset ( $this->_tpl_vars['bPages'][$this->_tpl_vars['key']] ) && ((is_array($_tmp=$this->_tpl_vars['key'])) ? $this->_run_mod_handler('in_array', true, $_tmp, $this->_tpl_vars['used_screens']) : in_array($_tmp, $this->_tpl_vars['used_screens']))): ?>disabled="disabled"<?php elseif (isset ( $this->_tpl_vars['bPages'][$this->_tpl_vars['key']] )): ?>checked="checked"<?php endif; ?> id="page_<?php echo $this->_tpl_vars['key']; ?>
" type="checkbox" name="pages[<?php echo $this->_tpl_vars['key']; ?>
]" value="<?php echo $this->_tpl_vars['key']; ?>
" /> <?php if ($this->_tpl_vars['page'] == 'account_search_results'): ?><?php echo $this->_tpl_vars['lang'][$this->_tpl_vars['page']]; ?>
<?php else: ?><?php echo $this->_tpl_vars['android_phrases'][$this->_tpl_vars['page']]; ?>
<?php endif; ?></label>
									</div>
									<?php $this->assign('perCol', ((is_array($_tmp=$this->_foreach['pagesF']['total']/3)) ? $this->_run_mod_handler('ceil', true, $_tmp) : ceil($_tmp))); ?>
				
									<?php if ($this->_foreach['pagesF']['iteration'] % $this->_tpl_vars['perCol'] == 0): ?>
										</td>
										<td valign="top">
									<?php endif; ?>
									<?php endforeach; endif; unset($_from); ?>
									</td>
								</tr>
								</table>
							</div>
							
							<div class="grey_area" style="margin: 0 0 5px;">
								<span id="pages_nav" <?php if ($this->_tpl_vars['sPost']['show_on_all']): ?>class="hide"<?php endif; ?>>
									<span onclick="$('#pages_cont input').attr('checked', true);" class="green_10"><?php echo $this->_tpl_vars['lang']['check_all']; ?>
</span>
									<span class="divider"> | </span>
									<span onclick="$('#pages_cont input').attr('checked', false);" class="green_10"><?php echo $this->_tpl_vars['lang']['uncheck_all']; ?>
</span>
								</span>
							</div>
						</div>
					</fieldset>
					
					<script type="text/javascript">
					<?php echo '
					
					$(document).ready(function(){
						$(\'#legend_pages\').click(function(){
							fieldset_action(\'pages\');
						});
						
						$(\'input#show_on_all\').click(function(){
							$(\'#pages_cont\').slideToggle();
							$(\'#pages_nav\').fadeToggle();
						});
						
						$(\'#pages input\').click(function(){
							if ( $(\'#pages input:checked\').length > 0 )
							{
								//$(\'#show_on_all\').prop(\'checked\', false);
							}
						});
					});
					
					'; ?>

					</script>
				</td>
			</tr>
			<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="inactive" <?php if ($this->_tpl_vars['sPost']['status'] == 'inactive'): ?>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 adsense end -->
<?php else: ?>
	<script type="text/javascript">
	// blocks box types list
	var block_sides = [
	<?php $_from = $this->_tpl_vars['side']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['sides_f'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['sides_f']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['sKey'] => $this->_tpl_vars['block_side']):
        $this->_foreach['sides_f']['iteration']++;
?>
		['<?php echo $this->_tpl_vars['sKey']; ?>
', '<?php echo $this->_tpl_vars['block_side']; ?>
']<?php if (! ($this->_foreach['sides_f']['iteration'] == $this->_foreach['sides_f']['total'])): ?>,<?php endif; ?>
	<?php endforeach; endif; unset($_from); ?>
	];
	
	</script>
	<div id="gridAdsense"></div>
	<script type="text/javascript">//<![CDATA[
	var adsense;
	<?php echo '
	$(document).ready(function(){
		
		adsense = new gridObj({
			key: \'adsense\',
			id: \'gridAdsense\',
			ajaxUrl: rlPlugins + \'androidConnect/admin/android_adsense.inc.php?q=ext\',
			defaultSortField: \'ID\',
			title: lang[\'ext_manager\'],
			fields: [
				{name: \'ID\', mapping: \'ID\'},
				{name: \'Name\', mapping: \'Name\'},
				{name: \'Side\', mapping: \'Side\'},
				{name: \'Code\', mapping: \'Code\'},
				{name: \'Status\', mapping: \'Status\'}
			],
			columns: [
				{
					header: lang[\'ext_id\'],
					dataIndex: \'ID\',
					width: 3
				},{
					header: lang[\'ext_name\'],
					dataIndex: \'Name\',
					width: 30
				},{
					header: lang[\'ext_position\'],
					dataIndex: \'Side\',
					width: 15,
					editor: new Ext.form.ComboBox({
						store: block_sides,
						displayField: \'value\',
						valueField: \'key\',
						typeAhead: true,
						mode: \'local\',
						triggerAction: \'all\',
						selectOnFocus:true
					}),
					renderer: function(val){
						return \'<span ext:qtip="\'+lang[\'ext_click_to_edit\']+\'">\'+val+\'</span>\';
					}
				},{
					header: lang[\'ext_adsense_code\'],
					dataIndex: \'Code\',
					width: 30
				},{
					header: lang[\'ext_status\'],
					dataIndex: \'Status\',
					width: 10,
					editor: new Ext.form.ComboBox({
						store: [
							[\'active\', lang[\'ext_active\']],
							[\'approval\', lang[\'ext_approval\']]
						],
						mode: \'local\',
						typeAhead: true,
						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;
						
						
							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 += "<img class=\'remove\' ext:qtip=\'"+lang[\'ext_delete\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' onclick=\'rlConfirm( \\""+lang[\'ext_notice_\'+delete_mod]+"\\", \\"xajax_deleteAdsenseBox\\", \\""+Array(data)+"\\", \\"section_load\\" )\' />";
						
						out += "</center>";
						
						return out;
					}
				}
			]
		});
		
		adsense.init();
		grid.push(adsense.grid);
		
	});
	'; ?>

	//]]>
	</script>
<?php endif; ?>