<html xmlns="http://www.w3.org/1999/xhtml"><!--STATUS OK-->
<head><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/><meta http-equiv="Cache-control" content="no-cache" /><style type="text/css">body{font-size:medium;line-height:1.6em;text-align:center}img{border:0}form{margin:0;padding:0}.a{padding-top:6px;margin-top:6px;margin-bottom:6px}.h{color:#c60a00}.s{font-size:small}.b{font-size:small;color:#77C}</style>
<title>Calpuff Web Client</title>
<link rel="Shortcut Icon" href="favicon.ico" /><!--地址栏和标签上显示图标-->
<link rel="Bookmark" href="favicon.ico" /><!--收藏夹显示图标-->
</head>
<body bgcolor="ghostwhite">
<img src="../images/calpuff_logo.jpg" height="60" alt="Calpuff Web Client"/>
<table align="center">
<th><font color="blue">Welcome To Calpuff Web Client</font> </th>
</table>
<br/>
<form action="webclient.php" method="post" enctype="multipart/form-data" οnsubmit="return checkInput()">
Please Input The Parameters <br/> <br/>
<strong>Startdate(YYYY-mm-dd)</strong> <input type="text" name="startdate" id="startdate">
<br/><br/>
<strong>Enddate(YYYY-mm-dd)</strong> <input type="text" name="enddate" id="enddate">
<br/><br/>
<strong>Lower_left_X</strong> <input type="text" name="xrefkm" id="xrefkm">
<br/><br/>
<strong>Lower_left_Y</strong> <input type="text" name="yrefkm" id="yrefkm">
<br/><br/>
<strong>Num_Grid_X</strong> <input type="text" name="nx" id="nx">
<br/><br/>
<strong>Num_Grid_Y</strong> <input type="text" name="ny" id="ny">
<br/><br/>
<strong>Resolution(km)</strong> <input type="text" name="dgridkm" id="dgridkm">
<br/><br/>
<!--取出服务器中terrel的geofile-->
<strong>Terrel_Data_Input</strong>
<select name="gtopo30" id="gtopo30">
<?php
$con = mysql_connect("rdsci9uvwqcq7vp48n90j.mysql.rds.aliyuncs.com","iseis","iseis2013");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{
mysql_select_db("db_wrf", $con);
$result = mysql_query("SELECT * FROM t_geo_file");
while($row = mysql_fetch_array($result))
{
if($row['type']=="terrel") echo "<option value=".$row['path'].">".getFilename($row['path'])."</option>";
}
mysql_close($con);
}
?>
</select>
<br/><br/>
<strong>Landuse_Data_Input</strong>
<!--取出服务器中ctgproc的geofile-->
<select name="glazas" id="glazas">
<?php
$con = mysql_connect("rdsci9uvwqcq7vp48n90j.mysql.rds.aliyuncs.com","iseis","iseis2013");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{
mysql_select_db("db_wrf", $con);
$result = mysql_query("SELECT * FROM t_geo_file");
while($row = mysql_fetch_array($result))
{
if($row['type']=="ctgproc") echo "<option value=".$row['path'].">".getFilename($row['path'])."</option>";
}
mysql_close($con);
}
?>
</select>
<br/><br/>
<!-- 运行不同的模型-->
<strong>Select Model Type</strong>
<select name="modelname" id="modelname">
<option value="terrel">terrel</option>
<option value="ctgproc">ctgproc</option>
<option value="makegeo">makegeo</option>
<option value="calwrf">calwrf</option>
<option value="calmet">calmet</option>
<option value="calpuff">calpuff</option>
</select>
<br/><br/>
<strong>Case_Identifier</strong>
<input type="text" name="identifier" id="identifier">
<br/><br/>
<strong>Emission_Data_Input</strong>
<input type="file" name="srcfile" id="srcfile">
<br/><br/>
<input type="submit" value=" Run The Selected Model " >
</form>
<div class="a">
<span class="b">The Chinese University Of Hong Kong & Peking University</span>
<br/>
<span class="b">Copyright © 2015 </span>
<span class="b">All Rights Reserved</span>
</div>
</body>
</html>
<?php
function getFilename($path)
{
$index=0;
$length=strlen($path);
for($i=0;$i<$length;$i++)
{
if($path[$length-$i]=="\\")
{
$index=$length-$i;
break;
}
}
$index++;
return substr($path,$index,$length-$index);
}
?>
<script type="text/javascript">
function checkInput()
{
var modelname=document.getElementById("modelname").value;
var startdate=document.getElementById("startdate").value;
var enddate=document.getElementById("enddate").value;
var xrefkm=document.getElementById("xrefkm").value;
var yrefkm=document.getElementById("yrefkm").value;
var nx=document.getElementById("nx").value;
var ny=document.getElementById("ny").value;
var dgridkm=document.getElementById("dgridkm").value;
var identifier=document.getElementById("identifier").value;
var gtopo30=document.getElementById("gtopo30").value;
var glazas=document.getElementById("glazas").value;
if(identifier=="")
{
alert("Please input case_identifier");
return false;
}
// 没有填写的检测
if (modelname == "terrel")
{
if(nx=="")
{
alert("Please input Num_Grid_X");
return false;
}
if(ny=="")
{
alert("Please input Num_Grid_Y");
return false;
}
if(xrefkm=="")
{
alert("Please input Lower_Left_X");
return false;
}
if(yrefkm=="")
{
alert("Please input Lower_Left_Y");
return false;
}
if(dgridkm=="")
{
alert("Please input Resolution");
return false;
}
if(gtopo30=="")
{
alert("Please input Terrel_Data_Input");
return false;
}
}
else if (modelname == "ctgproc")
{
if(nx=="")
{
alert("Please input Num_Grid_X");
return false;
}
if(ny=="")
{
alert("Please input Num_Grid_Y");
return false;
}
if(xrefkm=="")
{
alert("Please input Lower_Left_X");
return false;
}
if(yrefkm=="")
{
alert("Please input Lower_Left_Y");
return false;
}
if(dgridkm=="")
{
alert("Please input Resolution");
return false;
}
if(glazas=="")
{
alert("Please input Landuse_Input");
return false;
}
}
else if(modelname=="makegeo")
{
if(nx=="")
{
alert("Please input Num_Grid_X");
return false;
}
if(ny=="")
{
alert("Please input Num_Grid_Y");
return false;
}
if(xrefkm=="")
{
alert("Please input Lower_Left_X");
return false;
}
if(yrefkm=="")
{
alert("Please input Lower_Left_Y");
return false;
}
if(dgridkm=="")
{
alert("Please input Resolution");
return false;
}
if(gtopo30=="")
{
alert("Please input Terrel_Data_Input");
return false;
}
if(glazas=="")
{
alert("Please input Landuse_Input");
return false;
}
}
else if (modelname == "calwrf")
{
if(startdate=="")
{
alert("Please input startdate");
return false;
}
if(enddate=="")
{
alert("Please input enddate");
return false;
}
}
else if (modelname == "calmet")
{
if(nx=="")
{
alert("Please input Num_Grid_X");
return false;
}
if(ny=="")
{
alert("Please input Num_Grid_Y");
return false;
}
if(xrefkm=="")
{
alert("Please input Lower_Left_X");
return false;
}
if(yrefkm=="")
{
alert("Please input Lower_Left_Y");
return false;
}
if(dgridkm=="")
{
alert("Please input Resolution");
return false;
}
if(gtopo30=="")
{
alert("Please input Terrel_Data_Input");
return false;
}
if(glazas=="")
{
alert("Please input Landuse_Input");
return false;
}
if(startdate=="")
{
alert("Please input startdate");
return false;
}
if(enddate=="")
{
alert("Please input enddate");
return false;
}
}
else if (modelname == "calpuff")
{
var srcfile=document.getElementById("srcfile").value;
if(srcfile=="")
{
alert("Please upload srcfile");
return false;
}
if(nx=="")
{
alert("Please input Num_Grid_X");
return false;
}
if(ny=="")
{
alert("Please input Num_Grid_Y");
return false;
}
if(xrefkm=="")
{
alert("Please input Lower_Left_X");
return false;
}
if(yrefkm=="")
{
alert("Please input Lower_Left_Y");
return false;
}
if(dgridkm=="")
{
alert("Please input Resolution");
return false;
}
if(gtopo30=="")
{
alert("Please input Terrel_Data_Input");
return false;
}
if(glazas=="")
{
alert("Please input Landuse_Input");
return false;
}
if(startdate=="")
{
alert("Please input startdate");
return false;
}
if(enddate=="")
{
alert("Please input enddate");
return false;
}
}
return true;
}
</script>
Calpuff-Webclient-index.php
最新推荐文章于 2021-03-26 18:32:16 发布