<?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'); ?>
<?php
echo $javascript->link('ckeditor/ckeditor.js');
?>
<script>
     window.onload = function()
    {
        CKEDITOR.replace( 'NewsletterContent' );
    };
function chk(thisform)
{
  
  if($.trim($('#NewsletterTitle').val())=='')
  {
    alert("Please enter the Newsletter title.");
	$('#NewsletterTitle').focus();
	return false;
  }
  
  var oFCKeditor = FCKeditorAPI.GetInstance('NewsletterContent');
  var content= oFCKeditor.GetData();
  var contentShtml = $(content).text();

  if($.trim(contentShtml)=='')
  {
    alert("Please enter the Newsletter content.");
	$('#NewsletterContent').focus();
	return false;
  } 
  
  thisform.submit();
}
</script>

<?php //echo $fck->load(); ?> 
<div align="center" class="subheading">
              <div align="left">Newsletter</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('Newsletter', array('name' =>'Newsletter'));?>
                  <div id="admin_heading">Add Newsletter </div>
				   <div id="grid_admin">
							<div align="left" id="inner_leftcontent" style="padding-left:15px;">
							  <p class="maintext_inner">Title<span class="required_field">*</span></p>    
							</div>
                            <div align="right" id="inner_rightcontent" style="float: left;">
								<span class="toplinks">
									<?php echo $form->input('title', 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_fckcontent" style="padding:5px 15px 0 15px;">
							<p class="maintext_inner">Contents<span class="required_field">*</span></p>
							<?php echo $form->input('Newsletter.content', array('rows' => '3','label' => ''));?>
                                                            <?php //echo $fck->editor('Newsletter/content');?> 
							</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.Newsletter);">
									<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 /> 