Viewing file: archives.php (2 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
$msg_id = (empty($_GET['msg_id']) ? "" : $_GET['msg_id']);
$msg_id = (empty($_POST['msg_id']) ? $msg_id : $_POST['msg_id']);
echo " <script language=\"javascript\" type='text/javascript'>
function deleteArchive() {
document.archive_form.elements['action'].value = 'delete';
document.archive_form.submit();
}
</script>";
echo "<div class='subsection'>";
echo "<div class='subtitle'>".translate("ARCHIVE_TITLE")."</div>";
echo "<div class='subcontent'>";
echo "<form action=\"index.php\" method=\"post\" name=\"archive_form\" class='form-light'>";
$newsletter = new Newsletter();
$newsletter->getConfig($conf->db_host, $conf->db_login, $conf->db_pass, $conf->db_name, $list_id,$conf->table_listsconfig);
if(!empty($msg_id) && $action=="delete")
$deleted=$newsletter->deleteArchive($conf->table_archives, $msg_id);
if($newsletter->getArchivesselectList($conf->table_archives, $msg_id)!=-1){
echo "<input type=\"submit\" value=\"".translate("ARCHIVE_DISPLAY")."\" /> \n";
echo "<input type=\"button\" value=\"".translate("ARCHIVE_DELETE")."\" onclick=\"deleteArchive();\" />\n";
echo "<input type=\"hidden\" name=\"page\" value=\"archives\" />\n";
echo "<input type=\"hidden\" name=\"action\" value=\"\" />\n";
echo "<input type=\"hidden\" name=\"list_id\" value=\"$list_id\" />\n";
echo "<br /> ";
}
else echo info_msg(translate("NO_ARCHIVE"));
echo "</form>";
echo "</div>";
echo "</div> <br /> <br />";
if(!empty($msg_id)&& empty($action)){
$newsletter->getArchiveMsg($conf->table_archives, $msg_id);
}
if(!empty($msg_id) && $action=="delete")
{
//echo "<div class=\"title\">".translate("ARCHIVE_DELETE_TITLE")."</div><br />\n";
if($deleted)
echo "<div align=\"center\" class=\"success\">".translate("ARCHIVE_DELETED").".</div>";
else
echo "<div align=\"center\" class=\"error\">".translate("ERROR_DELETING_ARCHIVE").".</div>";
}
?>
|