<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: 			*/
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004-2010 ARMIA INC                                    |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts VistaCart                     |
// +----------------------------------------------------------------------+
// | Authors: Jipson<jipson.thomas@armiasystems.com>             		  |
?>
<?php echo $javascript->link('jquery.js'); ?>
<script language="javascript" type="text/javascript">
function chk(thisform){
	    var errorstr = '';
	    var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";
	    var i=0;		
		var fcs_fld=new Array();		
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;   /* For Email Address*/
		
		
		if ($.trim($('#NewsletteruserUname').val())=='') { errorstr += "- Please enter Subscriber's User Name.\n";   fcs_fld[i]='NewsletteruserFname'; i++;}		
	
		if ($.trim($('#NewsletteruserEmail').val())=='') { errorstr += "- Please enter Subscriber's  Email Address.\n";   fcs_fld[i]='NewsletteruserEmail'; i++;}
		if ($.trim($('#NewsletteruserEmail').val())!='') 
		{
		 if(reg.test($.trim($('#NewsletteruserEmail').val())) == false) { errorstr += "- Please enter a valid Email Address.\n";   fcs_fld[i]='NewsletteruserEmail'; i++;}
		}	
	
	if (errorstr != '')
	{
		msgstr = msgstr + errorstr;
		alert(msgstr);
		$('#'+fcs_fld[0]+'').focus();$('#'+fcs_fld[0]+'').select();
		return false;
	}
	else
	{
		thisform.submit();
		return true;
	}
}
</script>
<div align="center" class="subheading">
              <div align="left">Newsletter Subscribers</div>
            </div>
            <br />
			<?php if($session->check('Message.flash')) { ?><div id="okbox"><font color="#446423"><?php $session->flash(); ?></font></div><?php } ?>			
			
            <div align="left" id="item_details_admin">
              <!--items display area start -->
              <div align="center" id="items_display_area_admin">
                <div align="left" class="inner_content_area_admin">				
				
                  <!--form area start -->
				<?php echo $form->create('Newsletteruser', array('name' =>'Newsletteruser'));?>
                  <div id="admin_heading">Add Newsletter Subscribers</div>
				   <div id="grid_admin">
							<div align="left" id="inner_leftcontent">
							  <p class="maintext_inner">User name<span class="required_field">*</span></p>
							</div>
							<div align="right" id="inner_rightcontent">
								<span class="toplinks">
									<?php echo $form->input('uname', array('label' => '','class' => 'box2_admin')); ?>
								</span>							
							</div>
							<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						  </div>
						
						
						<div id="grid_admin">
							<div align="left" id="inner_leftcontent">
							  <p class="maintext_inner">Email<span class="required_field">*</span></p>
							</div>
							<div align="right" id="inner_rightcontent">
								<span class="toplinks">
									<?php echo $form->input('email', array('label' => '','class' => 'box2_admin')); ?>
								</span>							
							</div>
							<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						  </div>
						
								
								<div id="admin_bottom">
								<div align="left" id="inner_leftcontent">
								  <p class="maintext_inner">&nbsp;</p>
								</div>
								<div align="right" id="inner_rightcontent">
									<span class="toplinks">								  
									<input type="submit" value="Save" class="buttn_admin" onClick="return chk(document.Newsletteruser);">
									<input type="button" value="Cancel" class="buttn_admin" onClick="javascript:history.go(-1);">		
									</span>
								</div>
								<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
								</div>								
								
				 <?php echo $form->end(); ?> 
                  <!--form area end -->			  
				  
                </div>
                <!--form area end -->
              </div>
              <div align="left" class="float_clear1"></div>
            </div>
            <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
            <br /> <br /> 