<?php require('style/layout/header.php'); ?>
<div class="content_left">
<ul id="breadcrumbs">
<li><a href="index.php"><?php echo $lang['main_page']; ?></a></li>
<li><a href="myprofile.php"><?php echo $lang['user_area']; ?></a></li>
<li><a href="userlist.php" class="actual"><?php echo $lang['user_list']; ?></a></li>
</ul>
</div>
<div class="content_right"><form method="post" id="search" action="search.php?search">
<input type="text" name="search" placeholder="<?php echo $lang['enter_search_term']; ?>..." class="searchfield">
<input type="hidden" name="submit" value="<?php echo $lang['search']; ?>" alt="<?php echo $lang['search']; ?>">
</form>
</div>
<div class="clear"></div>
<div id="headline"> </div>
<?php
if(!isset($_SESSION['signed_in'])) {
echo '<p class="false">' . $lang['only_for_registered'] . '</p>
<p>' . $lang['you_have_to'] . ' <a href="signin.php">' . $lang['small_signin'] . '</a>. ' . $lang['not_yet'] . ' <a href="signup.php">' . $lang['registered'] . '</a>?</p>';
}else{
echo '<h1>' . $lang['user_list'] . '</h1>';
if(isset($_POST['submit'])) {
$error = FALSE;
if(empty($_POST['search'])) {
$error = TRUE;
echo '<p class="false">' . $lang['enter_search_term'] . '</p>
<p>[ <a href="userlist.php">' . $lang['to_user_list'] . '</a> ]</p>';
}
if(!$error) {
$text = htmlentities($_POST['search']);
$query = "SELECT
user_id,
user_name,
user_email
FROM
users
WHERE
user_name LIKE '%$text%' OR user_id LIKE '%$text%' OR user_email LIKE '%$text%'
ORDER BY
user_id DESC";
$result = mysql_query($query) OR die(mysql_error());
if($result) {
echo '<p><small><u>' . intval(mysql_num_rows($result)) . '</u> ' . $lang['matches_found'] . ':</small></p>';
while($row = mysql_fetch_assoc($result)) {
echo '<p>• <a href="profile.php?user_id=' . (int)$row['user_id'] . '">' . htmlentities($row['user_name'], ENT_QUOTES) . '</a></p>';
}
echo '<p>[ <a href="userlist.php">' . $lang['search_again'] . '?</a> ]</p>';
}else{
echo '<p class="false"><small>' . $lang['no_matches'] . '</small></p>
<p>[ <a href="userlist.php">' . $lang['to_user_list'] . '</a> ]</p>';
}
}
}else{
echo '<form id="search" action="userlist.php?search" method="post">
<input type="text" name="search" size="30" class="textfields">
<input type="submit" name="submit" value="' . $lang['search'] . '" alt="' . $lang['search'] . '" class="buttons"><br>
<small>' . $lang['search_for_users'] . '</small>
</form>';
$inquiry = mysql_query("SELECT user_id FROM users");
$total = intval(mysql_num_rows($inquiry));
echo '<div class="clear_blog"></div>
<p><span class="green">' . (int)$total . ' ' . $lang['registered_user'] . '</span></p>';
}
echo '<table width="100%" class="tables">
<tr>
<td width="10%"><strong>User ID</strong></td>
<td width="45%"><strong>User Name</strong></td>
<td width="25%" align="right"><strong>' . $lang['last_signin'] . '</strong></td>
<td width="20%" align="right"><strong>' . $lang['date_of_register'] . '</strong></td>
</tr>';
$count = mysql_query("SELECT user_id FROM users");
include('framework/navigation.php');
$sql = "SELECT user_id, user_name, user_date, user_status FROM users ORDER BY user_date DESC LIMIT $start,$entries";
$users = mysql_query($sql) OR die(mysql_error());
if(!$users) {
echo '<p class="false">' . $lang['no_registered_users'] . '</p>' . mysql_error();
}else{
if(intval(mysql_num_rows($users)) == 0) {
echo '<p class="false">' . $lang['no_registered_users'] . '</p>';
}else{
while($row = mysql_fetch_assoc($users)) {
echo '<tr>
<td width="10%">' . htmlentities($row['user_id'], ENT_QUOTES) . '</td>
<td width="45%"><a href="profile.php?user_id=' . (int)$row['user_id'] . '">' . htmlentities($row['user_name'], ENT_QUOTES) . '</a></td>
<td width="25%" align="right">'; if($row['user_status'] > 0) { echo date('d.m.Y', strtotime($row['user_status'])); }else{ echo $lang['no_signin']; }
echo '</td><td width="20%" align="right"> ' . date('d.m.Y - H:i', strtotime($row['user_date'])) . '</td></tr>';
}
echo '</table>
<div class="clear_blog"></div>';
echo '<div id="navigation">
<span class="pages">' . $lang['page'] . ' ' . $page . ' ' . $lang['of'] . ' ' . $allsites . '</span>';
echo $link_string;
echo '</div>
<div class="clear_navi"></div>';
}
}
}
?>
<?php require('style/layout/footer.php'); ?>