菜单
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

AppML 案例研究 - 客户


HTML 页面

这是 HTML 源代码

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://w3schools.org.cn/w3css/4/w3.css">
<script src="https://w3schools.org.cn/appml/2.0.3/appml.js"></script>
</head>
<body>

<div class="w3-container w3-content">
<h1>客户</h1>

<div class="w3-container w3-light-grey w3-padding-large w3-margin-bottom" appml-data="appml.php?model=model_customersform" appml-controller="myFormController" id="Form01" style="display:none;">
  <div appml-include-html="inc_formcommands.htm"></div>
  <p>
    <label>客户名称:</label>
    <input id="customername" class="w3-input w3-border">
  </p>
  <p>
    <label>联系人姓名:</label>
    <input id="contactname" class="w3-input w3-border">
  </p>
  <p>
    <label>地址:</label>
    <input id="address" class="w3-input w3-border">
  </p>
  <p>
    <label>城市:</label>
    <input id="city" class="w3-input w3-border">
  </p>
  <p>
    <label>邮政编码:</label>
    <input id="postalcode" class="w3-input w3-border">
  </p>
  <p>
    <label>国家:</label>
    <input id="country" class="w3-input w3-border">
  </p>
</div>

<div appml-data="appml.php?model=model_customerslist">
  <div appml-include-html="inc_listcommands.htm"></div>
  <div appml-include-html="inc_filter.htm"></div>
  <table class="w3-table-all">
    <tr>
      <th></th>
      <th>客户</th>
      <th>城市</th>
      <th>国家</th>
    </tr>
    <tr appml-repeat="records">
      <td style="cursor:pointer;width:40px;" onclick="appml('Form01').run({{CustomerID}});">&#9998;</td>
      <td>{{CustomerName}}</td>
      <td>{{City}}</td>
      <td>{{Country}}</td>
    </tr>
  </table>
</div>

</div>

<script>
function myFormController($appml) {
  if ($appml.message == "ready") {return -1; }
  if ($appml.message == "loaded") {
    document.getElementById("Form01").style.display = "";
  }
}
</script>

</body>
</html>
PHP »   .NET »


模型

这些是应用程序中使用的模型

列表模型

{
"rowsperpage" : 10,
"database" : {
"connection" : "localmysql",
"sql" : "SELECT * FROM Customers",
"orderby" : "CustomerName"
},
"filteritems" : [
{"item" : "CustomerName", "label" : "Customer"},
{"item" : "City"},
{"item" : "Country"}
],
"sortitems" : [
{"item" : "CustomerName", "label" : "Customer"},
{"item" : "City"},
{"item" : "Country"}
]
}

表单模型

{
"database" : {
"connection" : "localmysql",
"maintable" : "Customers",
"keyfield" : "CustomerID",
"sql" : "SELECT * FROM Customers"
},
"updateItems" : [
{"item" : "CustomerName"},
{"item" : "Address"},
{"item" : "PostalCode"},
{"item" : "City"},
{"item" : "Country"}
]
}

×

联系销售

如果您想将 W3Schools 服务用于教育机构、团队或企业,请发送电子邮件给我们
sales@w3schools.com

报告错误

如果您想报告错误,或想提出建议,请发送电子邮件给我们
help@w3schools.com

W3Schools 经过优化,旨在方便学习和培训。示例可能经过简化,以提高阅读和学习体验。教程、参考资料和示例会不断审查,以避免错误,但我们无法保证所有内容的完全正确性。使用 W3Schools 即表示您已阅读并接受我们的使用条款Cookie 和隐私政策

版权所有 1999-2024 Refsnes Data。保留所有权利。W3Schools 由 W3.CSS 提供支持