<?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 clickSearch()
{
	document.frmUsers.submit();
}
</script>
<div align="center" class="subheading">
              <div align="left">Newsletter details</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 id="list_admin">
														<div>
														<br /><br />
														<b><?php echo html_entity_decode($letter_title); ?></b>
														<?php echo html_entity_decode($letter_content); ?>	
														</div>
														<div align="left" style="padding-left:10px;">	
														<br /><br />
														<table>
														<tr><td width="30"></b>#</b></td><td width="164"><b>Name</b></td><td width="262"><b>Email Address</b></td><td width="174"><b>Sent Date / Time</b></td></tr>												
														<?php 
														$cnt=1;
							  							if(!empty($data)){
														foreach ($data as $letter){
														?>
														<tr>
														<td><?php echo $cnt++;?></td>
														<td><?php echo htmlentities($letter["SentNewsletter"]["username"]);?></td>
														<td><?php echo htmlentities($letter["SentNewsletter"]["email"]);?></td>
														<td>
														<?php 														
														$snd_dt	= strtotime($letter["SentNewsletter"]["send_date"]);
														echo date("m-d-Y / H:i:s",$snd_dt );
														?></td>
														</tr>																 
														<?php  } ?>
														<tr>
														<td colspan="4" align="center">&nbsp;</td>
														</tr>		
														<tr>
														<td colspan="4" align="center">
														<?php 
														
														   $paginator->options(array('url'=> $id,$this->passedArgs));  ?>
														   <?php echo $this->renderElement('pagination'); // Render the pagination element ?>
	                                                    </td>
														</tr>															
														<?php  } ?>
														</table>
														</div>														
														<div align="left" class="float_clear"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
														<br>
										</div>
									</div>