<?php require_once('../../include/class.inc.php'); ?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" href="../inc/css.css" type="text/css" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE5 {color: #FFFFFF; font-weight: bold; }
-->
</style>
<script type="text/javascript">
function check() {
	var target=document.form.template.value;
	target=target.replace(/html/,"php");
	target="../../" + target;
	document.forms[0].action = target;
	//alert(target);
	return true;
	}


</script>
</head>

<body>
<table width="1055" border="0" align="center" cellpadding="0" cellspacing="0"><form method="post" name="form" action="" onclick="return check()">
  <tr>
    <td colspan="2">
      <table width="749" border="0" align="center" cellpadding="2" cellspacing="1" bordercolor="#799AE1" class="tableBorder">
        <tbody>
          <tr bgcolor="#CCCCCC">
            <td height="20" colspan="2" bgcolor="#4455aa" class="STYLE5">生成静态页 </td>
          <tr bgcolor="#DEE5FA"><td width="286">生成html:</td>
            <td width="450"  align="left" class="txlrow">
            
    <select name="template" id="template">
    	<?
	function get_files($url,$length) {
		$sub=scandir($url);
		foreach ( $sub as $sub_v) {
			if ($sub_v == '..' || $sub_v == '.') {
			continue;	
			}
			if (is_dir($url.$sub_v)) {
				get_files($url.$sub_v.'/');
			}else {
				
				$length=17 + $length;
			echo "<option value='".substr($url,$length).$sub_v."'>".substr($url,$length).$sub_v."</option>";
			}
		}
}
		
$dir_url="../templates/default/";	
$files=scandir($dir_url);			
foreach ( $files as $v ) {
	if (is_dir($dir_url.$v)) {
		
		if ($v == $dir_name) {
			get_files($dir_url.$v.'/',$tem_len);
		}
	} else {
	echo "<option value='$v'>".$v."</option>";	
	}
	
}
		
		?>
    </select>
    <input type="hidden" value="html"  name="html"/> 
            
            </td>
          <tr bgcolor="#CCCCCC"><td height="20" colspan="2" bgcolor="#DEE5FA" align="center"><input type="submit" value="提交" name="ok" /></td></tr>
        </tbody>
      </table>
          
    </td>
  </tr>
</form>
</table>
</body>
</html>
