<?php

/**
 *
 * @copyright  2013-2016 izend.org
 * @version    10
 * @link       http://www.izend.org
 */
?>
<form action="" method="post" class="noprint">
<p>
<input id="usersearch_what" name="usersearch_what" type="text" size="30" maxlength="100" title="" value="<?php echo htmlspecialchars($what, ENT_COMPAT, 'UTF-8'); ?>" onkeypress="return submitonenter(event, 'usersearch_search')" />
<input type="submit" class="submit submit_search" name="usersearch_search" id="usersearch_search" value="Search" />
</p>
</form>
<?php if ($count): $i=1; ?>
<p class="userresult">
<span class="userpagenumber"><?php $s=$count > 1 ? 's' : ''; echo $count; ?></span> user<?php echo $s; ?>
<?php if ($count > $pagesize): ?>
&nbsp;-&nbsp;
<?php
require_once 'pagerange.php';

$npages=ceil($count / $pagesize);
$pagenums=page_range($page, $npages, 2);
?>
<?php foreach ($pagenums as $p): ?>
<?php if ($p==$page): ?>
<span class="userpagenumber"><?php echo $p; ?></span>
<?php else: ?>
<a href="?q=<?php echo urlencode($what); ?>&amp;p=<?php echo $p; ?>"><?php echo $p; ?></a>
<?php endif; ?>
<?php endforeach; ?>
</p>
<?php endif; ?>
<table id="userlist" border="0" cellpadding="4" cellspacing="0" rules="none">
<tbody>
<?php foreach ($result as $r): extract($r);?>
<tr>
<?php if ($with_name): ?>
<td class="username"><?php if ($user_name): ?><?php if ($edit): ?><a href="<?php echo $edit; ?>"><?php endif; ?><?php echo $user_name; ?><?php if ($edit and (!$with_name or !$user_name)): ?></a><?php endif; ?><?php else: ?>&nbsp;<?php endif; ?></td>
<td width="24"><?php if ($user_name): ?><img class="avatar" src="<?php echo $base_path; ?>/avatars/<?php echo $user_name; ?>.png" alt="" width="24" height="24" /><?php else: ?>&nbsp;<?php endif; ?></td>
<?php endif; ?>
<td class="usermail"><?php if ($user_mail): ?><?php if ($edit and (!$with_name or !$user_name)): ?><a href="<?php echo $edit; ?>"><?php endif; ?><?php echo $user_mail; ?><?php if ($edit): ?></a><?php endif; ?><?php else: ?>&nbsp;<?php endif; ?></td>
<td class="userlogged"><?php if ($user_logged): ?><?php echo $user_logged; ?><?php else: ?>&nbsp;<?php endif; ?></td>
<td class="useraccessed"><?php if ($user_accessed): ?><?php echo date('m/d/Y H:i', $user_accessed); ?><?php else: ?>&nbsp;<?php endif; ?></td>
<td class="userlocked"><?php if (!$user_active or $user_banned): ?><span class="icon icon_lock">locked</span><?php else: ?>&nbsp;<?php endif; ?></td>
<?php if ($with_website): ?>
<td class="userwebsite"><?php if ($user_website): ?><a href="http://<?php echo $user_website; ?>"><?php echo $user_website; ?></a><?php else: ?>&nbsp;<?php endif; ?></td>
<?php endif; ?>
</tr>
<?php $i++; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<?php if (!empty($what)): ?>
<p class="userresult"><span class="userpagenumber">0</span> user</p>
<?php endif; ?>
<?php endif; ?>
