<?php echo $this->fetch('header.html'); ?>
<style type="text/css">
tr.cai_hover:hover td{background-color:#F3F3F3; cursor:pointer;}
</style>
<div class="row">
  <div class="span7">
  <?php if (SHOWWEEK): ?>
  <?php $this->skymvc->loadControl("productapi");$this->assign("t_cs",$_ENV["productapiControl"]->getByWeek()); ?>
  <ul class="nav nav-tabs" id="myTab">
      <?php $_from = $this->_var['t_cs']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('k', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['k'] => $this->_var['c']):
?>
      <li class=" <?php if ($this->_var['k'] == getweek ( 'week' )): ?>active<?php endif; ?>"><a href="#c_<?php echo $this->_var['k']; ?>"><?php echo week_list($this->_var['k']); ?></a></li>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </ul>
    
    <div class="tab-content"> <?php $_from = $this->_var['t_cs']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('k', 't_c');if (count($_from)):
    foreach ($_from AS $this->_var['k'] => $this->_var['t_c']):
?>
      <div class="tab-pane <?php if ($this->_var['k'] == getweek ( 'week' )): ?>active<?php endif; ?>" id="c_<?php echo $this->_var['k']; ?>">
       
        <table class="table table-bordered table-hover">
          <?php $_from = $this->_var['t_c']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('kk', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['kk'] => $this->_var['c']):
?>
          <tr onclick="orderCart_add(<?php echo $this->_var['c']['id']; ?>)" class="  cai_hover">
          	<td width="50"><img src="<?php echo IMAGES_SITE; ?><?php echo $this->_var['c']['imgurl']; ?>.100x100.jpg" width="50"></td>
            <td><?php echo $this->_var['c']['title']; ?></td>
            <td width="60">￥<?php echo $this->_var['c']['price']; ?></td>
          </tr>
          <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        </table>
      </div>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </div>
  <?php else: ?>
  <?php $this->skymvc->loadmodel("category");$this->assign("t_cs",$_ENV["categoryModel"]->select(array("where"=>"pid=1 AND status=1","order"=>" orderindex asc"))); ?>
    <ul class="nav nav-tabs" id="myTab">
      <?php $_from = $this->_var['t_cs']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('k', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['k'] => $this->_var['c']):
?>
      <li class=" <?php if ($this->_var['k'] == 0): ?>active<?php endif; ?>"><a href="#c_<?php echo $this->_var['c']['id']; ?>"><?php echo $this->_var['c']['cname']; ?></a></li>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </ul>
    
    <div class="tab-content"> <?php $_from = $this->_var['t_cs']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('k', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['k'] => $this->_var['c']):
?>
      <div class="tab-pane <?php if ($this->_var['k'] == 0): ?>active<?php endif; ?>" id="c_<?php echo $this->_var['c']['id']; ?>">
      <?php $this->skymvc->loadControl("productapi");$this->assign("t_c",$_ENV["productapiControl"]->onlist("".$this->_var["c"]["id"]."")); ?>
        <table class="table table-bordered table-hover">
          <?php $_from = $this->_var['t_c']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('kk', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['kk'] => $this->_var['c']):
?>
          <tr onclick="orderCart_add(<?php echo $this->_var['c']['id']; ?>)" class="  cai_hover">
          	<td width="50"><img src="<?php echo IMAGES_SITE; ?><?php echo $this->_var['c']['imgurl']; ?>.100x100.jpg" width="50"></td>
            <td><?php echo $this->_var['c']['title']; ?></td>
            <td width="60">￥<?php echo $this->_var['c']['price']; ?></td>
          </tr>
          <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        </table>
      </div>
      <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </div>
    
   <?php endif; ?> 
   
    
    <script>
 $('#myTab a').click(function (e) {
  e.preventDefault();
  $(this).tab('show');
})
</script>
    
  </div>
  <div class="span5"> <?php echo $this->fetch('order_cart/cart.html'); ?> </div>
</div>
<?php echo $this->fetch('footer.html'); ?>