<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts Multicart                     |
// +----------------------------------------------------------------------+
// | Authors: Programmer<programmer@armia.com>        		              |
// +----------------------------------------------------------------------+
// | Copyrights Armia Systems, Inc and iScripts.com (C) 2005                |
// | All rights reserved                                                  |
// +----------------------------------------------------------------------+
// | This script may not be distributed, sold, given away for free to     |
// | third party, or used as a part of any internet services such as      |
// | webdesign etc.                                                       |
// +----------------------------------------------------------------------+
?>
<?php
include "../includes/config.php";
include "../includes/session.php";
include "../includes/functions.php";

if (get_magic_quotes_gpc()) {
    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE); 
} 

if(isset( $_SESSION["sess_adminname"]) and $_SESSION["sess_adminname"]!= ""){
	$adminname = $_SESSION["sess_adminname"];
}else{
	header("Location:login.php");
	exit;
}

$txtSubject = trim($_POST["txtSubject"]);
$txtMailContent = trim(stripslashes($_POST["txtMailContent"]));

if($_POST["btnSendMail"] == SEND_MAIL){
	$message = "";
	if(!isNotNull($txtSubject)){
		$message .= "* ".SUB_EMPTY."!<br>";
	}
	if(!isNotNull($txtMailContent)){
		$message .= "* ".CONTENT_EMPTY."!<br>";
	}
	
	if($message== ""){
	
	
/*---------Multicart 2.2 Upgradation-----------*/	

$message  = getNewslettersubscribersList($txtSubject,$txtMailContent);
$txtSubject="";
$txtMailContent="";
}	
}		


if(isset($_GET["msg"]) and $_GET["msg"]!=""){
	$msg = $_GET["msg"];
	switch($msg){
		case "deleted": 
		$message = MSG_USER_DELETED;break;
		default:
			;
	} // switch
	
}

include "../includes/htmltop.php";
?>

<script type="text/javascript" src="<?php echo SITE_URL?>/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
	window.onload = function()
	{
		CKEDITOR.replace( 'editor1' );
	};
</script>
		<body>
		
		<center>
		
		<div align="left" id="layout">
		
		
				
				
				<!--header area start -->
<?php

	include_once("../includes/topheader_admin.php")

?>
				
				<!--header area end -->
			<div align="left" class="main_body">
				<!--main body start -->
<?php
		include_once("../includes/admintopmenu.php")
?>		
					<div align="left" class="content_area">
					
					<!--content area start -->
					<div align="left" class="page_title"><?php echo CREATE_NL;?></div>
					<div align="center" class="text_information grey_tr"><?php echo $message?></div>
            		<br>
											
					<div align="left">			
					
					<form name="frmFeedback" action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
						<table cellpadding="0" cellspacing="0" width="100%" class="manage_table">
							<tr><td colspan="3">&nbsp;</td></tr>
							<tr><td colspan="3" align="right"><span class="required">*</span>&nbsp;<?php echo FIELDS_ARE_MANDATORY;?></td></tr>
							
							<!-- <tr><td align="left" valign=top>To&nbsp;<span class="required">*</span></td><td >&nbsp;</td>
								<td valign=top align="left"><?php //echo makeDropDownList("ddlArtist[]", $artistlist, $ddlArtist, false, 'textbox', ' multiple size=10 cols=40 ', $behaviors)?></td>
							</tr>  -->
							<tr><td align="right" valign=top><?php echo SUBJECT;?>&nbsp;<span class="required">*</span></td>
							<td >&nbsp;</td>
								<td valign=top align="left"><input class="textarea2" type="text" name="txtSubject" value="<?php echo htmlentities(stripslashes($txtSubject))?>" size="60" maxlength="255"></td>
							</tr>
							<tr><td align="right" valign=top><?php echo MAIL_CONTENT;?>&nbsp;<span class="required">*</span></td>
							<td >&nbsp;</td>
								<td valign=top align="left">
								  <textarea id="editor1" name="txtMailContent"><?php echo  stripslashes($txtMailContent);?></textarea>
							</td>
							</tr>
							<tr><td colspan="3">&nbsp;</td></tr>
							<tr><td colspan="3" align="center">
								<input type="submit" value="<?php echo SEND_MAIL;?>" name="btnSendMail" class="button">
								
								</td>
							</tr>
							<tr><td colspan="3">&nbsp;</td></tr>
						</table>
					</form>
					
					</div>
						
						
				<!--content area end-->
								
				</div>
				
								
					<div align="left" class="clear_float"><img src="<?php echo $imagefolder;?>/clear.gif" alt="" width="1" height="1" /></div>
				<!--main body end -->
				</div>
				
				
<?php 
	include "../includes/footer.php";
?>