<?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>
function chk(thisform)
{
 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">Newsletter Details</div>
						    
						<div id="grid_admin">
							<div align="left" id="inner_fckcontent">
							<p class="maintext_inner">
							<?php echo $ndet["Newsletter"]["title"]; ?>
							</p>
							<p class="maintext_inner">
							<?php echo $ndet["Newsletter"]["content"]; ?>
							</p>			
							</div>
							<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						  </div>
								
								<div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
								</div>									  
                </div>          
              </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 /> 
			 <table width="100%"  border="0" cellspacing="0" cellpadding="0" id="items_display_area_admin_table">
				  <tr>
					<td align="left" valign="top">
					<table width="100%"  border="0" cellspacing="1" cellpadding="6">
					  <tr align="left" valign="middle" id="list_admin_top">
						<td width="5%">#</td>
						<td width="20%"><?php echo $paginator->sort('Title', 'title'); ?></td>
						<td width="40%"><?php echo $paginator->sort('Content', 'content'); ?></td>
						<td width="10%"><?php echo $paginator->sort('Date', 'news_date'); ?></td>
						<td width="15%">Options</td>
					  </tr>
					 <?php
						$_count=1;
					   if(!empty($newsletter))
					   {
					    foreach ($newsletter as $letters){ ?> 
							  <tr align="left" valign="middle" id="list_admin">
								<td><?php echo $_count;?></td>
								<td>
								<?php 
								$title=Sanitize::html($letters['Newsletter']['title']); 
								echo $html->link($title, "/newsletters/details/".$letters['Newsletter']['id']); ?>
								</td>
								<td>
								<?php echo $letters["Newsletter"]["content"]; ?>
								</td>
								<td>
								<?php 
								$newsdate=explode(' ',$letters["Newsletter"]["news_date"]);
								echo $newsdate[0]; ?>
								</td>						
								<td>
								<?php echo $html->link('Send', 
				"/newsletters/sendNewsletter/".$letters['Newsletter']['id'],null,'Are you sure you want to send the Newsletter.'); ?> 
								/ <?php echo $html->link('Edit', "/newsletters/edit/".$letters['Newsletter']['id']); ?>
								/ <?php echo $html->link('Delete', "/newsletters/edit/".$letters['Newsletter']['id']); ?> </td>							
							  </tr>  
					   <?php  $_count++; } } ?>					  
						</table>					 
						  <table width="100%"  border="0" cellspacing="0" cellpadding="0" id="admin_bottom">
						    <tr>
						       <td align="center"><?php echo $this->renderElement('pagination'); // Render the pagination element ?></td>
						    </tr>
					      </table>