zoukankan      html  css  js  c++  java
  • chapter01 Bob'store

    
    
    
    
    
    
    
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     2 <HTML>
     3  <HEAD>
     4   <TITLE> 不知道起什么名的论坛 </TITLE>
     5   <META NAME="Generator" CONTENT="EditPlus">
     6   <META NAME="Author" CONTENT="">
     7   <META NAME="Keywords" CONTENT="">
     8   <META NAME="Description" CONTENT="">
     9  </HEAD>
    10 
    11 <BODY>
    12   论坛首页
    13  <form action="processorder.php" method="post">
    14  <table border="1">
    15  <tr bgcolor="#cccccc">
    16     <td width="150">Item</td>
    17     <td width="15">Quantity</td>
    18  </tr>
    19  <tr>
    20     <td>Tires</td>
    21     <td><input type="text" name="tireqty"></td>
    22  </tr>
    23 <tr>
    24     <td>Oil</td>
    25     <td><input type="text" name="oilqty"/></td>
    26   </tr>
    27 <tr>
    28     <td>Spark plugs</td>
    29     <td><input type="text" name="sparkqty"/></td>
    30 </tr>
    31 <tr>
    32     <td>How did you find Bob' ?</td>
    33     <td><select name= "find">
    34         <option value="a">I'm a regular customer</option>
    35         <option value="b">TV adversion</option>    
    36         <option value="c">Phone directory</option>
    37         <option value="d">word of mouth</option>
    38         </select>
    39     </td>
    40 </tr>
    41 <tr>
    42     <td colspan="2" align="center"><input type="submit" value="Submit Order"/></td>
    43 </tr>
    44 
    45   </table>
    46   </form>
    47  </BODY>
    48  <SCRIPT LANGUAGE="JavaScript">
    49   
    50  </SCRIPT>
    51 </HTML>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> freight </TITLE>
      <META NAME="Generator" CONTENT="EditPlus">
      <META NAME="Author" CONTENT="">
      <META NAME="Keywords" CONTENT="">
      <META NAME="Description" CONTENT="">
     </HEAD>
    
     <BODY>
     <table>
     <tr bgcolor="#cccccc">
        <td>Distance</td>
        <td>Cost</td>
     </tr>
        <?php
        $distance=50;
        while($distance<=250){
            echo"<tr>
            <td align="right">".$distance."</td>
            <td align="right">".($distance/10)."</td>
            </tr>
    ";
            $distance+=50;
        }
        
        ?>
    </table>
     </BODY>
     <SCRIPT LANGUAGE="JavaScript">
      
     </SCRIPT>
    </HTML>
    <html>
    <head>
    <title>Bob' Auto Parts - Order Results</title>
    </head>
    <body>
    <?php
     //create  variable
     $tireqty = $_POST['tireqty'];
     $oilqty = $_POST['oilqty'];
     $sparkqty = $_POST['sparkqty'];
    ?>
    <h1>Bob' Auto Parts</h1>
    <h2>Order Results</h2>
    <?php 
        echo"<p>Order processed at ".date('H:i js F')."</p>";
        //echo '<p>your order is as follows:</p>';
        //echo $tireqty.'tires</br>';
        //echo "$tireqty tires</br>";
        //echo $oilqty.'bottles</br>';
        //echo $sparkqty.'spark plugs</br>';
    
        $totalqty = 0;
        $totalamout = 0.00;
    
        define('TIREPRICE',100);
        define('OILPRICE',10);
        define('SPARKPRICE',4);
        $totalqty = $tireqty + $oilqty + $sparkqty;
        $totalamout = $tireqty*TIREPRICE 
                    + $oilqty*OILPRICE
                    + $sparkqty*SPARKPRICE;
    
        echo "Items order : $totalqty</br>";
        echo "Subtaotal: $".number_format($totalamout,2)."<br/>";
    
        $taxrate = 0.10;  //local tax10%
        $totalamout = $totalamout*(1+$taxrate);
        echo "Total include tax :$".number_format($totalamout,2)."<br/>";
         //where customer from
        $find = $_POST['find'];
        /*echo "$find";
        switch($find){
         case "a":
          echo "regular customer";
          break;
         case "b":
          echo "customer by tv";
          break;
         case "c":
          echo "customer by Phone";
          break;
         case "d":
          echo "customer by word of mouth";
          break;
         default:
          echo "we  do not know";
        
        }*/
        if($find == "a"){
          echo "<p>Regular Customer</p>";
        }elseif ($find == "b"){
          echo "<p>Customer by TV </p>";
        }elseif ($find == "c"){
            echo "<p>Customer by phone</p>";
        }elseif ($find == "d"){
            echo "<p>Customer by word of mouth</p>";
        }else {
            echo "<p>we do not know</p>";
        }
        
    ?>
    </body>
    </html>
  • 相关阅读:
    atitit.基于http json api 接口设计 最佳实践 总结o7
    atitit.表单验证 的dsl 本质跟 easyui ligerui比较
    Atitit. 提升软件开发效率and 开发质量---java 实现dsl 4gl 的本质and 精髓 O725
    atitit.设计模式(2) -----查表模式/ command 总结
    atitit.spring3 mvc url配置最佳实践
    atitit.java给属性赋值方法总结and BeanUtils 1.6.1 .copyProperty的bug
    atitit.RESTful服务的概览and框架选型
    atitit.查看预编译sql问号 本质and原理and查看原生sql语句
    atitit.atitit.hb many2one relate hibernate 多对一关联配置..
    atitit.hbnt orm db 新新增更新最佳实践o7
  • 原文地址:https://www.cnblogs.com/amurzet/p/5879143.html
Copyright © 2011-2022 走看看