<?php
/*
NmnNewsletter is a library that provides newsletter service
management for websites running php and mysql.
Copyright (C) 2006 Ivan Preziosi from netmeans.net - Rome.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
For more informations or to join the development of the library contact
the author at: hide@address.com
*/
session_start();
require_once('includes/config.php');
sessCtrl();
$action = $_REQUEST["action"];
$idNewsletter = $_REQUEST["id_newsletter"];
if ($action == "del" && is_numeric($idNewsletter) && $idNewsletter > 0){
if(Newsletter::deleteNewsletter($idNewsletter)){
$msg = "<div class=message>".LIST_DELETE_CONFIRM."<br></div>";
}else{
$msg = "<div class=message><span style='color:red;'>".LIST_DELETE_ERROR."<br></span></div>";
}
}
$main .= "
<div class=page_heading>".LIST_TITLE."</div>
$msg
<p align=left>
".LIST_SUBTITLE."
</p>
";
$newsletters = Newsletter::getNewslettersArray();
foreach ($newsletters as $newsletter){
$main .= "<div class='message' style='margin:3px;text-align:left;'>";
$main .= "<table width='100%'><tr><td width='52%'>".$newsletter['titolo']."</td><td width='15%'>".$newsletter['data']."</td><td align='right' width='33%'>[<a href=\"compose.php?type=html&id_nl=".$newsletter['id']."\">".LIST_EDIT_LINK."</a>] | [<a href=\"javascript:confirmClick('".LIST_SEND_CONFIRM."','send.php?id_newsletter=".$newsletter['id']."');\">".LIST_SEND_LINK."</a>] <br /> [<a href=\"logs.php?id_newsletter=".$newsletter['id']."\">".LIST_LOG_LINK."</a>] | [<a href=\"javascript:confirmClick('".LIST_DELETE_ASK_CONFIRM."','?action=del&id_newsletter=".$newsletter['id']."');\">".LIST_DELETE_LINK."</a>] <br /> [<a href=\"#\" onclick=\"window.open('previewNewsletter.php?id_newsletter=".$newsletter['id']."','preview','width=800,height=600,scrollbars=yes')\">".LIST_PREVIEW_LINK."</a>] | [<a href=\"#\" onclick=\"window.open('presend.php?id_newsletter=".$newsletter['id']."','presend','width=400,height=250,scrollbars=no')\">".LIST_PRESEND_LINK."</a>]</td></tr></table>";
$main .= "</div>";
}
if(isset($_SESSION["navigation"])) $main .= $_SESSION["navigation"];
unset($_SESSION["navigation"]);
$page = "nl list";
require_once("includes/template.php");
?>