<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>系统后台</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link type="text/css" rel="stylesheet" href="<?php echo $this->basedir;?>images/admin/public.css" />
<link type="text/css" rel="stylesheet" href="<?php echo $this->basedir;?>images/admin/style.css" />
<script src="<?php echo $this->basedir;?>js/jquery.js" type="text/javascript"></script>
<script src="<?php echo $this->basedir;?>js/jquery.tablednd.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
    // Initialise the table
    $("#tbl").tableDnD({
		onDragClass:'rows',
		onDrop: function(table, row) {
            //alert($.tableDnD.serialize());
			$.get("<?php echo $this->installdir;?>module/modify/do/sort",$.tableDnD.serialize());
        }
	});
});
function show(v){
	$('#v'+ v).toggle();
}
</script>
<body>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
  <tr align="center" valign="top">
    <td width="*" align="center" valign="top"><!-- ######### begin ######### -->
      <div class="Block">
        <div class="BlockBar">系统模块</div>
        <table cellspacing="1" cellpadding="4" class="tab" id="tbl">
          <tr class="sub align-center nodrag">
            <td width="73">编号</td>
            <td width="389" class="align-left">模块名</td>
            <td width="103">管理</td>
          </tr>
		  <?php
		  foreach((array)$this->listModule as $rows){
		  ?>
		  <tbody>
          <tr class="rows nodrag">
            <td class="align-center"><?php echo $rows['self']['id'];?></td>
            <td><a href="#" onclick="show(<?php echo $rows['self']['id'];?>);"><img src="../../images/admin/ico_switch_open.gif" width="10" height="11" border="0" /></a> <?php echo $rows['self']['name'];?></td>
            <td ><a href="<?php echo $this->installdir;?>module/add/mid/<?php echo $rows['self']['id'];?>">添加</a> <a href="<?php echo $this->installdir;?>module/modify/mid/<?php echo $rows['self']['id'];?>">编辑</a> <a href="<?php echo $this->installdir;?>module/delete/mid/<?php echo $rows['self']['id'];?>" onclick="return confirm('确认要删除此模块吗?')">删除</a></td>
          </tr>
		  </tbody>
		  <tbody class="None" id="v<?php echo $rows['self']['id'];?>">
			<?php
			if (isset($rows['nodes'])){
			foreach((array)$rows['nodes'] as $rs){?>
			   <tr class="row" id="<?php echo $rs['id'];?>" >
				<td class="align-center"><?php echo $rs['id'];?></td>
				<td>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $rs['name'];?></td>
				<td><a href="<?php echo $this->installdir;?>module/modify/mid/<?php echo $rs['id'];?>">编辑</a> <a href="<?php echo $this->installdir;?>module/delete/mid/<?php echo $rs['id'];?>">删除</a></td>
			  </tr>
			<?php
			}
			}?>
			</tbody>
			<?php
			}?>
        </table>
      </div>
      <div id="App-Version-Prompt" style="display:none;">
        <div class="space"></div>
        <div class="Block">
          <div class="BlockBar">版本更新信息</div>
          <div class="BlockContent" id="App-Version-Prompt-Body" style="padding:20px 5px 20px 5px; text-align:center; background:#FFFFCC;">loading...</div>
        </div>
      </div>
      <!-- ########## end ########## -->
    </td>
    <td width="5"></td>
    <td width="150" align="center" valign="top">
    <?php
	echo $this->render('menu');
	?>
     </td>
  </tr>
</table>
<?php
echo $this->render('copyright');
?>
</body>
</html>

