<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>">
<link href=images/style.css rel=stylesheet type=text/css>
<script language="JavaScript" src="js/common.js" type="text/javascript"></script>
<script type="text/JavaScript">
var addrowdirect = 0;
function addrow(obj, type) {
   var table = obj.parentNode.parentNode.parentNode;
   if(!addrowdirect) {
    var row = table.insertRow(obj.parentNode.parentNode.rowIndex);
   } else {
    var row = table.insertRow(obj.parentNode.parentNode.parentNode.rowIndex + 1);
   }
    
   var typedata = rowtypedata[type];
   for(var i = 0; i <= typedata.length - 1; i++) {
    var cell = row.insertCell(i);
    cell.colSpan = typedata[i][0];
    var tmp = typedata[i][1];
    if(typedata[i][2]) {
     cell.className = typedata[i][2];
    }
    tmp = tmp.replace(/\{(\d+)\}/g, function($1, $2) {return addrow.arguments[parseInt($2) + 1];});
    cell.innerHTML = tmp;
   }
   addrowdirect = 0;
}
</script>
<script type="text/JavaScript">
	var rowtypedata = [
		[[1,''], [1,'<input name="newquestion[]" size="30" type="text" class="txt">','td26'], [1, '<input name="newanswer[]" type="text" class="txt">']],
	];
</script>
<body>
<br>
<table width=100% border=0 align=center cellpadding=0 cellspacing=1 class=tableborder id=a>
      
	  <tr class=header>
        <td height=25>&nbsp;验证列表</td>
      </tr>
	  
      <tr>
        <td bgcolor=#FFFFFF align=center>
		
		<table width=100% align=center border=0 cellspacing=1 cellpadding=0 bgcolor="#DBEAF5" id='123'>
		<form action="?act=do" method="post" >
            <tr bgcolor=#CED4E8 align="center">
              <td width="9%" height=25> 编号</td>
              <td width="30%">问题</td>
              <td width="20%" bgcolor="#CED4E8">答案</td>
            </tr>
<?php
foreach($data as $val)
{
?>
            <tr bgcolor=#FFFFFF >
              <td><input name="id[]" type="checkbox" id="id[]" value="<?=$val[vid]?>" />
              <?=$val[vid]?></td>
              <td><input type="text" size="30" name="question[<?php echo $val[vid]?>]" value="<?php echo $val[question];?>"></td>
			  <td><input type="text" size="30" name="answer[<?php echo $val[vid]?>]" value="<?php echo $val[answer];?>"></a></td>
              
            </tr>
<?}?>			
          <tr bgcolor=#FFFFFF align=left>
		  <td height="26" colspan="6" bgcolor="#CED4E8">
		  <input type="hidden" name="act" value="batch">
			  <input name="checkall" type="checkbox" id="checkall" onClick="CheckAll(this.form)"/>[删除?]
			  <input name="submit" type="submit" id="submit" value=" 提交 " >
			  <input type="hidden" name="act" value="do">&nbsp;&nbsp;<button onClick="addrow(this, 0)">增加问题</button>
			</td>
         </tr>
		</form></table>
		</td>
      </tr>
</table>
</body>
</html>