<?php
###############################
#usersearch.php version 1.1.#
###############################
include ('header.php');
include ('../classes/class.GenericEasyPagination.php');
?>
<script>
function goto(site) {
var msg = confirm("Are you sure you want to delete this user? This action cannot be undone!")
if (msg) {window.location.href = site}
else (null)
}
function gotos(sites) {
var msg = confirm("Are you sure?")
if (msg) {window.location.href = sites}
else (null)
}
</script>
<div id="headermenu">Users</div>
<?php
if(isset($_POST['submit'])) {
$document = $_POST['document'];
?>
Username<br />
<form name="myforma" action="usersearch.php" method="post">
<input type="text" id="incc" value="<?php echo @$document ?>" name="document" /><br /><br />
<input type="submit" class="topicbuton" name="submit" value="Search" />
</form>
<br />
<?php
if(@$_GET["page"] != ""):
$page = @$_GET["page"];
else:
$page = 1;
endif;
define('RECORDS_BY_PAGE',8);
define('CURRENT_PAGE',$page);
$strSQL = " SELECT * FROM users where username like '%$document%' ORDER BY username";
$conn->SetFetchMode(ADODB_FETCH_ASSOC);
$rs = $conn->PageExecute($strSQL,RECORDS_BY_PAGE,CURRENT_PAGE);
if(!$rs->EOF) {
$recordsFound = $rs->_maxRecordCount;
echo "RecordsLits:<br><br>";
while(!$rs->EOF) {
if($rs->fields['active'] == 0) { ?>
<font style="color:#777777"><?php echo $rs->fields['username'] ?> [<?php echo $rs->fields['email'] ?>]<br />
<a href="userset.php?id=<?php echo $rs->fields['usid'] ?>&ref=8"><font style="color:#555">Approve [email not confirmed]</font></a></font><br />
<?php } else { ?>
<br /><font color="#4F5870"><?php echo $rs->fields['username'] ?> [<?php echo $rs->fields['email'] ?>]<br />
<?php if($rs->fields['active'] == 3) { ?>
<a href="userset.php?id=<?php echo $rs->fields['usid'] ?>&ref=8"><font color="#EE6300">Activate (Account Pending Approval)</font></a></font><br />
<?php }
}
echo "<a href=\"javascript:gotos('userset.php?id=".$rs->fields["usid"]."&ref=6&ip=".$rs->fields["ipos"]."')\"><font color='#333333'>Ban this User</font></a>";
echo " <a href=\"javascript:goto('userset.php?id=".$rs->fields["usid"]."&ref=7')\"><font color='#880000'>Delete</font></a><br /><br />";
$rs->moveNext();
}
$GenericEasyPagination = new GenericEasyPagination(CURRENT_PAGE,RECORDS_BY_PAGE,"eng");
$GenericEasyPagination->setTotalRecords($recordsFound);
echo "<br>";
echo "<strong>Records found: </strong>".$recordsFound;
echo "<br>Records ";
echo $GenericEasyPagination->getListCurrentRecords();
echo "<br>";
echo $GenericEasyPagination->getCurrentPages();
echo "<br>";
}
$conn->Close();
} else {
@$document = $_POST['document']; ?>
Username<br />
<form name="myforma" action="usersearch.php" method="post">
<input type="text" id="incc" value="<?php echo @$document ?>" name="document" /><br /><br />
<input type="submit" class="topicbuton" name="submit" value="Search" />
</form>
<?php
$conn->Close();
}
?>
</div></div></div>
<?php include ('footer.php'); ?>