<?php /* Smarty version 2.6.22, created on 2014-02-25 02:24:57
         compiled from D:/Program+Files/Ampps/www/zipmarket%5Capps%5Ccollections%5Cviews/view.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'nl2br', 'D:/Program Files/Ampps/www/zipmarket\\apps\\collections\\views/view.html', 24, false),array('modifier', 'url', 'D:/Program Files/Ampps/www/zipmarket\\apps\\collections\\views/view.html', 56, false),array('modifier', 'escape', 'D:/Program Files/Ampps/www/zipmarket\\apps\\collections\\views/view.html', 57, false),)), $this); ?>

  <div class="page-info">
    <div class="container">
      <div id="breadcrumbs">
        <a href='/' class="first">Home</a>\<a href="/collections">Collections</a>\</div>
         <h1 class="page-title"><?php echo $this->_tpl_vars['collection']['name']; ?>
</h1>
    </div>
  </div>
    <div id="content">
      <div class="container">
        <script><?php echo '
  marketplace.queue( function(){
    marketplace.initializers.itemList({
      ajaxPagination: true,
      layoutSwitcher: true
    });
  });'; ?>

</script>
        
<div class="content-l">
<?php if ($this->_tpl_vars['collection']['text'] != ''): ?>
  <div class="collection-header">
    <div class="collection-info">
     <?php echo ((is_array($_tmp=$this->_tpl_vars['collection']['text'])) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp)); ?>

    </div>
  </div>
  <hr />
<?php endif; ?>
  <div class="page-controls">
<form action="" class="sort-control" id="sort-by-form" method="get">
  <label for="sort_by" class="sort-control-label"><?php echo $this->_tpl_vars['lang']['order_by']; ?>
:</label>
				<select class="sort_select" id="sort_by" name="sort_by">
    			<option value="published_at"<?php if ($_GET['sort_by'] == 'published_at'): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['date']; ?>
</option>
					<option value="name"<?php if ($_GET['sort_by'] == 'name'): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['title']; ?>
</option>
					<option value="root_category"<?php if ($_GET['sort_by'] == 'root_category'): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['category']; ?>
</option>
					<option value="average_rating"<?php if ($_GET['sort_by'] == 'average_rating'): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['rating']; ?>
</option>
					<option value="sales_count"<?php if ($_GET['sort_by'] == 'sales_count'): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['sales']; ?>
</option>
					<option value="cost"<?php if ($_GET['sort_by'] == 'cost'): ?> selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['price']; ?>
</option>
				</select>
				<a href="javascript: void(0);" onclick="submitOrder(this);" title="" class="<?php if ($_GET['order'] == 'asc'): ?>asc<?php else: ?>desc<?php endif; ?>">
				<img src="/static/img/<?php if ($_GET['order'] == 'asc'): ?>asc<?php else: ?>desc<?php endif; ?>.png"  alt="" /></a>
	      <input id="order-type" name="order" type="hidden" value="<?php if ($_GET['order'] == 'asc'): ?>asc<?php else: ?>desc<?php endif; ?>" />
</form>
<div class="layout-switcher sort-control">
  <a href="#" class="layout-list sort-control-tooltip active" data-tooltip="List View"></a>
  <a href="#" class="layout-grid sort-control-tooltip" data-tooltip="Grid View"></a>
</div>

    <div class="pagination"><?php echo $this->_tpl_vars['paging']; ?>
</div>   
  </div>
    <?php if ($this->_tpl_vars['items']): ?>
      <ul class="item-list">
				<?php $_from = $this->_tpl_vars['items']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['i']):
        $this->_foreach['foo']['iteration']++;
?>
          <li class="source" >
  <div class="thumbnail">
    <a href="/<?php echo $this->_tpl_vars['langaugeURL']; ?>
items/<?php echo $this->_tpl_vars['i']['id']; ?>
/<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['name'])) ? $this->_run_mod_handler('url', true, $_tmp) : smarty_modifier_url($_tmp)); ?>
" onclick="">
          <img alt="<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" border="0" class="landscape-image-magnifier preload no_preview" data-item-author="توسط <?php echo $this->_tpl_vars['users'][$this->_tpl_vars['i']['user_id']]['username']; ?>
" data-item-category="<?php $_from = $this->_tpl_vars['i']['categories']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['e']):
?><?php $_from = $this->_tpl_vars['e']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['c']):
        $this->_foreach['foo']['iteration']++;
?><?php echo $this->_tpl_vars['categories'][$this->_tpl_vars['c']]['name']; ?>
 <?php if (! ($this->_foreach['foo']['iteration'] == $this->_foreach['foo']['total'])): ?> \ <?php endif; ?><?php endforeach; endif; unset($_from); ?><?php endforeach; endif; unset($_from); ?>" data-item-cost="<?php echo $this->_tpl_vars['currency']['symbol']; ?>
<?php echo $this->_tpl_vars['i']['price']; ?>
" data-item-name="<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" data-preview-height="" data-preview-url="<?php echo $this->_tpl_vars['data_server']; ?>
uploads/items/<?php echo $this->_tpl_vars['i']['id']; ?>
/preview.jpg" data-preview-width="" height="80" src="<?php echo $this->_tpl_vars['data_server']; ?>
uploads/items/<?php echo $this->_tpl_vars['i']['id']; ?>
/<?php echo $this->_tpl_vars['i']['thumbnail']; ?>
" title="<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" width="80" />
    </a>  
   </div>
  <div class="item-info">
    <h3>
      <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
items/<?php echo $this->_tpl_vars['i']['id']; ?>
/<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['name'])) ? $this->_run_mod_handler('url', true, $_tmp) : smarty_modifier_url($_tmp)); ?>
"><?php echo $this->_tpl_vars['i']['name']; ?>
</a>
    </h3>

    <span class="author">توسط</span>  <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
user/<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['i']['user_id']]['username']; ?>
/" class="author"><?php echo $this->_tpl_vars['users'][$this->_tpl_vars['i']['user_id']]['username']; ?>
</a>
	      <?php if (check_login_bool ( ) && $this->_tpl_vars['collection']['user_id'] == $_SESSION['user']['user_id']): ?>
 <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
collections/view/<?php echo $this->_tpl_vars['collection']['id']; ?>
/?delete=<?php echo $this->_tpl_vars['i']['id']; ?>
" title="Remove item from this collection" class="x-button" href="#"></a>
          <?php endif; ?>
      </div>

  <small class="meta">
      <span class="meta-categories">
	  
	  </span><br />
    </small>

  <div class="sale-info">
    <small class="sale-count"><?php echo $this->_tpl_vars['i']['sales']; ?>
 <?php echo $this->_tpl_vars['lang']['sales']; ?>
</small>
    <small class="price"><?php echo $this->_tpl_vars['i']['price']; ?>
 <?php echo $this->_tpl_vars['currency']['symbol']; ?>
</small>
    <div class="rating">
		<?php unset($this->_sections['foo']);
$this->_sections['foo']['name'] = 'foo';
$this->_sections['foo']['start'] = (int)1;
$this->_sections['foo']['loop'] = is_array($_loop=6) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['foo']['step'] = ((int)1) == 0 ? 1 : (int)1;
$this->_sections['foo']['show'] = true;
$this->_sections['foo']['max'] = $this->_sections['foo']['loop'];
if ($this->_sections['foo']['start'] < 0)
    $this->_sections['foo']['start'] = max($this->_sections['foo']['step'] > 0 ? 0 : -1, $this->_sections['foo']['loop'] + $this->_sections['foo']['start']);
else
    $this->_sections['foo']['start'] = min($this->_sections['foo']['start'], $this->_sections['foo']['step'] > 0 ? $this->_sections['foo']['loop'] : $this->_sections['foo']['loop']-1);
if ($this->_sections['foo']['show']) {
    $this->_sections['foo']['total'] = min(ceil(($this->_sections['foo']['step'] > 0 ? $this->_sections['foo']['loop'] - $this->_sections['foo']['start'] : $this->_sections['foo']['start']+1)/abs($this->_sections['foo']['step'])), $this->_sections['foo']['max']);
    if ($this->_sections['foo']['total'] == 0)
        $this->_sections['foo']['show'] = false;
} else
    $this->_sections['foo']['total'] = 0;
if ($this->_sections['foo']['show']):

            for ($this->_sections['foo']['index'] = $this->_sections['foo']['start'], $this->_sections['foo']['iteration'] = 1;
                 $this->_sections['foo']['iteration'] <= $this->_sections['foo']['total'];
                 $this->_sections['foo']['index'] += $this->_sections['foo']['step'], $this->_sections['foo']['iteration']++):
$this->_sections['foo']['rownum'] = $this->_sections['foo']['iteration'];
$this->_sections['foo']['index_prev'] = $this->_sections['foo']['index'] - $this->_sections['foo']['step'];
$this->_sections['foo']['index_next'] = $this->_sections['foo']['index'] + $this->_sections['foo']['step'];
$this->_sections['foo']['first']      = ($this->_sections['foo']['iteration'] == 1);
$this->_sections['foo']['last']       = ($this->_sections['foo']['iteration'] == $this->_sections['foo']['total']);
?>
<?php if ($this->_tpl_vars['i']['rating'] >= $this->_sections['foo']['index']): ?><img src="/static/img/star-on.png" alt="" /><?php else: ?><img src="/static/img/star-off.png" alt="" />
<?php endif; ?>
		<?php endfor; endif; ?>
    </div>

   </div>
</li>

	<?php endforeach; endif; unset($_from); ?>
		
 </ul>
 <?php else: ?>
    <div class="content-box" style="text-align:justify;line-height:22px;">
      مجموعه شما خالی است شما می توانید محصولات خود را به عنوان علاقه مندی ها در هر محصول به مجموعه دلخواه اضافه کنید .
      شما می توانید از  <a href="/top_sellers/">پر فروش ترین محصولات</a> هم استفاده کنید .
    </div>
  <?php endif; ?>
  <div class="pagination"><?php echo $this->_tpl_vars['paging']; ?>
</div>
</div>


<div class="sidebar-s sidebar-right">
  <div class="img-border img-max">
   <?php if ($this->_tpl_vars['collection']['photo'] != ''): ?> 
    <img alt="<?php echo ((is_array($_tmp=$this->_tpl_vars['collection']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" src="<?php echo $this->_tpl_vars['data_server']; ?>
uploads/collections/<?php echo $this->_tpl_vars['collection']['photo']; ?>
" />  
<?php else: ?>
    <img alt="<?php echo ((is_array($_tmp=$this->_tpl_vars['collection']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" src="<?php echo $this->_tpl_vars['data_server']; ?>
img/default-collection.jpg" />  
<?php endif; ?>
</div>
<?php if (check_login_bool ( )): ?>
<div class="rate_collection">
        <h4 class="decorator">امتیاز به این مجموعه</h4>
      <div id="rate_collection">
        <div class="rating-container">
		<?php if ($this->_tpl_vars['collection']['rate']): ?>
<?php unset($this->_sections['foo']);
$this->_sections['foo']['name'] = 'foo';
$this->_sections['foo']['start'] = (int)1;
$this->_sections['foo']['loop'] = is_array($_loop=6) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['foo']['step'] = ((int)1) == 0 ? 1 : (int)1;
$this->_sections['foo']['show'] = true;
$this->_sections['foo']['max'] = $this->_sections['foo']['loop'];
if ($this->_sections['foo']['start'] < 0)
    $this->_sections['foo']['start'] = max($this->_sections['foo']['step'] > 0 ? 0 : -1, $this->_sections['foo']['loop'] + $this->_sections['foo']['start']);
else
    $this->_sections['foo']['start'] = min($this->_sections['foo']['start'], $this->_sections['foo']['step'] > 0 ? $this->_sections['foo']['loop'] : $this->_sections['foo']['loop']-1);
if ($this->_sections['foo']['show']) {
    $this->_sections['foo']['total'] = min(ceil(($this->_sections['foo']['step'] > 0 ? $this->_sections['foo']['loop'] - $this->_sections['foo']['start'] : $this->_sections['foo']['start']+1)/abs($this->_sections['foo']['step'])), $this->_sections['foo']['max']);
    if ($this->_sections['foo']['total'] == 0)
        $this->_sections['foo']['show'] = false;
} else
    $this->_sections['foo']['total'] = 0;
if ($this->_sections['foo']['show']):

            for ($this->_sections['foo']['index'] = $this->_sections['foo']['start'], $this->_sections['foo']['iteration'] = 1;
                 $this->_sections['foo']['iteration'] <= $this->_sections['foo']['total'];
                 $this->_sections['foo']['index'] += $this->_sections['foo']['step'], $this->_sections['foo']['iteration']++):
$this->_sections['foo']['rownum'] = $this->_sections['foo']['iteration'];
$this->_sections['foo']['index_prev'] = $this->_sections['foo']['index'] - $this->_sections['foo']['step'];
$this->_sections['foo']['index_next'] = $this->_sections['foo']['index'] + $this->_sections['foo']['step'];
$this->_sections['foo']['first']      = ($this->_sections['foo']['iteration'] == 1);
$this->_sections['foo']['last']       = ($this->_sections['foo']['iteration'] == $this->_sections['foo']['total']);
?>
<?php if ($this->_tpl_vars['collection']['rate']['rate'] >= $this->_sections['foo']['index']): ?><img src="/static/img/star-on.png" alt="" class="left" /><?php else: ?><img src="/static/img/star-off.png" alt="" class="left" />
<?php endif; ?>								  
<?php endfor; endif; ?>
<br>
		<?php else: ?>
    <div id="stars_div_<?php echo $this->_tpl_vars['collection']['id']; ?>
" class="stars" data-star-set-id="<?php echo $this->_tpl_vars['collection']['id']; ?>
_star" data-rating="0">
     <?php unset($this->_sections['foo']);
$this->_sections['foo']['name'] = 'foo';
$this->_sections['foo']['start'] = (int)1;
$this->_sections['foo']['loop'] = is_array($_loop=6) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['foo']['step'] = ((int)1) == 0 ? 1 : (int)1;
$this->_sections['foo']['show'] = true;
$this->_sections['foo']['max'] = $this->_sections['foo']['loop'];
if ($this->_sections['foo']['start'] < 0)
    $this->_sections['foo']['start'] = max($this->_sections['foo']['step'] > 0 ? 0 : -1, $this->_sections['foo']['loop'] + $this->_sections['foo']['start']);
else
    $this->_sections['foo']['start'] = min($this->_sections['foo']['start'], $this->_sections['foo']['step'] > 0 ? $this->_sections['foo']['loop'] : $this->_sections['foo']['loop']-1);
if ($this->_sections['foo']['show']) {
    $this->_sections['foo']['total'] = min(ceil(($this->_sections['foo']['step'] > 0 ? $this->_sections['foo']['loop'] - $this->_sections['foo']['start'] : $this->_sections['foo']['start']+1)/abs($this->_sections['foo']['step'])), $this->_sections['foo']['max']);
    if ($this->_sections['foo']['total'] == 0)
        $this->_sections['foo']['show'] = false;
} else
    $this->_sections['foo']['total'] = 0;
if ($this->_sections['foo']['show']):

            for ($this->_sections['foo']['index'] = $this->_sections['foo']['start'], $this->_sections['foo']['iteration'] = 1;
                 $this->_sections['foo']['iteration'] <= $this->_sections['foo']['total'];
                 $this->_sections['foo']['index'] += $this->_sections['foo']['step'], $this->_sections['foo']['iteration']++):
$this->_sections['foo']['rownum'] = $this->_sections['foo']['iteration'];
$this->_sections['foo']['index_prev'] = $this->_sections['foo']['index'] - $this->_sections['foo']['step'];
$this->_sections['foo']['index_next'] = $this->_sections['foo']['index'] + $this->_sections['foo']['step'];
$this->_sections['foo']['first']      = ($this->_sections['foo']['iteration'] == 1);
$this->_sections['foo']['last']       = ($this->_sections['foo']['iteration'] == $this->_sections['foo']['total']);
?>
      <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
collections/rate/<?php echo $this->_tpl_vars['collection']['id']; ?>
?rating=<?php echo $this->_sections['foo']['index']; ?>
" data-method="post" data-remote="true" onmouseover="marketplace.rating.toggle_stars('<?php echo $this->_tpl_vars['collection']['id']; ?>
_star', <?php echo $this->_sections['foo']['index']; ?>
);" rel="nofollow">
	  <img alt="<?php echo $this->_sections['foo']['index']; ?>
" id="<?php echo $this->_tpl_vars['collection']['id']; ?>
_star_<?php echo $this->_sections['foo']['index']; ?>
" src="/static/img/star-off.png"></a>
     <?php endfor; endif; ?>
	</div>
		<?php endif; ?>
      <small>( <?php echo $this->_tpl_vars['collection']['votes']; ?>
 <?php echo $this->_tpl_vars['lang']['votes']; ?>
 )</small>
	  
		      	<?php if ($this->_tpl_vars['collection']['rate']): ?>
		      		<br />
		      		<small>امتیاز شما: <?php echo $this->_tpl_vars['collection']['rate']['rate']; ?>
 ستاره</small>
		      	<?php endif; ?>
</div>
<script>
   <?php echo 'marketplace.queue(function(){
    marketplace.rating.init();
  }); '; ?>

</script>
      </div>
      <hr>
    </div>
<?php endif; ?>
  <h2 class="box-heading">مالک این مجموعه</h2>
  <div class="content-box top-author">
    
<div class="avatar-wrapper">
    <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
user/<?php echo $this->_tpl_vars['collection']['user']['username']; ?>
" class="avatar" title="<?php echo $this->_tpl_vars['collection']['user']['username']; ?>
">
	<?php if ($this->_tpl_vars['collection']['user']['avatar'] != ''): ?>  
  <img alt="<?php echo $this->_tpl_vars['collection']['user']['username']; ?>
" class="" height="80" src="<?php echo $this->_tpl_vars['data_server']; ?>
uploads/users/<?php echo $this->_tpl_vars['collection']['user']['user_id']; ?>
/A_<?php echo $this->_tpl_vars['collection']['user']['avatar']; ?>
" width="80" />
  <?php else: ?>
    <img alt="<?php echo $this->_tpl_vars['collection']['user']['username']; ?>
" class="" height="80" src="<?php echo $this->_tpl_vars['data_server']; ?>
img/default-user.jpg" width="80" />
	<?php endif; ?>
</a>
</div>
    <strong class="author"><?php echo $this->_tpl_vars['collection']['user']['username']; ?>
</strong>
    <br>
        <ul class="badges">
            <?php $_from = $this->_tpl_vars['user_badges']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['b']):
        $this->_foreach['foo']['iteration']++;
?>
		      	<img src="<?php echo $this->_tpl_vars['data_server']; ?>
<?php echo $this->_tpl_vars['b']['photo']; ?>
" height="20" width="20" alt="<?php echo ((is_array($_tmp=$this->_tpl_vars['b']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" title="<?php echo ((is_array($_tmp=$this->_tpl_vars['b']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" />
		      	<?php if (($this->_foreach['foo']['iteration'] == $this->_foreach['foo']['total'])): ?> <br /> <?php endif; ?>
	      	<?php endforeach; endif; unset($_from); ?>
        </ul>
  </div>
	<?php if (check_login_bool ( ) && $this->_tpl_vars['collection']['user_id'] == $_SESSION['user']['user_id']): ?>
    <h2 class="box-heading"><?php echo $this->_tpl_vars['lang']['edit_collection']; ?>
</h2>
<div class="content-box">
  <form class="vertical-form" enctype="multipart/form-data" id="edit_collection" method="post">
    <div class="input-group">
      <label for="title">نام *</label>
      <div class="inputs">
        <input id="collection_name" name="name" size="30" type="text" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['collection']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" />
      </div>
    </div>

    <div class="input-group">
      <label for="image">عکس</label>
      <div class="inputs">
        <input id="file_upload" name="file_upload" type="file" />
        <small>260x140px</small>
      </div>
    </div>

    <div class="input-group">
      <label for="description">توضیحات</label>
      <div class="inputs">
        <textarea cols="20" id="collection_description" name="description" rows="10"><?php echo $this->_tpl_vars['collection']['text']; ?>
</textarea>
        <label for="collection_publically_visible">
          <input name="collection[publically_visible]" type="hidden" value="0" />
		  <input id="collection_publically_visible" name="publically_visible" type="checkbox" value="1" <?php if ($this->_tpl_vars['collection']['public'] == 'true'): ?>checked="checked"<?php endif; ?> />
          نمایش عمومی ؟
        </label>
      </div>
    </div>

    <div class="form-submit">
      <div class="form-submit">
	  	<input type="hidden" name="edit" value="yes" />
<button type="submit" class="btn-icon submit">ویرایش مجموعه</button>
</div>

    </div>
</form></div>

      <h2 class="box-heading">حذف مجموعه</h2>
      <div class="content-box">
      <form action="" method="post">
	  <input type="hidden" name="delete" value="yes" />
          <button type="submit" onclick="return confirm('Are you sure you want to delete this collection?');" class="no-margin">حذف کن</button>
</form>      </div>  <?php endif; ?>
</div>

      </div>
    </div>