index.php 3.38 KB

<!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=utf-8" />

<title>创建新应用</title>

<link rel="stylesheet" href="images/style.css" type="text/css" media="all" />

<script type="text/javascript">

	function $(id) {

		return document.getElementById(id);

	}



	function showmessage(message) {

		document.getElementById('notice').innerHTML += message + '<br />';

	}

</script>

<meta content="Comsenz Inc." name="Copyright" />

</head>
<body>
<?php 
$app_name = 'myapp' ;
$target_dir = $gereral = $sucess = '' ;
if ($_POST){
	$app_name = trim($_POST['app_name']) ;
	$target_dir = realpath(str_ireplace('\\','/',trim($_POST['target_dir'])));
	do {
		if (!$app_name){
			$errorMessage = '请填写应用名称';
			break;
		}
		if (!$target_dir){
			$errorMessage = '请填写有效的应用安装目录';
			break;
		}
		try {
			include dirname(__FILE__).'/genera.php';
			$gereral = new Genera($app_name,$target_dir,false);
			$gereral_info = $gereral->getInfo();
			$sucess = '你已成功安装应用' ;
		}catch (Exception $ex){
			$errorMessage = $ex->getMessage();
		}
	}while (false);
}
?>

<div class="container">

	<div class="header">

		<h1>应用安装向导</h1>
	</div>
<div class="main">
<form method="post" action="index.php">
<div style="color:red;text-align: center;"><?php echo ($errorMessage)?'*'.$errorMessage:'' ;?></div>
<div style="color:green;text-align: center; font-weight:bold;font-size:20px;"><?php echo ($sucess)?'√'.$sucess:'' ;?></div>
<div id="form_items_3" ><br /><div class="desc"><b>填写新应用信息</b></div><table class="tb2">
<tr><th class="tbopt" align="left">&nbsp;应用名称:</th>
<td><input type="text" name="app_name" value="<?php echo $app_name?>" size="35" class="txt"></td>
<td>请填写合法的目录名称(字母、数字或下划线)</td>
</tr>

<tr><th class="tbopt" align="left">&nbsp;安装目录:</th>
<td><input type="text" name="target_dir" value="<?php echo $target_dir;?>"  class="txt"></td>
<td>请填写你想将应用安装到的路径</td>
</tr>

</table><div class="desc"><b>填写示例</b></div><table class="tb2">


<tr><th class="tbopt" align="left">&nbsp;应用名:</th>
<td><input type="text"  value="myapp" size="35" class="txt" readonly="readonly" ></td>
<td></td>
</tr>

<tr><th class="tbopt" align="left">&nbsp;安装目录:</th>
<td><input type="text" name="" value="E:\www" size="35" class="txt" readonly="readonly" ></td>
<td></td>
</tr>

<tr><th class="tbopt" align="left">&nbsp;</th>
<td>如上方,填写的应用名为'myapp',安装目录为'E:\www'<br>
则成功安装后新的应用目录为: 'E:\www\myapp\'<br>
访问应用只需访问 http://localhost/....../myapp/public即可

</td>
<td></td>
</tr>


</table></div>

<table class="tb2">
<tr>
<td>
<?php if ($gereral_info):?>
<div style="max-height:320px;width:500px; overflow-y:scroll;overflow-x:hidden;background:#666666;color:white;padding:10px;"><?php echo $gereral_info;?></div>
<?php endif; ?>
</td>
</tr>

</table>

<table class="tb2">
<tr><th class="tbopt" align="left">&nbsp;</th>
<td><input type="submit" name="submitname" value="下一步" class="btn">
</td>
<td></td>
</tr>

</table>
</form>
		<div class="footer">&copy;2001 - 2999 <a href="#">Yoho</a> Inc.</div>

	</div>

</div>

</body>

</html>