Location: PHPKode > scripts > Impleo Music Collection Script > impleo/templates/add-record.tpl
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
  <title>Impleo Music Collection - Add record</title>
  <link href="style.css" rel="stylesheet" type="text/css" media="screen">
  <script type="text/javascript" src="../ajax/prototype.js"></script>
  <script type="text/javascript" src="../ajax/AutoComplete.js"></script>
  <script type="text/javascript">  
  {literal}function disableKey(evt)
  {
    var evt  = (evt) ? evt : ((event) ? event : null);
    var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
    if ((evt.keyCode == 13) && (node.type=="text")) { return false; }
  }{/literal}
  </script>
</head>
<body>
<div id="container">
  <div id="header">
    <h1>Impleo Music Collection</h1>
  </div>
  <div id="menu">
    <ul>
      <li><a href="./add-record.php">Add record</a></li>
      <li><a href="./edit-records-list.php">Edit/delete records</a></li>
      <li><a href="./detail-types.php">Detail types</a></li>
      <li><a href="./settings.php">Settings</a></li>
      <li><a href="./../">Show</a></li>
    </ul>
  </div>
  <div id="content">
    <h2>Add record</h2>
{if $posted}
{if $hasErrors}
<div class="error">
  <ul>
{foreach from=$errors item=error}  
    <li>{$error}</li>
{/foreach}
  </ul>
</div>
{else}
<p class="success">Record was added!</p>
{/if}
{/if}
    <p>Fields marked with a <span class="star">*</span> are mandatory.</p>
    <form method="post" action="./add-record.php" enctype="multipart/form-data">
    <fieldset>
      <legend>Album info</legend>
      <p>
        <label for="artist">Artist:</label> <span class="star">*</span><br>
        <input type="text" id="artist" name="artist" tabindex="1" size="50" maxlength="255" required="required" onkeypress="return disableKey(event);"{if $posted && $hasErrors} value="{$postValues.artist}"{/if}>
      </p>
      <p>
        <label for="title">Title:</label> <span class="star">*</span><br>
        <input type="text" id="title" name="title" tabindex="2" size="50" maxlength="255" required="required" onkeypress="return disableKey(event);"{if $posted && $hasErrors} value="{$postValues.title}"{/if}>
      </p>
      <p>
        <label for="year">Release year:</label> <span class="star">*</span><br>
        <input type="text" id="year" name="year" tabindex="3" size="50" maxlength="4" required="required" onkeypress="return disableKey(event);"{if $posted && $hasErrors} value="{$postValues.year}"{/if}>
      </p>
	  {foreach from=$details item=add}
      <p>
        <label for="{$add.key}">{$add.name}:</label>{if $add.required} <span class="star">*</span>{/if}<br>
        <input type="text" id="{$add.key}" name="{$add.key}" size="50" maxlength="100"{if $add.required} required="required"{/if} onkeypress="return disableKey(event);"{if $posted && $hasErrors} value="{$postValues[$add.key]}"{/if}>
      </p>
	  {/foreach}
      <script type="text/javascript">
        {literal}new AutoComplete('artist', '../ajax/ac.php?t=artist&s=',{delay: .25, threshold: 1});
		new AutoComplete('title', '../ajax/ac.php?t=title&s=',{delay: .25, threshold: 1});
		new AutoComplete('year', '../ajax/ac.php?t=year&s=',{delay: .25, threshold: 1});{/literal}
		{foreach from=$details item=add}
        new AutoComplete('{$add.key}', '../ajax/ac.php?t={$add.key}&s=',{literal}{delay: .25, threshold: 1}{/literal});
		{/foreach}
      </script>
    </fieldset>
	<fieldset>
	  <legend>Image</legend>
	  <p>
        <input type="file" id="image" name="image" size="50"><br>
		Allowed image formats: PNG, JPG, GIF.
	  </p>  
	</fieldset>
    <p><input type="submit" name="send" value="Add record"></p>
    </form>
  </div>
  <div id="bottom">
    <p class="author"><a href="http://sappy.dk/impleo/">Impleo Music Collection 2.0</a></p>
    <p class="logout"><a href="./?logout">Log out</a></p>
  </div>
</div>
</body>
</html>
Return current item: Impleo Music Collection Script