<?php /* Smarty version 3.1.27, created on 2019-03-09 16:15:06
         compiled from "/home/hyipsour/public_html/tmpl/buy_ads.tpl" */ ?>
<?php
/*%%SmartyHeaderCode:2752843425c83e68a051af5_90878772%%*/
if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '245da543bae220b515f82734c92ff71b8448400f' => 
    array (
      0 => '/home/hyipsour/public_html/tmpl/buy_ads.tpl',
      1 => 1534608042,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '2752843425c83e68a051af5_90878772',
  'variables' => 
  array (
    'discounts' => 0,
    'theme' => 0,
    'bads' => 0,
    'tid' => 0,
    'atype' => 0,
    'errors' => 0,
    'frm' => 0,
    'price' => 0,
    'p' => 0,
    'blistings' => 0,
    'l' => 0,
  ),
  'has_nocache_code' => false,
  'version' => '3.1.27',
  'unifunc' => 'content_5c83e68a21d6b7_59393139',
),false);
/*/%%SmartyHeaderCode%%*/
if ($_valid && !is_callable('content_5c83e68a21d6b7_59393139')) {
function content_5c83e68a21d6b7_59393139 ($_smarty_tpl) {
if (!is_callable('smarty_block_t')) require_once '/home/hyipsour/public_html/inc/libs/smarty3/plugins/block.t.php';
if (!is_callable('smarty_modifier_encurl')) require_once '/home/hyipsour/public_html/inc/libs/smarty3/plugins/modifier.encurl.php';

$_smarty_tpl->properties['nocache_hash'] = '2752843425c83e68a051af5_90878772';
echo $_smarty_tpl->getSubTemplate ("header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0);
?>


<?php echo '<script'; ?>
 type="text/javascript">
discounts = [
<?php if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['i'])) unset($_smarty_tpl->tpl_vars['smarty']->value['section']['i']);
$_smarty_tpl->tpl_vars['smarty']->value['section']['i']['loop'] = is_array($_loop=$_smarty_tpl->tpl_vars['discounts']->value) ? count($_loop) : max(0, (int) $_loop); unset($_loop);
$_smarty_tpl->tpl_vars['smarty']->value['section']['i']['name'] = 'i';
$_smarty_tpl->tpl_vars['smarty']->value['section']['i']['show'] = true;
$_smarty_tpl->tpl_vars['smarty']->value['section']['i']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['loop'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['i']['step'] = 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['i']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['loop']-1;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['i']['show']) {
    $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['loop'];
    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['i']['total'] == 0)
        $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['show'] = false;
} else
    $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['total'] = 0;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['i']['show']):

            for ($_smarty_tpl->tpl_vars['smarty']->value['section']['i']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['iteration'] = 1;
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['total'];
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['iteration']++):
$_smarty_tpl->tpl_vars['smarty']->value['section']['i']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['iteration'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['i']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['i']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['i']['first']      = ($_smarty_tpl->tpl_vars['smarty']->value['section']['i']['iteration'] == 1);
$_smarty_tpl->tpl_vars['smarty']->value['section']['i']['last']       = ($_smarty_tpl->tpl_vars['smarty']->value['section']['i']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['i']['total']);
?>
{"from":<?php echo $_smarty_tpl->tpl_vars['discounts']->value[$_smarty_tpl->getVariable('smarty')->value['section']['i']['index']]['from'];?>
, "to":<?php echo $_smarty_tpl->tpl_vars['discounts']->value[$_smarty_tpl->getVariable('smarty')->value['section']['i']['index']]['to'];?>
, "discount":<?php echo $_smarty_tpl->tpl_vars['discounts']->value[$_smarty_tpl->getVariable('smarty')->value['section']['i']['index']]['discount'];?>
}<?php if (!$_smarty_tpl->getVariable('smarty')->value['section']['i']['last']) {?>,<?php }?>
<?php endfor; endif; ?>
];

function chng_type(id) {
  mnu = document.getElementById('menu');
  for (i = 1; i < 200; i++) {
    obj = document.getElementById('at_li_'+i);
    if (obj) obj.className = '';
    obj = document.getElementById('form_'+i);
    if (obj) obj.style.display = 'none';
  }
  obj = document.getElementById('at_li_'+id);
  obj.className = 'active';
  obj = document.getElementById('form_'+id);
  obj.style.display = '';

  calc_price();
}

function chng_price(price, tid) {
  mnu = document.getElementById('menu_'+tid);
  for (i = 0; i < mnu.children.length; i++) {
    mnu.children[i].className = '';
  }
  obj = document.getElementById('pr_li_'+tid+'_'+price);
  obj.className = 'active';

  calc_price();
}

function calc_price() {
  type = _get_type();
  price = _calc_price(type);
  weeks = parseInt(document.getElementById('weeks_'+type).value);
  discount = _get_discount(weeks);
  if (discount > 0) price = price * ((100-discount)/100);

  obj = document.getElementById('tprice_'+type);
  if (obj) obj.innerHTML = price < 0 ? 0 : price;

  obj = document.getElementById('discount_'+type);
  if (obj) obj.innerHTML = discount;
}

function _get_type() {
  type = 0;
  mnu = document.getElementById('menu');
  inpts = mnu.getElementsByTagName('input');
  for (i = 0; i < inpts.length; i++) {
    if (inpts[i].checked) {
      type = inpts[i].value; break;
    }
  }
  return type;
}
function _calc_price(type) {
  price = 0;

  mnu = document.getElementById('menu_'+type);
  if (!mnu) {
    obj = document.getElementById('price_'+type);
    if (obj) price = obj.innerHTML;
  } else {
    custrd = document.getElementById('pr_rd_'+type+'_cust');
    if (custrd && custrd.checked) {
      pr = document.getElementById('pr_inp_'+type+'_cust');
      if (pr && !isNaN(pr.value)) {
        price = pr.value;
      }
    } else {
      inpts = mnu.getElementsByTagName('input')
      for (i = 0; i < inpts.length; i++) {
        if (inpts[i].checked) {
          price = inpts[i].value; break;
        }
      }
    }
  }
  if (price == 0) return -1;

  weeks = parseInt(document.getElementById('weeks_'+type).value);
  if (isNaN(weeks) || weeks < 1) return -2;

  return weeks * price;
}

function check_cust_price(type) {
   pr = document.getElementById('pr_inp_'+type+'_cust');
   price = pr.value;
   parr = pr.getAttribute('rel').split(/\|/);
   price_min = parr[0];
   price_inc = parr[1];

   if (isNaN(price)) {
     pr.value = price_min;
     pr.focus();
     return false;
   }
   if (price < price_min) {
     alert('Price can not be less $'+price_min);
     pr.value = price_min;
     pr.focus();
     calc_price();
     return false;
   }
   if (price_inc > 0 && (price - price_min)%price_inc != 0) {
     alert('Price should multiple $'+price_inc);
     pr.value = parseFloat(price_min) + Math.round((price - price_min)/price_inc)*price_inc;
     pr.focus();
     calc_price();
     return false;
   }

   return true;
}

function _get_discount(weeks) {
  discount = 0;
  for (i in discounts) {
    if (discounts[i].from <= weeks && (discounts[i].to >= weeks || discounts[i].to == 0)) {
      discount = discounts[i].discount;
    }
  }
  return discount;
}

function checkAds() {
  type = _get_type();
  if (!type) {
    alert('Please, select ads zone.');
    return false;
  }

  custrd = document.getElementById('pr_rd_'+type+'_cust');
  if (custrd && custrd.checked) {
   check_cust_price(type);
  }

  price = _calc_price(type);
  if (price == -1) {
    alert('Please, choose ad place');
    return false;
  }
  if (price == -2) {
    alert('Please, enter weeks period');
    return false;
  }

  f = document.forms['ads_'+type];                                                     
  if (f.url && !f.url.value.match(/^https?:\/\//)) {
     alert('Please, enter full destination URL');
     return false;
  }

  if (f.banner_url && f.banner_url.value != '' && !f.banner_url.value.match(/^https?:\/\//)) {
     alert('Please, enter your banner full URL (starts with http://)');
     return false;
  }

  if (f.banner_url && f.banner_url.value != '' && !f.banner_url.value.match(/^https?:\/\//)) {
     alert('Please, enter your banner full URL (starts with http://)');
     return false;
  }

  if (f.email && f.email.value != '') {
    status = checkEmail(f.email.value);

    if (status > 0) {
      if (status == 1)
  	    alert('Please, enter your E-mail address!');
      if (status == 2)
  	    alert('Please, enter a valid E-mail address!');
      return false;
    }
  }

  return true;
}
<?php echo '</script'; ?>
>


<h3><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Advertising<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</h3>
<div class="buy_ads">

<div class="menu_wrap clearfix">
<img src="<?php echo smarty_modifier_encurl(((string)$_smarty_tpl->tpl_vars['theme']->value)."images/buy_ads.png");?>
" width="150">
<ul class="menu" id="menu">
<?php
$_from = $_smarty_tpl->tpl_vars['bads']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$_smarty_tpl->tpl_vars['atype'] = new Smarty_Variable;
$_smarty_tpl->tpl_vars['atype']->_loop = false;
$_smarty_tpl->tpl_vars['tid'] = new Smarty_Variable;
foreach ($_from as $_smarty_tpl->tpl_vars['tid']->value => $_smarty_tpl->tpl_vars['atype']->value) {
$_smarty_tpl->tpl_vars['atype']->_loop = true;
$foreach_atype_Sav = $_smarty_tpl->tpl_vars['atype'];
?>
 <li id="at_li_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
"><input type="radio" name="tid" value="<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
" id="at_rd_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
" onclick="chng_type('<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
')"><label for="at_rd_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
"><b><?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
</b>. <?php echo $_smarty_tpl->tpl_vars['atype']->value['name'];?>
</label></li>
<?php
$_smarty_tpl->tpl_vars['atype'] = $foreach_atype_Sav;
}
?>
</ul>
</div>

<?php if ($_smarty_tpl->tpl_vars['errors']->value) {?>
<ul class="error">
<?php if ($_smarty_tpl->tpl_vars['errors']->value['place_busy']) {?><li> <?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Place is busy<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</li><?php }?>
<?php if ($_smarty_tpl->tpl_vars['errors']->value['invalid_type']) {?><li> <?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Please, choose correct ads type<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</li><?php }?>
<?php if ($_smarty_tpl->tpl_vars['errors']->value['no_available_places']) {?><li> <?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
No available places for this ads type<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</li><?php }?>
<?php if ($_smarty_tpl->tpl_vars['errors']->value['invalid_period']) {?><li> <?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Please, choose correct period<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</li><?php }?>
<?php if ($_smarty_tpl->tpl_vars['errors']->value['invalid_listing']) {?><li> <?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Please, select Program<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</li><?php }?>
</ul>
<?php }?>

<?php
$_from = $_smarty_tpl->tpl_vars['bads']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$_smarty_tpl->tpl_vars['atype'] = new Smarty_Variable;
$_smarty_tpl->tpl_vars['atype']->_loop = false;
$_smarty_tpl->tpl_vars['tid'] = new Smarty_Variable;
foreach ($_from as $_smarty_tpl->tpl_vars['tid']->value => $_smarty_tpl->tpl_vars['atype']->value) {
$_smarty_tpl->tpl_vars['atype']->_loop = true;
$foreach_atype_Sav = $_smarty_tpl->tpl_vars['atype'];
?>
<div class="<?php echo $_smarty_tpl->tpl_vars['atype']->value['type'];?>
" id="form_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
" style="display: none;">
<h3 id="title_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
"><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array('name'=>$_smarty_tpl->tpl_vars['atype']->value['name'])); $_block_repeat=true; echo smarty_block_t(array('name'=>$_smarty_tpl->tpl_vars['atype']->value['name']), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Buy %name<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array('name'=>$_smarty_tpl->tpl_vars['atype']->value['name']), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</h3>
<?php if ($_smarty_tpl->tpl_vars['atype']->value['exp_date']) {?>
<div class="message"><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array('exp_date'=>$_smarty_tpl->tpl_vars['atype']->value['exp_date'],'price'=>$_smarty_tpl->tpl_vars['atype']->value['exp_price'])); $_block_repeat=true; echo smarty_block_t(array('exp_date'=>$_smarty_tpl->tpl_vars['atype']->value['exp_date'],'price'=>$_smarty_tpl->tpl_vars['atype']->value['exp_price']), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Sorry, all ad places are currently busy.<br>The closest one will be available on <b>%exp_date</b> for <b>$%price</b>/week.<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array('exp_date'=>$_smarty_tpl->tpl_vars['atype']->value['exp_date'],'price'=>$_smarty_tpl->tpl_vars['atype']->value['exp_price']), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</div>
<?php } else { ?> 
<form name="ads_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
" method="post" onsubmit="return checkAds()" action="">
<input type="hidden" name="a" value="buy_ads">
<input type="hidden" name="action" value="preview">
<input type="hidden" name="tid" value="<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
">
<table class="form">
<tr>
 <th><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Available:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</th>
 <td><?php if ($_smarty_tpl->tpl_vars['atype']->value['max_ads'] > 0) {
$_smarty_tpl->smarty->_tag_stack[] = array('t', array('available'=>intval($_smarty_tpl->tpl_vars['atype']->value['available']),'max_ads'=>$_smarty_tpl->tpl_vars['atype']->value['max_ads'])); $_block_repeat=true; echo smarty_block_t(array('available'=>intval($_smarty_tpl->tpl_vars['atype']->value['available']),'max_ads'=>$_smarty_tpl->tpl_vars['atype']->value['max_ads']), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<b>%available</b> of <b>%max_ads</b><?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array('available'=>intval($_smarty_tpl->tpl_vars['atype']->value['available']),'max_ads'=>$_smarty_tpl->tpl_vars['atype']->value['max_ads']), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);
} else { ?><b><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Unlimited<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</b><?php }?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
ad places<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</td>
</tr>
<?php if ($_smarty_tpl->tpl_vars['atype']->value['type'] == 'rotating') {?>
<tr>
 <th><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Price:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</th>
 <td><b>$<span id="price_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['atype']->value['price'];?>
</span></b>/<?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
week<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</td>
</tr>
<?php } else { ?>
<tr>
 <th><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Ad Place:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</th>
 <td>
<ul class="menu" id="menu_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
">
<?php if ($_smarty_tpl->tpl_vars['atype']->value['max_ads'] == 0) {?>
 <li id="pr_li_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
_cust">
  <input type="radio" name="price" value="cust" id="pr_rd_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
_cust" <?php if ('cust' == $_smarty_tpl->tpl_vars['frm']->value['price']) {?>checked<?php }?> onclick="chng_price('cust', '<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
')">
  <label for="pr_rd_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
_cust" class="nosize">
   <?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Offer Price:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>

  </label>
  <input type="text" name="cprice" value="<?php echo (($tmp = @$_smarty_tpl->tpl_vars['frm']->value['cprice'])===null||$tmp==='' ? $_smarty_tpl->tpl_vars['atype']->value['price'] : $tmp);?>
" id="pr_inp_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
_cust" onblur="check_cust_price('<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
')" class="nosize" rel="<?php echo $_smarty_tpl->tpl_vars['atype']->value['price'];?>
|<?php echo $_smarty_tpl->tpl_vars['atype']->value['price_inc'];?>
">
 </li>
<?php }?>
<?php
$_from = $_smarty_tpl->tpl_vars['atype']->value['ads'];
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$_smarty_tpl->tpl_vars['p'] = new Smarty_Variable;
$_smarty_tpl->tpl_vars['p']->_loop = false;
$_smarty_tpl->tpl_vars['price'] = new Smarty_Variable;
foreach ($_from as $_smarty_tpl->tpl_vars['price']->value => $_smarty_tpl->tpl_vars['p']->value) {
$_smarty_tpl->tpl_vars['p']->_loop = true;
$foreach_p_Sav = $_smarty_tpl->tpl_vars['p'];
?>
 <li id="pr_li_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['price']->value;?>
">
<?php if ($_smarty_tpl->tpl_vars['p']->value['type'] == 'default') {?>
  <input type="radio" name="price" value="<?php echo $_smarty_tpl->tpl_vars['price']->value;?>
" id="pr_rd_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['price']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['price']->value == $_smarty_tpl->tpl_vars['frm']->value['price']) {?>checked<?php }?> onclick="chng_price('<?php echo $_smarty_tpl->tpl_vars['price']->value;?>
', '<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
')">
  <label for="pr_rd_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['price']->value;?>
">
   <?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array('price'=>$_smarty_tpl->tpl_vars['p']->value['price'])); $_block_repeat=true; echo smarty_block_t(array('price'=>$_smarty_tpl->tpl_vars['p']->value['price']), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Available now for <b>$%price</b>/week<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array('price'=>$_smarty_tpl->tpl_vars['p']->value['price']), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>

  </label>
<?php } else { ?>
  <label for="pr_rd_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['price']->value;?>
">
   <?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array('price'=>$_smarty_tpl->tpl_vars['p']->value['price'],'exp_date'=>$_smarty_tpl->tpl_vars['p']->value['exp_date'])); $_block_repeat=true; echo smarty_block_t(array('price'=>$_smarty_tpl->tpl_vars['p']->value['price'],'exp_date'=>$_smarty_tpl->tpl_vars['p']->value['exp_date']), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Available on <b>%exp_date</b> for <b>$%price</b>/week<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array('price'=>$_smarty_tpl->tpl_vars['p']->value['price'],'exp_date'=>$_smarty_tpl->tpl_vars['p']->value['exp_date']), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>

  </label>
<?php }?>
 </li>
<?php
$_smarty_tpl->tpl_vars['p'] = $foreach_p_Sav;
}
?>
</ul>
 </td>
</tr>
<?php }?>

<tr>
 <th><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Period:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</th>
 <td><input type="text" name="period" value="<?php echo (($tmp = @intval($_smarty_tpl->tpl_vars['frm']->value['period']))===null||$tmp==='' ? 1 : $tmp);?>
" style="width: 50px;" id="weeks_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
" onkeyup="calc_price()"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
weeks<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</td>
</tr>
<?php if ($_smarty_tpl->tpl_vars['discounts']->value) {?>
<tr>
 <th><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Discount:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</th>
 <td><b id="discount_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
">0</b>%</td>
</tr>
<?php }?>


<?php if ($_smarty_tpl->tpl_vars['atype']->value['type'] == 'listings') {?>

<tr>
 <th><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Program:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</th>
 <td>
  <select name="listing_id">
<?php
$_from = $_smarty_tpl->tpl_vars['blistings']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$_smarty_tpl->tpl_vars['l'] = new Smarty_Variable;
$_smarty_tpl->tpl_vars['l']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['l']->value) {
$_smarty_tpl->tpl_vars['l']->_loop = true;
$foreach_l_Sav = $_smarty_tpl->tpl_vars['l'];
?>
<option value="<?php echo $_smarty_tpl->tpl_vars['l']->value['id'];?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['l']->value['name'], ENT_QUOTES, 'UTF-8', true);?>
</option>
<?php
$_smarty_tpl->tpl_vars['l'] = $foreach_l_Sav;
}
?>
  </select>
 </td>
</tr>

<?php } else { ?> 

<tr>
 <th><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Destination URL:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</th>
 <td><input type="text" name="url" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['frm']->value['url'], ENT_QUOTES, 'UTF-8', true);?>
"></td>
</tr>
<tr>
 <th><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Banner URL:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</th>
 <td><input type="text" name="banner_url" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['frm']->value['banner_url'], ENT_QUOTES, 'UTF-8', true);?>
"></td>
</tr>
<tr>
 <th><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Titile:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</th>
 <td><input type="text" name="title" maxlength=80 value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['frm']->value['title'], ENT_QUOTES, 'UTF-8', true);?>
"></td>
</tr>
<tr>
 <th><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Text:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</th>
 <td><input type="text" name="text" maxlength=120 value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['frm']->value['text'], ENT_QUOTES, 'UTF-8', true);?>
"></td>
</tr>

<?php }?>  

<tr>
 <th><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Contact E-mail:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</th>
 <td><input type="text" name="email" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['frm']->value['email'], ENT_QUOTES, 'UTF-8', true);?>
"></td>
</tr>
<tr>
 <th><?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Total Price:<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</th>
 <td><b>$<span id="tprice_<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
"></span></b></td>
</tr>
<tr>
 <th></th>
 <td><input type=submit value="<?php $_smarty_tpl->smarty->_tag_stack[] = array('t', array()); $_block_repeat=true; echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Preview<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
"></td>
</tr>
</table>
</form>
<?php }?> 
</div>

<?php
$_smarty_tpl->tpl_vars['atype'] = $foreach_atype_Sav;
}
?>

</div> 

<?php if ($_smarty_tpl->tpl_vars['frm']->value['tid']) {?>
<?php echo '<script'; ?>
 type="text/javascript">
tid = parseInt('<?php echo intval($_smarty_tpl->tpl_vars['frm']->value['tid']);?>
');

if (obj = document.getElementById('at_rd_'+tid)) {
 obj.checked = true;
 chng_type(tid);
}

<?php echo '</script'; ?>
>
<?php }?>
<?php echo $_smarty_tpl->getSubTemplate ("footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0);

}
}
?>