<link href="styles/general.css" rel="stylesheet" type="text/css" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/transport.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/listtable.js"></script>
<script type="text/javascript" src="js/validator.js"></script>
<body>
<h1>
<span class="action-span1"><a href="?ctl=index&act=admin_main"><tpl>$common_admin_index</tpl><!--管理首页--></a> >> <tpl>$leave_list</tpl><!--留言管理--></span>
<div style="clear:both"></div>
</h1>
<form method="post" action="index.php?ctl=leave&act=leave_del" name="listForm">
<div class="list-div" id="listDiv">
<table width="100%" cellpadding="3" cellspacing="1" id="listTable">
  <tr>
    <th colspan="3"><tpl>$leave_list_info</tpl><!--留言信息--></th>
  </tr>
  <tpl>foreach $leave_array as $val</tpl>
  <tr>
    <td width="5%" align="center">
      <input type="checkbox" name="id[]" value="<tpl>$val['leave_id']</tpl>">
      </td>
    <td width="60%" align="left"><tpl>$leave_list_writer</tpl><!--发布人-->：<tpl>$val['leave_writer']</tpl>&nbsp;&nbsp;<tpl>$leave_list_time</tpl><!--发布时间-->：<tpl>date("Y-m-d H:i:s",$val['leave_time'])</tpl>&nbsp;&nbsp;<tpl>$leave_list_ip</tpl><!--来源ip-->：<tpl>if $val['leave_ip'] == ''</tpl><tpl>$leave_list_ip_null</tpl><!--无--><tpl>else</tpl><tpl>$val['leave_ip']</tpl><tpl>/if</tpl></td>
    <td width="35%" align="center">
      <a href="index.php?ctl=leave&act=leave_edit&leave_id=<tpl>$val['leave_id']</tpl>&binz_page=<tpl>intval($_GET['binz_page'])</tpl>"><tpl>$leave_list_edit</tpl></a><!--编辑--> |
	  <a href="index.php?ctl=leave&act=leave_del&leave_id=<tpl>$val['leave_id']</tpl>&binz_page=<tpl>intval($_GET['binz_page'])</tpl>" onClick="return confirm('<tpl>$leave_list_del_conf</tpl>');"><tpl>$leave_list_del</tpl></a><!--删除--></td>
  </tr>
  <tr>
    <td align="center"><tpl>$leave_list_body</tpl><!--内容--></td>
    <td colspan="2" align="left"><tpl>nl2br($val['leave_body'])</tpl></td>
    </tr>
	<tpl>/foreach</tpl>
  <tr>
    <td colspan="3" align="right"><span style=" float:left">&nbsp;<input type="checkbox" name="chkall" onClick='listTable.selectAll(this, "id")' >&nbsp;&nbsp;<input type="submit" id="btnSubmit" disabled="true" name="del" value="<tpl>$leave_list_del</tpl>" class="button" /></span><tpl>$show_page</tpl>&nbsp;&nbsp;</td>
    </tr>
  </table>
</div>
</form>
<br>
<div>
<form method="post" action="index.php?ctl=leave&act=leave_save" name="theForm" onSubmit="return validate();">
<table border="0" align="center">
  <tr><th colspan="2">
  <strong><tpl>$leave_repost</tpl><!--留言回复--></strong>
  </th></tr>
  <tr>
    <td><tpl>$leave_list_repost_writer</tpl><!--回复人-->:</td>
    <td><input name="leave_writer" type="text" value="<tpl>$_SESSION['admin_name']</tpl>"></td>
  </tr>
  <tr>
    <td><tpl>$leave_list_repost_body</tpl><!--回复内容-->:</td>
    <td><textarea name="leave_body" cols="50" rows="4"></textarea></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>
      <input name="submit" type="submit" value="<tpl>$leave_list_save</tpl>" class="button">
      <input type="reset" value="<tpl>$leave_list_reset</tpl>" class="button">
    </td>
  </tr>
</table>
</form>
</div>
<div id="footer">
<tpl>$common_copyright</tpl>
</div>
<script language="javascript">
  /**
   * 检查输入的内容
   */
  function validate()
  {
    var validator = new Validator('theForm');
    validator.required('leave_writer','<tpl>$leave_list_writer_error</tpl>');
	validator.required('leave_body','<tpl>$leave_list_body_error</tpl>');
    return validator.passed();
  }
</script>
</body>
