#set $melati.ResponseContentType = "text/html"
#set $ml = $melati.HTMLMarkupLanguage

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
 <title>Contacts Example</title>
 <SCRIPT src="$melati.JavascriptLibraryURL/validation.js"></SCRIPT>
</head>
<body bgcolor="#ffffff">
<h1>
  A very simple Melati Application
</h1>
<p>
  It allows you to enter contacts into a database, and search them.
</p>
<p>
  The source code is available in 
  <a href=/melati-static/example/contacts/>
     <tt>org/melati/example/contacts/</tt>
  </a>
</p>
<p>
  The database can also be viewed using the
<a href=$melati.ZoneURL/org.melati.admin.Admin/$melati.PoemContext.LogicalDatabase/Main>Admin System</a>.
</p>
<hr>
<table border=1 cellpadding=5 width="60%">
<tr>
 <td>
  <a href=$melati.ZoneURL/org.melati.example.contacts.ContactView/contact/Insert>Add a new Contact</a>
 </td>
 <td>
  <a href=$melati.ZoneURL/org.melati.admin.Admin/contacts/category/Add>Add a new Category</a>
 </td>
<tr>
</table>

<h2>Search the Contacts</h2>
<form>
<table>
 <tr>
  <td>$ml.rendered($name.DisplayName):</td>
  <td>$ml.input($name)</td>
 </tr>
 <tr>
  <td>$ml.rendered($category.DisplayName):</td>
  <td>$ml.searchInput($category,"Any")</td>
 </tr>
 <tr>
  <td colspan=2 align=center>
   <input type=submit name=submit value="submit">
  </td>
 </tr>
</table>
</form>
#if ($results) #begin
<table>
#foreach $item in $results #begin
<tr>
 <td><a href=$melati.ZoneURL/org.melati.example.contacts.ContactView/contact/$item.Troid/View>edit</a></td>
 <td>$ml.rendered($item.Name), $ml.rendered($item.Address)</td>
</tr>
#end
</table>
#end

</body>
</html>



