ऐपएमएल ट्यूटोरियल

ऐपएमएल होम AppML कैसे करें ऐपएमएल डेटा ऐपएमएल में शामिल हैं ऐपएमएल नियंत्रक ऐपएमएल संदेश ऐपएमएल मॉडल ऐपएमएल एपीआई

ऐपएमएल मामले

केस परिचय केस टेक्स्ट फ़ाइल केस एक्सएमएल फाइल केस JSON फ़ाइल केस ग्राहक केस उत्पाद केस सप्लायर्स केस शिपर्स केस श्रेणियाँ केस कर्मचारी

ऐपएमएल क्लाइंट

ऐपएमएल क्लाइंट ऐपएमएल प्रोटोटाइप ऐपएमएल सूचियां ऐपएमएल फॉर्म ऐपएमएल वेबएसक्यूएल

ऐपएमएल सर्वर

ऐपएमएल पीएचपी एपीपीएमएल एएसपी

ऐपएमएल क्लाउड

गूगल क्लाउड एसक्यूएल अमेज़ॅन आरडीएस एसक्यूएल

ऐपएमएल संदर्भ

ऐपएमएल संदर्भ ऐपएमएल डेटाफाइल्स ऐपएमएल डेटाबेस ऐपएमएल एपीआई ऐपएमएल आर्किटेक्चर ऐपएमएल इतिहास

ऐपएमएल केस स्टडी - आपूर्तिकर्ता


एचटीएमएल पेज

यह एचटीएमएल स्रोत है:

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>Suppliers</title>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<script src="https://www.w3schools.com/appml/2.0.3/appml.js"></script>
</head>
<body>

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

<div id="Form01" class="w3-container w3-light-grey w3-padding-large w3-margin-bottom" appml-data="appml.php?model=model_suppliersform" appml-controller="myFormController" style="display:none;">
  <div appml-include-html="inc_formcommands.htm"></div>
  <p>
    <label>SupplierID:</label>
    <input id="SupplierID" class="w3-input w3-border">
  </p>
  <p>
    <label>SupplierName:</label>
    <input id="SupplierName" class="w3-input w3-border">
  </p>
  <p>
    <label>ContactName:</label>
    <input id="ContactName" class="w3-input w3-border">
  </p>
  <p>
    <label>Address:</label>
    <input id="Address" class="w3-input w3-border">
  </p>
  <p>
    <label>PostalCode:</label>
    <input id="PostalCode" class="w3-input w3-border">
  </p>
  <p>
    <label>City:</label>
    <input id="City" class="w3-input w3-border">
  </p>
  <p>
    <label>Country:</label>
    <input id="Country" class="w3-input w3-border">
  </p>
  <p>
    <label>Phone:</label>
    <input id="Phone" class="w3-input w3-border">
  </p>
</div>

<div appml-data="appml.php?model=model_supplierslist">
<div appml-include-html="inc_listcommands.htm"></div>
<div appml-include-html="inc_filter.htm"></div>
<div class="w3-responsive">
<table class="w3-table-all">
  <tr>
    <th></th>
    <th>Supplier</th>
    <th>City</th>
    <th>Country</th>
    <th></th>
  </tr>
  <tr appml-repeat="records">
    <td style="cursor:pointer" onclick="appml('Form01').run({{SupplierID}})">&#9998;</td>
    <td>{{SupplierName}}</td>
    <td>{{City}}</td>
    <td>{{Country}}</td>
    <td><a href='' onclick="openProducts({{SupplierID}});return false;">Products</a></td>
  </tr>
</table>
</div>
</div>

<div id="ProductsSection" class="w3-container w3-light-grey" appml-data="appml.php?model=model_productslist" appml-controller="myProductsController" style="display:none;padding:50px;margin-top:30px;">
<span onclick="document.getElementById('ProductsSection').style.display='none';" class="w3-button w3-xxlarge w3-right">&times;</span>
<h2>{{records[0]['SupplierName']}}</h2>
<div class="w3-responsive">
<table class="w3-table-all">
  <tr>
    <th>Product</th>
    <th>Category</th>
    <th>Supplier</th>
  </tr>
  <tr appml-repeat="records">
    <td>{{ProductName}}</td>
    <td>{{CategoryName}}</td>
    <td>{{SupplierName}}</td>
  </tr>
</table>
</div>
</div>
</div>

<script>
function openProducts(id) {
  appml("ProductsSection").clearQuery();
  appml("ProductsSection").setQuery("Products.SupplierID", id);
  appml("ProductsSection").run();
  document.getElementById("ProductsSection").style.display = "";
}
function myFormController($appml) {
  if ($appml.message == "ready") {return -1;}
  if ($appml.message == "loaded") {
    document.getElementById("Form01").style.display = "";
  }
}
function myProductsController($appml) {
  if ($appml.message == "ready") {return -1;}
}
</script>
</body>
</html>
पीएचपी »

मॉडल

ये एप्लिकेशन में उपयोग किए जाने वाले मॉडल हैं:

सूची मॉडल

{
"database" : {
"connection" : "localmysql",
"sql" : "SELECT * FROM Suppliers",
"orderby" : "SupplierName"
},
"filteritems" : [
{"item" : "SupplierName"},
{"item" : "City"},
{"item" : "Country"}
],
"sortitems" : [
{"item" : "SupplierName"},
{"item" : "City"},
{"item" : "Country"}
],
"rowsperpage" : 10
}

फॉर्म मॉडल

{
"database" : {
"connection" : "localmysql",
"sql" : "SELECT * FROM Suppliers",
"maintable" : "Suppliers",
"keyfield" : "SupplierID"
},
"updateItems" : [
{"item" : "SupplierID"},
{"item" : "SupplierName"},
{"item" : "ContactName"},
{"item" : "Address"},
{"item" : "PostalCode"},
{"item" : "City"},
{"item" : "Country"},
{"item" : "Phone"}
]
}