<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>{$CONFIG.site_title} | User Administration</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="/templates/css/all.css" />
		<!--[if lte IE 6]><link rel="stylesheet" type="text/css" media="screen" href="/templates/css/ie.css" /><![endif]-->
		<link rel="icon" href="/templates/img/favicon.ico" type="image/x-icon" />
		<script src="/js/jquery-1.2.6.pack.js" type="text/javascript"></script>
		<script src="/js/jquery.jeditable.js" type="text/javascript" charset="utf-8"></script>
		<script src="/js/jquery.tablesorter.min.js"></script>
		<script type="text/javascript" charset="utf-8">
		jQuery(document).ready(function() {ldelim}
		     jQuery(".edit").editable("{$_SERVER.REQUEST_URI}", {ldelim}
			 indicator : "Saving...",
			 tooltip   : 'Click to edit...',
			 onblur    : 'submit'
		 {rdelim});
		jQuery(".edit_level").editable("{$_SERVER.REQUEST_URI}", {ldelim} 
		     data   : "{ldelim}{section name=row loop=$levels_list}'{$levels_list[row].title}':'{$levels_list[row].title}',{/section}{rdelim}",
		     type   : "select",
		     onblur    : 'submit',
		     indicator : "Saving..."
		 {rdelim});
		jQuery(".edit_enabled").editable("{$_SERVER.REQUEST_URI}", {ldelim} 
                     data   : "{ldelim}'Enabled':'Enabled','Disabled':'Disabled',{rdelim}",
                     type   : "select",
		     onblur    : 'submit',
		     indicator : "Saving..."
                 {rdelim});
		jQuery("#sortable").tablesorter(); 
		{rdelim});
		</script>
	</head>
	<body id="activity">
		<div id="pagebody">
			<div id="content_container">
				{include file="$TEMPLATES/includes/header.tpl"}
				<div id="content">
					{include file="$TEMPLATES/includes/admin_side_menu.tpl"}
					<div class="main">
					<table id="sortable">
					<thead>
					<tr>
						<th>First</th>
						<th>Last</th>
						<th>E-Mail</th>
						<th>Access&nbsp;Level</th>
						<th>Enabled</th>
						<th>Last&nbsp;Access&nbsp;Timestamp</th>
						<th>Delete</th>
					</tr>
					</thead>
					<tbody>
					{section name=row loop=$user_list}
					<tr>
						<td><div class="edit" id="{$user_list[row].id}_first">{$user_list[row].first}</div></td>
						<td><div class="edit" id="{$user_list[row].id}_last">{$user_list[row].last}</div></td>
						<td><div class="edit" id="{$user_list[row].id}_email">{$user_list[row].email}</div></td>
						<td><div class="edit_level" id="{$user_list[row].id}_level">{$user_list[row].level_title}</div></td>
						<td><div class="edit_enabled" id="{$user_list[row].id}_enabled">{if $user_list[row].enabled == 1}Enabled{else}Disabled{/if}</div></td>
						<td><a title="{$user_list[row].datetime_access|date_format:"%A, %B %e, %Y %I:%M:%S %r"}">{if $user_list[row].datetime_access !== '0000-00-00 00:00:00'}{$user_list[row].datetime_access|date_format:"%Y-%m-%d&nbsp;%I:%M:%S"}{/if}</a></td>
						<td>
						<form method="post" action="{$_SERVER.REQUEST_URI}">
						<input type="hidden" name="id" value="{$user_list[row].id}_delete" />
						<input type="submit" value="X" class="input_button" />
						</form>
						</td>
					</tr>
					{/section}
					</tbody>
					<thead>
					</table>

					<table>
					<tr>
                                                <form method="post" action="{$_SERVER.REQUEST_URI}">
                                                <th><input name="first" class="input_text" /></th>
                                                <th><input name="last" class="input_text" /></th>
                                                <th><input name="email" class="input_text" /></th>
                                                <th>
                                                <select name="level">
                                                {section name=row loop=$levels_list}
                                                <option>{$levels_list[row].title}</option>
                                                {/section}
                                                </select>
                                                </th>
                                                <th colspan="3"><input type="submit" value="Add New User" class="input_text" /></th>
                                                </form>
                                        </tr>
					</thead>
					</table>
					</div>
				</div>
			{include file="$TEMPLATES/includes/footer.tpl"}
			</div>
		</div>
	</body>
</html>
