<AppML> Customers - 完整的应用程序


HTML 源代码

  1. <html>
  2. <body>
  3.  
  4. <h1>Customers</h1>
  5.  
  6. <div id="Form01"></div>
  7. <div id="List01"></div><br>
  8. <div id="Orders01"></div>
  9.  
  10. <table id="Template01" class="appmltable" style="width:100%;display:none">
  11. <tr>
  12. <th></th>
  13. <th>Customer</th>
  14. <th>City</th>
  15. <th>Country</th>
  16. <th>Orders</th>
  17. </tr>
  18. <tr id="appml_row">
  19. <td style="cursor:pointer" onclick='customerForm.run("Form01","","#CustomerID#")'>
  20. <img src="Images/appmlPlus.png"></td>
  21. <td>#CustomerName#</td>
  22. <td>#City#</td>
  23. <td>#Country#</td>
  24. <td><a href='' onclick='openOrders(#CustomerID#);return false;'>Orders</a></td>
  25. </tr>
  26. </table>
  27.  
  28. <table id="Template02" class="appmltable" style="width:100%;display:none">
  29. <tr>
  30. <th>Customer</th>
  31. <th>Date</th>
  32. <th>Salesperson</th>
  33. <th>Shipper</th>
  34. </tr>
  35. <tr id="appml_row">
  36. <td>#CustomerName#</td>
  37. <td>#OrderDate#</td>
  38. <td>#Salesperson#</td>
  39. <td>#ShipperName#</td>
  40. </tr>
  41. </table> 
  42.  
  43. <script src="appml.js"></script>
  44.  
  45. <script>
  46. var customers,customerForm,orders;
  47. customers=new AppML("appml.php","Models/Customers");
  48. customers.run("List01","Template01");
  49. customerForm=new AppML("appml.php","Models/Customers");
  50. customerForm.displayType="form";
  51. function openOrders(id)
  52. {
  53. orders=new AppML("appml.php","Models/Orders");
  54. orders.commands=false;
  55. orders.setQuery("orders.customerid",id);
  56. orders.run("Orders01","Template02");
  57. }
  58. </script>
  59.  
  60. </body>
  61. </html>
2015-10-07_202350.png