Calpuff-Webclient-index.php

<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>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值