index.php
3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!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"> 应用名称:</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"> 安装目录:</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"> 应用名:</th>
<td><input type="text" value="myapp" size="35" class="txt" readonly="readonly" ></td>
<td></td>
</tr>
<tr><th class="tbopt" align="left"> 安装目录:</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"> </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"> </th>
<td><input type="submit" name="submitname" value="下一步" class="btn">
</td>
<td></td>
</tr>
</table>
</form>
<div class="footer">©2001 - 2999 <a href="#">Yoho</a> Inc.</div>
</div>
</div>
</body>
</html>