Menu
×
   ❮     
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 Case Study - Categories


The HTML Page

This is the HTML source:

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

<div class="w3-container w3-content">
<h1>Categories</h1>
<div id="Form01" class="w3-container w3-light-grey w3-padding-large w3-margin-bottom" appml-data="appml.php?model=model_categoriesform" appml-controller="myFormController" style="display:none;">
  <div appml-include-html="inc_formcommands.htm"></div>
  <p>
    <label>CategoryName:</label>
    <input id="CategoryName" class="w3-input w3-border">
  </p>
  <p>
    <label>Description:</label>
    <input id="Description" class="w3-input w3-border">
  </p>
</div>

<div appml-data="appml.php?model=model_categorieslist">
<div appml-include-html="inc_listcommands_nofilter.htm"></div>
<table class="w3-table-all">
  <tr>
    <th></th>
    <th>Category</th>
    <th>Description</th>
  </tr>
  <tr appml-repeat="records">
    <td style="cursor:pointer" onclick="appml('Form01').run({{CategoryID}})">&#9998;</td>
    <td>{{CategoryName}}</td>
    <td>{{Description}}</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 »


Models

These are the models used in the application:

List Model

{
"database" : {
"connection" : "localmysql",
"sql" : "SELECT * FROM Categories"
}
}

Form Model

{
"database" : {
"connection" : "localmysql",
"sql" : "SELECT * FROM Categories",
"maintable" : "Categories",
"keyfield" : "CategoryID"
},
"updateItems" : [
{"item" : "CategoryName"},
{"item" : "Description"}
]
}

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.