<?php echo $this->fetch('header.html'); ?>
<div class="row">
<div class="span12">
<h1><?php echo $this->_var['lang']['navbar_admin']; ?></h1>
<ul class="nav  nav-tabs nav-justified">
<li class="active"><a href="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar"><?php echo $this->_var['lang']['navbar_admin']; ?></a></li>
<li><a href="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=add"><?php echo $this->_var['lang']['navbar_add']; ?></a></li>
</ul>
<p>
<div class="btn-group">
<a href="javascript:;" class="btn btn-success">导航位置</a>
<?php $_from = $this->_var['group_list']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('k', 'g');if (count($_from)):
    foreach ($_from AS $this->_var['k'] => $this->_var['g']):
?>
<a href="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&group_id=<?php echo $this->_var['k']; ?>" class="btn <?php if ($this->_var['k'] == $_GET['group_id']): ?> btn-danger<?php endif; ?>"><?php echo $this->_var['g']; ?></a>
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</div>
</p> 
<form action="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=order" method="post">
<table width="100%" class="table table-bordered">
  <tr>
    <td width="5%" align="center">ID</td>
    <td width="22%" align="center"><?php echo $this->_var['lang']['name']; ?></td>
    <td width="10%">状态</td>
    <td width="4%" align="center">m</td>
    <td width="4%" align="center">a</td>
    <td width="15%" height="30" align="center"><?php echo $this->_var['lang']['position']; ?></td>
    <td width="10%" align="center"><?php echo $this->_var['lang']['target']; ?></td>
    
    <td width="7%" height="30" align="center"><?php echo $this->_var['lang']['sort']; ?></td>
    <td width="16%" height="30" align="center"><?php echo $this->_var['lang']['operation']; ?></td>
  </tr>
  <?php $_from = $this->_var['navlist']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 't');if (count($_from)):
    foreach ($_from AS $this->_var['t']):
?>
  <tr>
    <td align="center"><?php echo $this->_var['t']['id']; ?></td>
  <td align="left"><a href="<?php echo $this->_var['t']['link_url']; ?>" target="_blank" style="color:red"><?php echo $this->_var['t']['title']; ?></a></td>
  <td>	<?php if ($this->_var['t']['status'] == 1): ?>
           <img src="<?php echo IMAGES_SITE; ?>/static/images/no.gif"  class="ajax_yes" url="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=status&id=<?php echo $this->_var['t']['id']; ?>&status=2" rurl="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=status&id=<?php echo $this->_var['t']['id']; ?>&status=1" /> 
          <?php else: ?>
           <img src="<?php echo IMAGES_SITE; ?>/static/images/yes.gif" class="ajax_no"  rurl="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=status&id=<?php echo $this->_var['t']['id']; ?>&status=2" url="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=status&id=<?php echo $this->_var['t']['id']; ?>&status=1" /> 
          <?php endif; ?></td>
  <td align="center"><?php echo $this->_var['t']['m']; ?></td>
  <td align="center"><?php echo $this->_var['t']['a']; ?></td>
    <td height="25" align="center"><?php echo $this->_var['group_list'][$this->_var['t']['group_id']]; ?></td>
    <td align="center"><?php if ($this->_var['t']['target'] == '_blank'): ?><?php echo $this->_var['lang']['_blank']; ?><?php else: ?><?php echo $this->_var['lang']['_self']; ?><?php endif; ?></td>
    <input type="hidden" name="id[]" value="<?php echo $this->_var['t']['id']; ?>" />
    <td height="25" align="center"><input name="orderindex[]" type="text" value="<?php echo $this->_var['t']['orderindex']; ?>" class="w50" /></td>
    <td height="25" align="center">
    <a href="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=add&pid=<?php echo $this->_var['t']['id']; ?>" style="color:red;"><?php echo $this->_var['lang']['navbar_addchild']; ?></a>
    <a href="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=add&id=<?php echo $this->_var['t']['id']; ?>"><?php echo $this->_var['lang']['edit']; ?></a> 
    <a href="javascript:;"  url="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=delete&id=<?php echo $this->_var['t']['id']; ?>" class="delete" ><?php echo $this->_var['lang']['delete']; ?></a></td>
  </tr>
  <?php if ($this->_var['t']['child']): ?>
  <?php $_from = $this->_var['t']['child']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
    <tr>
      <td align="center"><?php echo $this->_var['c']['id']; ?></td>
  <td align="left">|__<a href="<?php echo $this->_var['c']['link_url']; ?>" target="_blank"><?php echo $this->_var['c']['title']; ?></a> </td>
  <td>	<?php if ($this->_var['c']['status'] == 1): ?>
           <img src="<?php echo IMAGES_SITE; ?>/static/images/no.gif"  class="ajax_yes" url="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=status&id=<?php echo $this->_var['c']['id']; ?>&status=2" rurl="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=status&id=<?php echo $this->_var['c']['id']; ?>&status=1" /> 
          <?php elseif ($this->_var['c']['status'] == 2): ?>
           <img src="<?php echo IMAGES_SITE; ?>/static/images/yes.gif" class="ajax_no"  rurl="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=status&id=<?php echo $this->_var['c']['id']; ?>&status=2" url="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=status&id=<?php echo $this->_var['c']['id']; ?>&status=1" /> 
          <?php endif; ?></td>
  <td align="center"><?php echo $this->_var['c']['m']; ?></td>
  <td align="center"><?php echo $this->_var['c']['a']; ?></td>
    <td height="25" align="center"><?php echo $this->_var['group_list'][$this->_var['c']['group_id']]; ?></td>
    <td align="center"><?php if ($this->_var['c']['target'] == '_blank'): ?><?php echo $this->_var['lang']['_blank']; ?><?php else: ?><?php echo $this->_var['lang']['_self']; ?><?php endif; ?></td>
    <input type="hidden" name="id[]" value="<?php echo $this->_var['c']['id']; ?>" />
    
    <td height="25" align="center"><input name="orderindex[]" type="text" value="<?php echo $this->_var['c']['orderindex']; ?>" class="w50" /></td>
    <td height="25" align="center">
    <a href="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=add&id=<?php echo $this->_var['c']['id']; ?>"><?php echo $this->_var['lang']['edit']; ?></a> 
    <a href="javascript:;"  url="<?php echo $this->_var['appadmin']; ?>?m=admin_navbar&a=delete&id=<?php echo $this->_var['c']['id']; ?>" class="delete" ><?php echo $this->_var['lang']['delete']; ?></a>
    </td>
  </tr>
  <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
  <?php endif; ?>
	<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
  <tr>
    <td colspan="8" align="right"><input type="submit" name="button" id="button" value="更改排序" class="btn" /></td>
    </tr>
    <?php if ($this->_var['pagelist']): ?>
    <tr>
    <td colspan="8" align="right"><?php echo $this->_var['pagelist']; ?></td>
    </tr>
    <?php endif; ?>
</table>

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

<?php echo $this->fetch('footer.html'); ?>