Location: PHPKode > projects > Replex > replex-0.9.0/admin/domain5.php
<?php
/*************************************************************
$Id: domain5.php,v 1.7 2001/05/19 03:30:31 jimir Exp $ 
 
 ***************************************************************/

include("include/config.php");
include("lib/user.php");
include("lib/search.php");
include("lib/account.php");
include("lib/alias.php");
include("lib/domain.php"); 
include("db/class_mysql.php");

# Authenticate current user
$USER = new User;
if (!$USER->HTTPauthenticate($DBCONN)) {
  $USER->http_refuse();
}

$ACCOUNT = new Account;
$ALIAS   = new Alias;

if(!empty($search_id) && !empty($page)) {
  $ACCOUNT->retrieveAccounts($DBCONN,'search_id',$search_id,'','',$page);
  $show=1;
}

if(!empty($domain)) {
  //we have a domain
  $page=1;
  $s_value["CONTENT"]=$domain;
  $s_value["COLUMN"]=2;
  $sort=1;
  $ACCOUNT->retrieveAccounts($DBCONN,'onedomain',$s_value,$sort,$perpage,$page);
  $show=1;
}
else {
//error page

}

if(empty($page)) {
  $page=1;
}

if(!empty($error)) {
  if($error=="error1") {
    $errormsg="<h3></h3>";	
  }
  
}


$activetab=2;
$showtabs=6;
include("domains3_menu.php");
?>

<% if($show==1): %>
<span class="headline">Accounts</span><br><br>
<%=$errormsg%>
<table border=0>
<tr>
  <td colspan="4">Found <b><%=$ACCOUNT->getAffectedRows()%></b> result(s)</td>
</tr>
<tr>
  <td class="td-hl">Username</td>
  <td class="td-hl">Password</td>
  <td class="td-hl">Domainname</td>
  <td class="td-hl">Alias</td>
</tr>
 <% for($i=0;$i<count($ACCOUNT->username);$i++): %>
 <tr>
   <td class="td-content" valign="top"><a href=domain9.php?account=<%=$ACCOUNT->getUserName($i)%>><%=$ACCOUNT->getUserName($i)%></a></td>
   <td class="td-content" valign="top"><%=$ACCOUNT->getPassword($i)%></td>
   <td class="td-content" valign="top"><%=$ACCOUNT->getDomainName($i)%></td>
   
   <% $ALIAS->retrieveAliasPerAccount($DBCONN,$ACCOUNT->getUserName($i)); %>
   <td class="td-content" align="right" valign="top">
     <% for($a=0;$a<count($ALIAS->alias);$a++): %>
        <% if($ALIAS->getAlias($a)=="@".$ACCOUNT->getDomainName($i)):%>
	  <%="*".$ALIAS->getAlias($a)%><br>
	<% else: %>
	  <%=$ALIAS->getAlias($a)%><br>
	<% endif %>
     <% endfor %>
   </td>
   
 </tr>
 <% endfor %>
</table>
<% endif %>
<% if($ACCOUNT->total_pages>1) { $SEARCH = new Search; if(empty($search_id)) {$SEARCH->generateSearchId($DBCONN,$ACCOUNT->search_sql,$ACCOUNT->perpage); } else { $SEARCH->search_id=$search_id;}	%>
<br>
<table border=0>
<tr>
<td>Result pages: 
<% $s_id=$SEARCH->getSearchId(); if($ACCOUNT->total_pages>5){$countnumber=5;}else {$countnumber=$ACCOUNT->total_pages;} for($i=0;$i<$countnumber;$i++) { if($page==($i+1)){ echo "<b>".$page."</b>&nbsp;";} else {echo "<a href=account1.php?search_id=".$s_id."&page=".($i+1).">".($i+1)."</a>&nbsp;";}} %>
<% if($page!=$ACCOUNT->total_pages) { %><a href=account1.php?search_id=<%=$s_id%>&page=<%=($page+1)%>>Next</a></td><% } %>
</tr>
</table>
<% } %>


<% menu_html_trail() %>	
Return current item: Replex