<?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_VIEWLISTS);
ML_Admin();
br('1');
Max_OpenTable();
$result = $db->sql_query("SELECT * FROM ".$prefix."_nsnml_lists");
$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 width='30%'><b>"._ML_LISTNAME."</b></td>\n";
  echo "<td width='50%'><b>"._ML_LISTDESCRIPTION."</b></td>\n";
  echo "<td align='center' width='10%'><b>"._ML_SUBSCRIBERS."</b></td>\n";
  echo "<td align='center' width='10%'><b>"._ML_FUNCTIONS."</b></td>\n";
  echo "</tr>\n";
  while($list_info = $db->sql_fetchrow($result)) {
    $numusers = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_nsnml_users WHERE lid='".$list_info['lid']."' and active=1"));
    if(!$numusers) { $numusers = 0; }
    echo "<tr bgcolor='$bgcolor1'>\n";
    echo "<td valign='top'>".$list_info['title']."</td>\n";
    echo "<td valign='top'>".$list_info['description']."</td>\n";
    echo "<td align='center' valign='top'><a href='".$admin_file.".php?op=MLViewListSubscribers&amp;lid=".$list_info['lid']."'>".$numusers."</a></td>\n";
    echo "<td align='center' valign='top'><a href='".$admin_file.".php?op=MLEditList&amp;lid=".$list_info['lid']."'><img src='modules/$module_name/images/edit.png' border='0' height='16' width='16' alt='"._EDIT."' title='"._EDIT."'></a>";
    echo "&nbsp;<a href='".$admin_file.".php?op=MLDeleteList&amp;lid=".$list_info['lid']."'><img src='modules/$module_name/images/delete.png' border='0' height='16' width='16' alt='"._DELETE."' title='"._DELETE."'></a></td>\n";
    echo "</tr>\n";
  }
  echo "</table>\n";
} else {
  echo "<center><b>"._ML_NOLISTS."</b></center><br />\n";
  echo "<center>"._GOBACK."</center>";
}
Max_CloseTable();
incof();

?>