<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
/********************************************************/
/* NSN Mailing List                                     */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright © 2000-2005 by NukeScripts Network         */
/********************************************************/

$pagetitle = " - "._ML_ADMIN." ".$ml_config['version_number'];
incoh();
title(_ML_VIEWSUBSCRIBERS);
ML_Admin();
br('1');
Max_OpenTable();
$result = $db->sql_query("SELECT * FROM ".$prefix."_nsnml_users WHERE active>'0' ORDER BY email");
$num = $db->sql_numrows($result);
if($num) {
  echo "<table border='0' width='100%' align='center' bgcolor='$bgcolor2'>\n";
  echo "<tr bgcolor='$bgcolor2'>\n";
  echo "<td><b>"._ML_EMAIL."</b></td>\n";
  echo "<td align='center'><b>"._ML_TYPE."</b></td>\n";
  echo "<td align='center'><b>"._ML_ISSUES."</b></td>\n";
  echo "<td align='center'><b>"._ML_JOINED."</b></td>\n";
  echo "<td align='center'><b>"._ML_STATUS."</b></td>\n";
  echo "<td align='center'><b>"._ML_LISTNAME."</b></td>\n";
  echo "</tr>\n";
  while($user_info = $db->sql_fetchrow($result)) {
    echo "<tr bgcolor='$bgcolor1'>\n";
    echo "<td>".$user_info['email']."</td><td align='center'>";
    if ($user_info['type'] == '1') { echo _ML_TYPEHTML; } else { echo _ML_TYPETEXT; }
    echo "</td>\n";
    $issues = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_nsnml_tracked WHERE mid='".$user_info['mid']."'"));
    echo "<td align='center'><a href='".$admin_file.".php?op=MLViewSent&amp;mid=".$user_info['mid']."'>".$issues."</a></td>\n";
    echo "<td align='center'>".date($ml_config['date_format'], $user_info['joined'])."</td><td align='center'>";
    if ($user_info['active'] == '1') { echo _ML_ACTIVATED; } else { echo _ML_PENDING; }
    echo "</td>\n";
    $list_info = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_nsnml_lists WHERE lid='".$user_info['lid']."'"));
    echo "<td align='center'><a href='".$admin_file.".php?op=MLViewListSubscribers&amp;lid=".$user_info['lid']."'>".$list_info['title']."</a></td>\n";
    echo "</tr>\n";
  }
  echo "</table>\n";
} else {
  echo "<center><b>"._ML_NOSUBSCRIBERS."</b></center><br />\n";
  echo "<center>"._GOBACK."</center>";
}
Max_CloseTable();
incof();

?>