選單
×
   ❮     
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.tw/w3css/4/w3.css">
<script src="https://w3schools.tw/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 提供支援