<?php /* Smarty version 2.6.26, created on 2017-04-13 17:35:37
         compiled from /home3/bargaip4/public_html/gevimmo/plugins/booking/admin/booking.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'replace', '/home3/bargaip4/public_html/gevimmo/plugins/booking/admin/booking.tpl', 43, false),array('modifier', 'cat', '/home3/bargaip4/public_html/gevimmo/plugins/booking/admin/booking.tpl', 56, false),array('modifier', 'count', '/home3/bargaip4/public_html/gevimmo/plugins/booking/admin/booking.tpl', 165, false),array('modifier', 'date_format', '/home3/bargaip4/public_html/gevimmo/plugins/booking/admin/booking.tpl', 479, false),array('modifier', 'ceil', '/home3/bargaip4/public_html/gevimmo/plugins/booking/admin/booking.tpl', 796, false),array('modifier', 'unserialize', '/home3/bargaip4/public_html/gevimmo/plugins/booking/admin/booking.tpl', 824, false),array('function', 'str2money', '/home3/bargaip4/public_html/gevimmo/plugins/booking/admin/booking.tpl', 491, false),)), $this); ?>
<!-- booking system -->

<!-- navigation bar -->
<div id="nav_bar">

	<?php if ($_GET['mode'] == 'booking_fields'): ?>
	<a href="<?php echo $this->_tpl_vars['rlBaseC']; ?>
mode=booking_fields&amp;action=add" class="button_bar"><span class="left"></span><?php echo '<span class="center_add">'; ?><?php echo $this->_tpl_vars['lang']['add']; ?><?php echo ' '; ?><?php echo $this->_tpl_vars['lang']['booking_fields']; ?><?php echo '</span><span class="right"></span>'; ?>
</a>
	<?php endif; ?>

	<?php if ($_GET['mode'] == 'ranges' && $_GET['view'] == 'rate_range'): ?>
	<a href="javascript:void(0)" onclick="show('ranges_action_add');" class="button_bar"><span class="left"></span><?php echo '<span class="center_add">'; ?><?php echo $this->_tpl_vars['lang']['booking_rate_add']; ?><?php echo '</span><span class="right"></span>'; ?>
</a>
	<?php endif; ?>

	<?php if ($_GET['mode'] != 'ranges'): ?>
	<a href="<?php echo $this->_tpl_vars['rlBaseC']; ?>
mode=ranges" class="button_bar"><span class="left"></span><?php echo '<span class="center_list">'; ?><?php echo $this->_tpl_vars['lang']['booking_admin_listings_tab']; ?><?php echo '</span><span class="right"></span>'; ?>
</a>
	<?php endif; ?>

	<?php if ($_GET['mode'] != 'additionals'): ?>
	<a href="<?php echo $this->_tpl_vars['rlBaseC']; ?>
mode=additionals" class="button_bar"><span class="left"></span><?php echo '<span class="center_list">'; ?><?php echo $this->_tpl_vars['lang']['booking_additionals']; ?><?php echo '</span><span class="right"></span>'; ?>
</a>
	<?php endif; ?>

	<?php if ($_GET['mode'] != 'booking_colors'): ?>
	<a href="<?php echo $this->_tpl_vars['rlBaseC']; ?>
mode=booking_colors" class="button_bar"><span class="left"></span><?php echo '<span class="center_list">'; ?><?php echo $this->_tpl_vars['lang']['booking_colors']; ?><?php echo '</span><span class="right"></span>'; ?>
</a>
	<?php endif; ?>

	<?php if ($_GET['mode'] != 'booking_fields'): ?>
	<a href="<?php echo $this->_tpl_vars['rlBaseC']; ?>
mode=booking_fields" class="button_bar"><span class="left"></span><?php echo '<span class="center_list">'; ?><?php echo $this->_tpl_vars['lang']['booking_fields_list']; ?><?php echo '</span><span class="right"></span>'; ?>
</a>
	<?php endif; ?>

	<?php if ($_GET['mode']): ?>
	<a href="<?php echo ((is_array($_tmp=$this->_tpl_vars['rlBaseC'])) ? $this->_run_mod_handler('replace', true, $_tmp, '&amp;', '') : smarty_modifier_replace($_tmp, '&amp;', '')); ?>
" class="button_bar"><span class="left"></span><?php echo '<span class="center_list">'; ?><?php echo $this->_tpl_vars['lang']['booking_requests']; ?><?php echo '</span><span class="right"></span>'; ?>
</a>
	<?php endif; ?>
</div>

<div class="clear" style="*margin: -3px 0; *height: 1px;"></div>
<!-- navigation bar end -->

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

<?php if ($_GET['mode'] == 'booking_colors'): ?>

<?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']; ?>
mode=booking_colors" method="post">
	<input type="hidden" name="submit" value="1" />
	<table class="form">
	<tr>
		<td class="name"><?php echo $this->_tpl_vars['lang']['booking_admin_colors_day_select']; ?>
</td>
		<td class="field">
			<input type="hidden" name="b[xselect]" value="<?php echo $this->_tpl_vars['sPost']['b']['xselect']; ?>
" />
			<div class="colorSelector" id="colorSelector_xselect"><div style="background-color: <?php echo $this->_tpl_vars['sPost']['b']['xselect']; ?>
"></div></div>
		</td>
	</tr>
	<tr>
		<td class="name"><?php echo $this->_tpl_vars['lang']['booking_admin_colors_available']; ?>
</td>
		<td class="field">
			<input type="hidden" name="b[available]" value="<?php echo $this->_tpl_vars['sPost']['b']['available']; ?>
" />
			<input type="hidden" name="b[available_rgb]" value="<?php echo $this->_tpl_vars['sPost']['b']['available_rgb']; ?>
" />
			<div class="colorSelector" id="colorSelector_available"><div style="background-color: <?php echo $this->_tpl_vars['sPost']['b']['available']; ?>
"></div></div>
		</td>
	</tr>
	<tr>
		<td class="name"><?php echo $this->_tpl_vars['lang']['booking_admin_colors_booked']; ?>
</td>
		<td class="field">
			<input type="hidden" name="b[booked]" value="<?php echo $this->_tpl_vars['sPost']['b']['booked']; ?>
" />
			<input type="hidden" name="b[booked_rgb]" value="<?php echo $this->_tpl_vars['sPost']['b']['booked_rgb']; ?>
" />
			<div class="colorSelector" id="colorSelector_booked"><div style="background-color: <?php echo $this->_tpl_vars['sPost']['b']['booked']; ?>
"></div></div>
		</td>
	</tr>
	<tr>
		<td class="name"><?php echo $this->_tpl_vars['lang']['booking_admin_colors_requested']; ?>
</td>
		<td class="field">
			<input type="hidden" name="b[requested]" value="<?php echo $this->_tpl_vars['sPost']['b']['requested']; ?>
" />
			<input type="hidden" name="b[requested_rgb]" value="<?php echo $this->_tpl_vars['sPost']['b']['requested_rgb']; ?>
" />
			<div class="colorSelector" id="colorSelector_requested"><div style="background-color: <?php echo $this->_tpl_vars['sPost']['b']['requested']; ?>
"></div></div>
		</td>
	</tr>
	<tr>
		<td class="name"><?php echo $this->_tpl_vars['lang']['booking_admin_colors_closed']; ?>
</td>
		<td class="field">
			<input type="hidden" name="b[closed]" value="<?php echo $this->_tpl_vars['sPost']['b']['closed']; ?>
" />
			<input type="hidden" name="b[closed_rgb]" value="<?php echo $this->_tpl_vars['sPost']['b']['closed_rgb']; ?>
" />
			<div class="colorSelector" id="colorSelector_closed"><div style="background-color: <?php echo $this->_tpl_vars['sPost']['b']['closed']; ?>
"></div></div>
		</td>
	</tr>

	<tr>
		<td></td>
		<td class="field">
			<input type="submit" value="<?php echo $this->_tpl_vars['lang']['save']; ?>
" />
		</td>
	</tr>
	</table>
</form>

<script type="text/javascript">//<![CDATA[
<?php echo '
	$(document).ready(function() {
		function addColorPicker(step) {
			$(\'#colorSelector_\'+ step).ColorPicker({
				color: $(\'input[name="b[\'+ step +\']"]\').val(),
				onShow: function(colpkr) {
					$(colpkr).fadeIn(500);
					return false;
				},
				onHide: function(colpkr) {
					$(colpkr).fadeOut(500);
					return false;
				},
				onChange: function(hsb, hex, rgb) {
					$(\'#colorSelector_\'+ step +\' div\').css(\'backgroundColor\', \'#\'+ hex);
					$(\'#colorSelector_\'+ step).parent().find(\'input[name="b[\'+ step +\']"]\').val(\'#\'+ hex);
					$(\'input[name="b[\'+ step +\'_rgb]"]\').val(rgb.r+ \',\'+ rgb.g +\',\'+ rgb.b);
				}
			});
		}

		addColorPicker(\'xselect\');
		addColorPicker(\'available\');
		addColorPicker(\'booked\');
		addColorPicker(\'requested\');
		addColorPicker(\'closed\');
	});
'; ?>

//]]>
</script>
<?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);
 ?>

<?php elseif ($_GET['mode'] == 'booking_fields'): ?>

    <?php if (isset ( $_GET['action'] )): ?>
    <?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);
 ?>
    <?php $this->assign('sPost', $_POST); ?>

    <!-- add new field -->
    <form action="<?php echo $this->_tpl_vars['rlBaseC']; ?>
mode=booking_fields&action=<?php if ($_GET['action'] == 'add'): ?>add<?php elseif ($_GET['action'] == 'edit'): ?>edit&amp;field=<?php echo $_GET['field']; ?>
<?php endif; ?>" method="post">
    <input type="hidden" name="submit" value="1" />
    <?php if ($_GET['action'] == 'edit'): ?>
	    <input type="hidden" name="fromPost" value="1" />
    <?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<?php endif; ?> class="<?php if ($_GET['action'] == 'edit'): ?>disabled<?php else: ?>text<?php endif; ?> lang_add" 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>

    <tr>
		<td class="name"><?php echo $this->_tpl_vars['lang']['description']; ?>
</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; ?>
				<textarea rows="" cols="" name="description[<?php echo $this->_tpl_vars['language']['Code']; ?>
]"><?php echo $this->_tpl_vars['sPost']['description'][$this->_tpl_vars['language']['Code']]; ?>
</textarea>
				<?php if (count($this->_tpl_vars['allLangs']) > 1): ?></div><?php endif; ?>
			<?php endforeach; endif; unset($_from); ?>
		</td>
	</tr>

	<tr>
		<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['required_field']; ?>
</td>
		<td class="field">
			<?php if ($this->_tpl_vars['sPost']['required'] == '1'): ?>
				<?php $this->assign('required_yes', 'checked'); ?>
			<?php elseif ($this->_tpl_vars['sPost']['required'] == '0'): ?>
				<?php $this->assign('required_no', 'checked'); ?>
			<?php else: ?>
				<?php $this->assign('required_no', 'checked'); ?>
			<?php endif; ?>
			<input <?php echo $this->_tpl_vars['required_yes']; ?>
 class="lang_add" type="radio" id="req_yes" name="required" value="1" /> <label for="req_yes"><?php echo $this->_tpl_vars['lang']['yes']; ?>
</label>
			<input <?php echo $this->_tpl_vars['required_no']; ?>
 class="lang_add" type="radio" id="req_no" name="required" value="0" /> <label for="req_no"><?php echo $this->_tpl_vars['lang']['no']; ?>
</label>
		</td>
	</tr>

	<tr>
		<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['status']; ?>
</td>
		<td class="field">
			<select name="status" class="login_input_select lang_add">
				<option value="active" <?php if ($this->_tpl_vars['sPost']['status'] == 'active'): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['lang']['active']; ?>
</option>
				<option value="approval" <?php if ($this->_tpl_vars['sPost']['status'] == 'approval'): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['lang']['approval']; ?>
</option>
			</select>
		</td>
	</tr>

    <tr>
		<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['field_type']; ?>
</td>
		<td class="field">
			<select <?php if ($_GET['action'] == 'edit'): ?>disabled<?php endif; ?> onchange="field_types(this.value);" name="type" class="login_input_select lang_add <?php if ($_GET['action'] == 'edit'): ?>disabled<?php endif; ?>">
				<option value=""><?php echo $this->_tpl_vars['lang']['select_field_type']; ?>
</option>
				<?php $_from = $this->_tpl_vars['b_types']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['bType']):
?>
				<option <?php if ($this->_tpl_vars['sPost']['type'] == $this->_tpl_vars['key']): ?>selected<?php endif; ?> value="<?php echo $this->_tpl_vars['key']; ?>
"><?php echo $this->_tpl_vars['bType']; ?>
</option>
				<?php endforeach; endif; unset($_from); ?>
			</select>
			<?php if ($_GET['action'] == 'edit'): ?>
			<input type="hidden" name="type" value="<?php echo $this->_tpl_vars['sPost']['type']; ?>
" />
			<?php endif; ?>
		</td>
	</tr>
	</table>

	<!-- additional options -->
	<div id="additional_options">

    <script type="text/javascript">//<![CDATA[
		var langs_list = Array(
			<?php $_from = $this->_tpl_vars['allLangs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['lF'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['lF']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['languages']):
        $this->_foreach['lF']['iteration']++;
?>
			'<?php echo $this->_tpl_vars['languages']['Code']; ?>
|<?php echo $this->_tpl_vars['languages']['name']; ?>
'<?php if (! ($this->_foreach['lF']['iteration'] == $this->_foreach['lF']['total'])): ?>,<?php endif; ?>
			<?php endforeach; endif; unset($_from); ?>
		);
	//]]>
	</script>

	<!-- text field -->
	<?php $this->assign('textDefault', $this->_tpl_vars['sPost']['text']['default']); ?>
	<div id="field_text" class="hide">
	<table class="form">
	<tr>
		<td class="name"><?php echo $this->_tpl_vars['lang']['default_value']; ?>
</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="text[default][<?php echo $this->_tpl_vars['language']['Code']; ?>
]" value="<?php echo $this->_tpl_vars['textDefault'][$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 $this->assign('text_cond', $this->_tpl_vars['sPost']['text']); ?>
    <tr>
		<td class="name"><?php echo $this->_tpl_vars['lang']['check_condition']; ?>
</td>
		<td class="field">
		    <select class="lang_add" name="text[condition]">
				<option value="">- <?php echo $this->_tpl_vars['lang']['condition']; ?>
 -</option>
				<?php $_from = $this->_tpl_vars['l_cond']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['cKey'] => $this->_tpl_vars['condition']):
?>
				<option <?php if ($this->_tpl_vars['text_cond']['condition'] == $this->_tpl_vars['cKey']): ?>selected<?php endif; ?> value="<?php echo $this->_tpl_vars['cKey']; ?>
"><?php echo $this->_tpl_vars['condition']; ?>
</option>
				<?php endforeach; endif; unset($_from); ?>
		    </select>
		</td>
	</tr>

	<tr>
		<td class="name"><?php echo $this->_tpl_vars['lang']['maxlength']; ?>
</td>
		<td class="field">
		    <input class="text lang_add numeric" name="text[maxlength]" type="text" style="width: 50px; text-align: center;" value="<?php echo $this->_tpl_vars['sPost']['text']['maxlength']; ?>
" maxlength="3" />
			<span class="field_description"><?php echo $this->_tpl_vars['lang']['default_text_value_des']; ?>
</span>
		</td>
	</tr>
	</table>
	</div>
	<!-- text field end -->

	<!-- textarea field -->
	<?php $this->assign('textarea', $this->_tpl_vars['sPost']['textarea']); ?>
	<div id="field_textarea" class="hide">
		<table class="form">
		<tr>
			<td class="name"><?php echo $this->_tpl_vars['lang']['maxlength']; ?>
</td>
			<td class="field">
				<input class="text lang_add numeric" name="textarea[maxlength]" type="text" style="width: 50px; text-align: center;" value="<?php echo $this->_tpl_vars['textarea']['maxlength']; ?>
" maxlength="4" />
				<span class="field_description"><?php echo $this->_tpl_vars['lang']['default_textarea_value_des']; ?>
</span>
			</td>
		</tr>
	</table>
	</div>
	<!-- textarea field end -->

	<!-- number field -->
	<?php $this->assign('number', $this->_tpl_vars['sPost']['number']); ?>
	<div id="field_number" class="hide">
		<table class="form">
		<tr>
			<td class="name"><?php echo $this->_tpl_vars['lang']['maxlength']; ?>
</td>
			<td class="field">
				<input class="numeric" name="number[max_length]" type="text" style="width: 60px; text-align: center;" value="<?php echo $this->_tpl_vars['number']['max_length']; ?>
" maxlength="8" />
				<span class="field_description"><?php echo $this->_tpl_vars['lang']['number_field_length_hint']; ?>
</span>
			</td>
		</tr>
		</table>
	</div>
	<!-- number field end -->

	</div>
	<!-- additional options end -->

	<!-- additional JS -->
	<?php if ($this->_tpl_vars['sPost']['type'] != false): ?>
	<script type="text/javascript">//<![CDATA[
		field_types('<?php echo $this->_tpl_vars['sPost']['type']; ?>
');
	//]]>
	</script>
	<?php endif; ?>
	<!-- additional JS end -->

    <table class="sTable">
    <tr>
	<td style="width: 180px"></td>
	<td>
	    <input class="button lang_add" 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>
    <!-- add new field end -->
	<?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);
 ?>
    <?php else: ?>

	<div id="grid"></div>
	<script type="text/javascript">//<![CDATA[
	<?php echo '
	$(document).ready(function() {

		bookingFields = new gridObj({
			key: \'bookingFields\',
			id: \'grid\',
			ajaxUrl: rlPlugins + \'booking/admin/booking.inc.php?q=ext\',
			defaultSortField: false,
			title: lang[\'booking_fields_manager\'],
			fields: [
				{name: \'name\', mapping: \'name\', type: \'string\'},
				{name: \'Type\', mapping: \'Type\'},
				{name: \'Required\', mapping: \'Required\'},
				{name: \'Position\', mapping: \'Position\', type: \'int\'},
				{name: \'Status\', mapping: \'Status\'},
				{name: \'Key\', mapping: \'Key\'}
			],
			columns: [
				{
					header: lang[\'ext_name\'],
					dataIndex: \'name\',
					width: 60,
					id: \'rlExt_item_bold\'
				},{
					id: \'rlExt_item\',
					header: lang[\'ext_type\'],
					dataIndex: \'Type\',
					width: 30
				},{
					header: lang[\'ext_required_field\'],
					dataIndex: \'Required\',
					width: 17,
					editor: new Ext.form.ComboBox({
						store: [
							[\'1\', lang[\'ext_yes\']],
							[\'0\', lang[\'ext_no\']]
						],
						displayField: \'value\',
						valueField: \'key\',
						emptyText: lang[\'ext_not_available\'],
						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_position\'],
					dataIndex: \'Position\',
					width: 10,
					editor: new Ext.form.TextField({
						allowBlank: 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: \'Key\',
					sortable: false,
					renderer: function(data) {
						var out = "<center>";
						out += "<img class=\'edit\' ext:qtip=\'"+lang[\'ext_edit\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' onClick=\'location.href=\\""+rlUrlHome+"index.php?controller="+controller+"&mode=booking_fields&action=edit&field="+data+"\\"\' />";
						out += "<img class=\'remove\' ext:qtip=\'"+lang[\'ext_delete\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' onClick=\'rlConfirm( \\""+lang[\'ext_notice_delete_field\']+"\\", \\"xajax_deleteLField\\", \\""+Array(data)+"\\", \\"field_load\\" )\' class=\'delete\' />";
						out += "</center>";
						return out;
					}
				}
			]
		});

		bookingFields.init();
		grid.push(bookingFields.grid);
	});

	'; ?>
//]]>
	</script>

    <?php endif; ?>

<?php elseif ($_GET['id']): ?>

	<?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);
 ?>
	<fieldset class="light">
		<legend id="legend_cats" class="up" onclick="fieldset_action('booking_page_details');"><?php echo $this->_tpl_vars['lang']['booking_page_details']; ?>
</legend>
		<div id="booking_page_details">
			<table class="form">
			<?php if (! empty ( $this->_tpl_vars['requests']['ref_number'] )): ?>
			<tr>
				<td class="name"><?php echo $this->_tpl_vars['lang']['booking_ref_number']; ?>
:</td>
				<td class="field"><?php echo $this->_tpl_vars['requests']['ref_number']; ?>
</td>
			</tr>
			<?php endif; ?>
			<tr>
				<td class="name"><?php echo $this->_tpl_vars['lang']['booking_checkin']; ?>
:</td>
				<td class="field"><?php echo ((is_array($_tmp=$this->_tpl_vars['requests']['From'])) ? $this->_run_mod_handler('date_format', true, $_tmp, @RL_DATE_FORMAT) : smarty_modifier_date_format($_tmp, @RL_DATE_FORMAT)); ?>
</td>
			</tr>
			<tr>
				<td class="name"><?php echo $this->_tpl_vars['lang']['booking_checkout']; ?>
:</td>
				<td class="field"><?php echo ((is_array($_tmp=$this->_tpl_vars['requests']['To'])) ? $this->_run_mod_handler('date_format', true, $_tmp, @RL_DATE_FORMAT) : smarty_modifier_date_format($_tmp, @RL_DATE_FORMAT)); ?>
</td>
			</tr>
			<tr>
				<td class="name"><?php echo $this->_tpl_vars['lang']['booking_req_status']; ?>
:</td>
				<td class="field"><?php echo $this->_tpl_vars['requests']['Stat']; ?>
</td>
			</tr>
			<tr>
				<td class="name"><?php echo $this->_tpl_vars['lang']['booking_amount']; ?>
:</td>
				<td class="field"><?php echo $this->_tpl_vars['defPrice']['currency']; ?>
 <?php echo rlSmarty::str2money(array('string' => $this->_tpl_vars['requests']['Amount']), $this);?>
</td>
			</tr>
			</table>
		</div>
	</fieldset>

	<fieldset class="light">
		<legend id="legend_cats" class="up" onclick="fieldset_action('booking_client_details');"><?php echo $this->_tpl_vars['lang']['booking_client_details']; ?>
</legend>
		<div id="booking_client_details">
			<table class="form">
			<?php $_from = $this->_tpl_vars['requests']['fields']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['fKey'] => $this->_tpl_vars['field']):
?>
			<?php $this->assign('field_value', $this->_tpl_vars['field']['value']); ?>

			<?php if ($this->_tpl_vars['field']['Type'] == 'bool'): ?>
				<?php if ($this->_tpl_vars['field']['value'] == '1'): ?>
					<?php $this->assign('field_value', $this->_tpl_vars['lang']['yes']); ?>
				<?php else: ?>
					<?php $this->assign('field_value', $this->_tpl_vars['lang']['no']); ?>
				<?php endif; ?>
			<?php endif; ?>

			<tr>
				<td class="name"><?php echo $this->_tpl_vars['field']['name']; ?>
:</td>
				<td class="field">
					<?php if ($this->_tpl_vars['field']['Condition'] == 'isUrl'): ?>
						<a href="<?php echo $this->_tpl_vars['field_value']; ?>
" title="<?php echo $this->_tpl_vars['field_value']; ?>
"><?php echo $this->_tpl_vars['field_value']; ?>
</a>
					<?php else: ?>
						<?php echo $this->_tpl_vars['field_value']; ?>

					<?php endif; ?>
				</td>
			</tr>
			<?php endforeach; endif; unset($_from); ?>
			</table>
		</div>
	</fieldset>
	<?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);
 ?>

<?php elseif ($_GET['mode'] == 'ranges'): ?>

	<?php if (! isset ( $_GET['listing_id'] )): ?>

	<div id="grid"></div>
	<script type="text/javascript">//<![CDATA[
	var binding_days = <?php echo $this->_tpl_vars['config']['booking_bind_checkin_checkout']; ?>
;

	<?php echo '
	$(document).ready(function() {

		bookingRateRanges = new gridObj({
			key: \'bookingRateRanges\',
			id: \'grid\',
			ajaxUrl: rlPlugins + \'booking/admin/booking.inc.php?q=ext_ranges\',
			defaultSortField: false,
			title: \''; ?>
<?php echo $this->_tpl_vars['lang']['ext_listing_rate_range_manager']; ?>
<?php echo '\',
			fields: [
				{name: \'ID\', mapping: \'ID\'},
				{name: \'ref\', mapping: \'ref\'},
				{name: \'title\', mapping: \'title\', type: \'string\'}
			],
			columns: [
				{
					header: lang[\'ext_id\'],
					dataIndex: \'ID\',
					width: 40,
					fixed: true
				},{
					header: lang[\'ext_ref_number\'],
					dataIndex: \'ref\',
					hidden: '; ?>
<?php if ($this->_tpl_vars['refExists']): ?>false<?php else: ?>true<?php endif; ?><?php echo ',
					width: 5
				},{
					header: lang[\'ext_booking_listing_title\'],
					dataIndex: \'title\',
					width: 60,
					id: \'rlExt_item_bold\'
				},{
					header: lang[\'ext_actions\'],
					width: 100,
					fixed: true,
					dataIndex: \'ID\',
					sortable: false,
					renderer: function(data) {
						var out = "<center>";

						out += "<img class=\'view\' ext:qtip=\'"+lang[\'ext_booking_rate_ranges\']+"\' src=\'"+rlPlugins+"booking/img/ranges.png\' onClick=\'location.href=\\""+rlUrlHome+"index.php?controller="+controller+"&mode=ranges&view=rate_range&listing_id="+data+"\\"\' />";
						if ( binding_days ) {
							out += "<img class=\'view\' ext:qtip=\'"+lang[\'ext_booking_binding_days\']+"\' src=\'"+rlPlugins+"booking/img/bindings.png\' onClick=\'location.href=\\""+rlUrlHome+"index.php?controller="+controller+"&mode=ranges&view=binding_days&listing_id="+data+"\\"\' />";
						}
						out += "</center>";

						return out;
					}
				}
			]
		});

		bookingRateRanges.init();
		grid.push(bookingRateRanges.grid);
	});

	'; ?>
//]]>
	</script>

	<?php else: ?>

		<script type="text/javascript" src="<?php echo @RL_PLUGINS_URL; ?>
booking/js/jquery.form.js"></script>
		<script type="text/javascript">
			var listing_id = parseInt('<?php echo $_GET['listing_id']; ?>
');
		</script>

		<?php if ($_GET['view'] == 'rate_range'): ?>

		<div id="ranges_action_add" class="hide">
		<?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('block_caption' => $this->_tpl_vars['lang']['add_item'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
		<form id="ranges_form" onsubmit="addItem();$('input[name=item_submit]').val('<?php echo $this->_tpl_vars['lang']['loading']; ?>
');return false;" action="#" method="post">
			<table class="form">
			<tr>
				<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['from']; ?>
</td>
				<td class="field">
					<input type="text" name="date_from" id="date_from" style="width: 100px;" maxlength="10" />
				</td>
			</tr>
			<tr>
				<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['to']; ?>
</td>
				<td class="field">
					<input type="text" name="date_to" id="date_to" style="width: 100px;" maxlength="10" />
				</td>
			</tr>
			<tr>
				<td class="name"><span class="red">*</span><?php echo $this->_tpl_vars['lang']['price']; ?>
</td>
				<td class="field">
					<input type="text" name="price" class="numeric" style="width: 125px;" />
				</td>
			</tr>
			<tr>
				<td class="name"><?php echo $this->_tpl_vars['lang']['description']; ?>
</td>
				<td class="field">
					<textarea name="desc" rows="3" style="height: auto;" cols=""></textarea>
				</td>
			</tr>
			<tr>
				<td></td>
				<td class="field">
					<input type="submit" name="item_submit" value="<?php echo $this->_tpl_vars['lang']['add']; ?>
" />
					<a onclick="$('#ranges_action_add').slideUp('normal');$('#ranges_form').resetForm();" href="javascript:void(0)" class="cancel"><?php echo $this->_tpl_vars['lang']['close']; ?>
</a>
				</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);
 ?>
		</div>

		<div id="grid"></div>
		<script type="text/javascript">//<![CDATA[
		var binding_days = <?php echo $this->_tpl_vars['config']['booking_bind_checkin_checkout']; ?>
;

		<?php echo '
		$(document).ready(function() {

			bookingRateRangesList = new gridObj({
				key: \'bookingRateRanges\',
				id: \'grid\',
				ajaxUrl: rlPlugins + \'booking/admin/booking.inc.php?q=ext_ranges_list&id=\'+ listing_id,
				defaultSortField: false,
				title: \''; ?>
<?php echo $this->_tpl_vars['lang']['booking_rate_range']; ?>
<?php echo '\',
				fields: [
					{name: \'ID\', mapping: \'ID\'},
					{name: \'From\', mapping: \'From\', type: \'date\', dateFormat: \'timestamp\'},
					{name: \'To\', mapping: \'To\', type: \'date\', dateFormat: \'timestamp\'},
					{name: \'Price\', mapping: \'Price\', type: \'string\'},
					{name: \'desc\', mapping: \'desc\', type: \'string\'}
				],
				columns: [
					{
						header: "From",
						dataIndex: \'From\',
						width: 40,
						renderer: Ext.util.Format.dateRenderer(rlDateFormat.replace(/%/g, \'\').replace(\'b\', \'M\'))
					},{
						header: "To",
						dataIndex: \'To\',
						width: 40,
						renderer: Ext.util.Format.dateRenderer(rlDateFormat.replace(/%/g, \'\').replace(\'b\', \'M\'))
					},{
						header: "Price",
						dataIndex: \'Price\',
						width: 40
					},{
						header: "Description",
						dataIndex: \'desc\',
						width: 130
					},{
						header: lang[\'ext_actions\'],
						width: 70,
						fixed: true,
						dataIndex: \'ID\',
						sortable: false,
						renderer: function(data) {
							var out = "<center>";
							out += "<img class=\'remove\' ext:qtip=\'"+lang[\'ext_delete\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' onClick=\'rlConfirm(\\"'; ?>
<?php echo $this->_tpl_vars['lang']['booking_remove_confirm']; ?>
<?php echo '\\", \\"xajax_deleteRateRange\\", \\""+ [data, 1] +"\\", \\"field_load\\", \\"smarty\\" )\' class=\'delete\' />";
							out += "</center>";
							return out;
						}
					}
				]
			});

			bookingRateRangesList.init();
			grid.push(bookingRateRangesList.grid);

			//
			var dates = $(\'#date_from, #date_to\').datepicker({
				showOn: \'both\',
				buttonImage: \''; ?>
<?php echo $this->_tpl_vars['rlTplBase']; ?>
<?php echo 'img/blank.gif\',
				buttonImageOnly: true,
				dateFormat: \'dd-mm-yy\',
				minDate: new Date(),
				onSelect: function(selectedDate) {
					if ( this.id == "date_from" ) {
						var instance = $(this).data("datepicker"),
						date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
						date.setDate(date.getDate() + 1);
						dates.not(this).datepicker("option", "minDate", date);

						var mMonth = date.getMonth() + 1;
						var mDay = date.getDate();
						mMonth = mMonth < 10 ? \'0\'+ mMonth : mMonth;
						mDay = mDay < 10 ? \'0\'+ mDay : mDay;

						$(\'#date_to\').val(mDay +\'-\'+ mMonth +\'-\'+ date.getFullYear());
					}
				}
			}).datepicker($.datepicker.regional[\''; ?>
<?php echo @RL_LANG_CODE; ?>
<?php echo '\']);
		});

		function addItem() {
			xajax_saveRateRange(listing_id, $(\'#ranges_form\').formToArray(), 1);
		}

		'; ?>
//]]>
		</script>

		<?php else: ?>
			<?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);
 ?>
			<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp=((is_array($_tmp=@RL_PLUGINS)) ? $this->_run_mod_handler('cat', true, $_tmp, 'booking') : smarty_modifier_cat($_tmp, 'booking')))) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'binding_days.tpl') : smarty_modifier_cat($_tmp, 'binding_days.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			<?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);
 ?>

			<script type="text/javascript">
			<?php echo '
				var bind_click = 0;
				function bind_edit() {
					if( bind_click == 0 ) {
						$(\'#bind_days_checkbox\').fadeIn();
						bind_click = 1;
					}
					else {
						$(\'#bind_days_checkbox\').fadeOut();
						bind_click = 0;
					}
				}

				function save_binding_days() {
					var formData = $(\'#binding_days_form\').formToArray();
					xajax_saveBindingDays(listing_id, formData);
				}
			'; ?>

			</script>
		<?php endif; ?>
	<?php endif; ?>
<?php elseif ($_GET['mode'] == 'additionals'): ?>
	<?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']; ?>
mode=additionals" method="post">
		<input type="hidden" name="submit" value="1" />

		<table class="form">
		<tr>
			<td class="name"><?php echo $this->_tpl_vars['lang']['booking_admin_price_field_devide_price']; ?>
</td>
			<td class="field">
				<select name="price_field">
					<?php $_from = $this->_tpl_vars['price_fields']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['field']):
?>
					<option value="<?php echo $this->_tpl_vars['field']['Key']; ?>
"<?php if ($this->_tpl_vars['field']['Key'] == $this->_tpl_vars['current_price_field']): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['field']['name']; ?>
</option>
					<?php endforeach; endif; unset($_from); ?>
				</select>
			</td>
		</tr>

		<?php if ($this->_tpl_vars['config']['booking_binding_plans']): ?>
		<tr>
			<td class="name"><?php echo $this->_tpl_vars['lang']['booking_admin_show_on_plans']; ?>
</td>
			<td class="field" id="pages_obj">
				<fieldset class="light">
					<?php $this->assign('plans_phrase', 'admin_controllers+name+listing_plans'); ?>
					<legend id="legend_pages" class="up" onclick="fieldset_action('pages');"><?php echo $this->_tpl_vars['lang'][$this->_tpl_vars['plans_phrase']]; ?>
</legend>
					<div id="pages">
						<div id="pages_cont">
							<?php $this->assign('bPlan', $this->_tpl_vars['sPost']['plan']); ?>
							<table class="sTable" style="margin-bottom: 15px;">
							<tr>
								<td valign="top">
								<?php $_from = $this->_tpl_vars['plans']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['sPlan'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['sPlan']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['plan']):
        $this->_foreach['sPlan']['iteration']++;
?>
								<div style="padding: 2px 8px;">
									<input class="checkbox" <?php if (in_array ( $this->_tpl_vars['plan']['ID'] , $this->_tpl_vars['sPost']['plan'] )): ?>checked="checked"<?php endif; ?> id="plan_<?php echo $this->_tpl_vars['plan']['ID']; ?>
" type="checkbox" name="plan[<?php echo $this->_tpl_vars['plan']['ID']; ?>
]" value="<?php echo $this->_tpl_vars['plan']['ID']; ?>
" /> 
									<label class="cLabel" for="plan_<?php echo $this->_tpl_vars['plan']['ID']; ?>
"><?php echo $this->_tpl_vars['plan']['name']; ?>
</label>
								</div>
								<?php $this->assign('perCol', ((is_array($_tmp=$this->_foreach['sPlan']['total']/3)) ? $this->_run_mod_handler('ceil', true, $_tmp) : ceil($_tmp))); ?>

								<?php if ($this->_foreach['sPlan']['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>
			</td>
		</tr>
		<?php endif; ?>

		<tr>
			<td class="name"><?php echo $this->_tpl_vars['lang']['booking_admin_rent_time_frame']; ?>
</td>
			<td class="field">
				<?php $this->assign('cur_time_frame', ((is_array($_tmp=$this->_tpl_vars['cur_rent_time_frame'])) ? $this->_run_mod_handler('unserialize', true, $_tmp) : unserialize($_tmp))); ?>

				<table class="form">
				<tr>
					<td class="name"><?php echo $this->_tpl_vars['lang']['booking_admin_rent_time_frame_per_day']; ?>
</td>
					<td class="field">
						<select name="time_frame[day]">
						<?php $_from = $this->_tpl_vars['rent_time_frame']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['time_frame']):
?>
							<option value="<?php echo $this->_tpl_vars['time_frame']['value']; ?>
"<?php if ($this->_tpl_vars['cur_time_frame']['day'] == $this->_tpl_vars['time_frame']['value']): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['time_frame']['name']; ?>
</option>
						<?php endforeach; endif; unset($_from); ?>
						</select>
					</td>
				</tr>
				<tr>
					<td class="name"><?php echo $this->_tpl_vars['lang']['booking_admin_rent_time_frame_per_week']; ?>
</td>
					<td class="field">
						<select name="time_frame[week]">
						<?php $_from = $this->_tpl_vars['rent_time_frame']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['time_frame']):
?>
							<option value="<?php echo $this->_tpl_vars['time_frame']['value']; ?>
"<?php if ($this->_tpl_vars['cur_time_frame']['week'] == $this->_tpl_vars['time_frame']['value']): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['time_frame']['name']; ?>
</option>
						<?php endforeach; endif; unset($_from); ?>
						</select>
					</td>
				</tr>
				<tr>
					<td class="name"><?php echo $this->_tpl_vars['lang']['booking_admin_rent_time_frame_per_month']; ?>
</td>
					<td class="field">
						<select name="time_frame[month]">
						<?php $_from = $this->_tpl_vars['rent_time_frame']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['time_frame']):
?>
							<option value="<?php echo $this->_tpl_vars['time_frame']['value']; ?>
"<?php if ($this->_tpl_vars['cur_time_frame']['month'] == $this->_tpl_vars['time_frame']['value']): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['time_frame']['name']; ?>
</option>
						<?php endforeach; endif; unset($_from); ?>
						</select>
					</td>
				</tr>
				<tr>
					<td class="name"><?php echo $this->_tpl_vars['lang']['booking_admin_rent_time_frame_per_year']; ?>
</td>
					<td class="field">
						<select name="time_frame[year]">
						<?php $_from = $this->_tpl_vars['rent_time_frame']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['time_frame']):
?>
							<option value="<?php echo $this->_tpl_vars['time_frame']['value']; ?>
"<?php if ($this->_tpl_vars['cur_time_frame']['year'] == $this->_tpl_vars['time_frame']['value']): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['time_frame']['name']; ?>
</option>
						<?php endforeach; endif; unset($_from); ?>
						</select>
					</td>
				</tr>
				</table>
			</td>
		</tr>

		<tr>
			<td></td>
			<td class="field">
				<input type="submit" value="<?php echo $this->_tpl_vars['lang']['save']; ?>
" />
			</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);
 ?>
<?php else: ?>

    <div id="grid"></div>
	<script type="text/javascript">//<![CDATA[
	<?php echo '
	$(document).ready(function() {

		bookingRequestsGrid = new gridObj({
			key: \'bookingRequests\',
			id: \'grid\',
			fieldID: \'Request_ID\',
			ajaxUrl: rlPlugins + \'booking/admin/booking.inc.php?q=ext_stat\',
			defaultSortField: false,
			title: \''; ?>
<?php echo $this->_tpl_vars['lang']['booking_requests']; ?>
<?php echo '\',
			fields: [
				{name: \'Listing_ID\', mapping: \'Listing_ID\'},
				{name: \'ref_number\', mapping: \'ref_number\'},
				{name: \'Listing_title\', mapping: \'Listing_title\', type: \'string\'},
				{name: \'Booking_status\', mapping: \'Booking_status\'},
				{name: \'Key\', mapping: \'Key\'},
				{name: \'Booking_client\', mapping: \'Booking_client\'},
				{name: \'Booking_from\', mapping: \'Booking_from\', type: \'date\', dateFormat: \'U\'},
				{name: \'Booking_to\', mapping: \'Booking_to\', type: \'date\', dateFormat: \'U\'},
				{name: \'Booking_ID\', mapping: \'Booking_ID\'},
				{name: \'Request_ID\', mapping: \'Request_ID\'}
			],
			columns: [
				{
					header: lang[\'ext_booking_listing_id\'],
					dataIndex: \'Listing_ID\',
					width: 7
				},{
					header: lang[\'ext_booking_listing_title\'],
					dataIndex: \'Listing_title\',
					width: 60,
					id: \'rlExt_item_bold\'
				},{
					header: lang[\'ext_booking_client\'],
					dataIndex: \'Booking_client\',
					width: 15
				},{
					header: lang[\'ext_booking_checkin\'],
					dataIndex: \'Booking_from\',
					width: 15,
					renderer: Ext.util.Format.dateRenderer(rlDateFormat.replace(/%/g, \'\').replace(\'b\', \'M\'))
				},{
					header: lang[\'ext_booking_checkout\'],
					dataIndex: \'Booking_to\',
					width: 15,
					renderer: Ext.util.Format.dateRenderer(rlDateFormat.replace(/%/g, \'\').replace(\'b\', \'M\'))
				},{
					header: lang[\'ext_status\'],
					dataIndex: \'Booking_status\',
					width: 15,
					editor: new Ext.form.ComboBox({
						store: [
							[\'process\', lang[\'ext_booking_process\']],
							[\'booked\', lang[\'ext_booking_booked\']],
							[\'refused\', lang[\'ext_booking_refused\']]
						],
						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_actions\'],
					width: 70,
					fixed: true,
					dataIndex: \'Request_ID\',
					sortable: false,
					renderer: function(data) {
						var out = "<center>";

						out += "<img class=\'view\' ext:qtip=\'"+lang[\'ext_view\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' onClick=\'location.href=\\""+rlUrlHome+"index.php?controller="+controller+"&action=view&id="+data+"\\"\' />";
						out += "<img class=\'remove\' ext:qtip=\'"+lang[\'ext_delete\']+"\' src=\'"+rlUrlHome+"img/blank.gif\' onClick=\'rlConfirm( \\""+lang[\'ext_booking_remove_notice_ap\']+"\\", \\"xajax_deleteRequest\\", \\""+Array(data)+"\\" )\' class=\'delete\' />";
						out += "</center>";

						return out;
					}
				}
			]
		});

		bookingRequestsGrid.init();
		grid.push(bookingRequestsGrid.grid);
	});

	'; ?>
//]]>
	</script>

<?php endif; ?>

<!-- booking system end -->