<?php /* Smarty version 2.6.26, created on 2020-07-25 05:42:15
         compiled from /home3/bargaip4/public_html/gevimmo/plugins/priceHistory/price_history.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'version_compare', '/home3/bargaip4/public_html/gevimmo/plugins/priceHistory/price_history.tpl', 2, false),array('modifier', 'strpos', '/home3/bargaip4/public_html/gevimmo/plugins/priceHistory/price_history.tpl', 9, false),array('modifier', 'count', '/home3/bargaip4/public_html/gevimmo/plugins/priceHistory/price_history.tpl', 13, false),array('modifier', 'date_format', '/home3/bargaip4/public_html/gevimmo/plugins/priceHistory/price_history.tpl', 30, false),)), $this); ?>
<?php if ($this->_tpl_vars['price_history']): ?>
<?php if (((is_array($_tmp=$this->_tpl_vars['config']['rl_version'])) ? $this->_run_mod_handler('version_compare', true, $_tmp, "4.5.1") : version_compare($_tmp, "4.5.1")) >= 0): ?>
    <?php $this->assign('old_tabs_version', false); ?>
<?php else: ?>
    <?php $this->assign('old_tabs_version', true); ?>
<?php endif; ?>
    
    <a href="javascript:void(0);" id="line_color" class="hide"></a>
    <ul class="tabs <?php if ($this->_tpl_vars['old_tabs_version']): ?>ph-tabs<?php endif; ?><?php if (((is_array($_tmp=$this->_tpl_vars['tpl_settings']['name'])) ? $this->_run_mod_handler('strpos', true, $_tmp, 'auto_main') : strpos($_tmp, 'auto_main')) === 0): ?> auto_main_tpl<?php endif; ?>">
        <li class="active <?php if ($this->_tpl_vars['old_tabs_version']): ?>overflowed<?php endif; ?>" id="tab_price_history_table" >
        <?php if ($this->_tpl_vars['old_tabs_version']): ?><?php echo $this->_tpl_vars['lang']['ph_table']; ?>
<?php else: ?><a href="#price_history_table" data-target="price_history_table"><?php echo $this->_tpl_vars['lang']['ph_table']; ?>
</a><?php endif; ?>
        </li>
        <?php if (count($this->_tpl_vars['price_history']) > 1): ?>
            <li class="<?php if ($this->_tpl_vars['old_tabs_version']): ?>overflowed<?php endif; ?>" id="tab_price_history_chart">
            <?php if ($this->_tpl_vars['old_tabs_version']): ?><?php echo $this->_tpl_vars['lang']['ph_chart']; ?>
<?php else: ?><a href="#price_history_chart" data-target="price_history_chart"><?php echo $this->_tpl_vars['lang']['ph_chart']; ?>
</a><?php endif; ?></li>
        <?php endif; ?>
    </ul>

    <!-- Price history table -->
    <div id="area_price_history_table">  
        <div class="list-table">
            <div class="header">
                <div class="first"><?php echo $this->_tpl_vars['lang']['date']; ?>
</div>
                <div><?php echo $this->_tpl_vars['lang']['ph_event']; ?>
</div>
                <div><?php echo $this->_tpl_vars['lang']['price']; ?>
</div>
                <?php if ($this->_tpl_vars['config']['ph_sqft_enable']): ?><div><?php echo $this->_tpl_vars['lang']['ph_sqft']; ?>
</div><?php endif; ?>
            </div>
            <?php $_from = $this->_tpl_vars['price_history']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
                <div class="row">
                     <div class="first"><?php echo ((is_array($_tmp=$this->_tpl_vars['item']['Date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, @RL_DATE_FORMAT) : smarty_modifier_date_format($_tmp, @RL_DATE_FORMAT)); ?>
</div>
                     <div><?php echo $this->_tpl_vars['item']['Event']; ?>
</div>
                     <div>
                            <?php echo $this->_tpl_vars['item']['Price_value']; ?>
 
                            <?php if ($this->_tpl_vars['item']['price_diff']): ?>
                                <span class='price-diff <?php echo $this->_tpl_vars['item']['price_diff_class']; ?>
'><?php echo $this->_tpl_vars['item']['precent_diff']; ?>
 %</span>
                            <?php endif; ?>
                     </div>
                     <?php if ($this->_tpl_vars['config']['ph_sqft_enable']): ?>
                        <div><?php echo $this->_tpl_vars['item']['square_feet_price']; ?>
</div>
                     <?php endif; ?>
                </div>
             <?php endforeach; endif; unset($_from); ?>
        </div>
    </div>
    <!-- Price history table end -->

    <!-- Price history chart -->
    <div id="area_price_history_chart" class="hide">
        <div id="chart"></div>
    </div>
    <!-- Price history chart end -->

    <script type="text/javascript">
        var date_range = [];
        var values_array  = [];
        var is_old =<?php if ($this->_tpl_vars['old_tabs_version']): ?>true<?php else: ?>false<?php endif; ?>;
        lang['sys_currency'] = '<?php echo $this->_tpl_vars['config']['system_currency']; ?>
'; 
        lang['system_currency_position'] = '<?php echo $this->_tpl_vars['config']['system_currency_position']; ?>
'; 
        <?php $_from = $this->_tpl_vars['price_history']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['ph_element'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['ph_element']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['item']):
        $this->_foreach['ph_element']['iteration']++;
?>
            date_range.push(new Date('<?php echo $this->_tpl_vars['item']['Date']; ?>
'));
            values_array.push(<?php echo $this->_tpl_vars['item']['Price']; ?>
);
        <?php endforeach; endif; unset($_from); ?>

        <?php echo '
          $(document).ready(function(){
            var price_history = new priceHistoryClass(date_range,values_array);
            price_history.tabsHandler(is_old);
          });
        '; ?>

    </script>
<?php else: ?>
    <?php echo $this->_tpl_vars['lang']['price_history_empty']; ?>

<?php endif; ?>