<?php
/**
* @package ccNewsletter
* @version 1.0.6
* @author  Chill Creations <info@chillcreations.com>
* @link    http://www.chillcreations.com
* @copyright Copyright (C) 2008 - 2010 Chill Creations-All rights reserved
* @license GNU/GPL, see LICENSE.php for full license.
* See COPYRIGHT.php for more copyright notices and details.

This file is part of ccNewsletter.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
**/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
$linksubscriber=JRoute::_( 'index.php?option=com_ccnewsletter&view=subscribe');


function versionCompare()
{
	$jversion = new JVersion();
	$current_version =  $jversion->getShortVersion();
	return substr($current_version,0,3);
}

if(versionCompare()!="1.5")
{
	?>
		<style type="text/css">
		tr, td {
		    border: 0 solid #DDDDDD;
		}
		</style>
	<?
}

?>
<script language="javascript" type="text/javascript">
	function tableOrdering( order, dir, task )
	{
		var form = document.adminForm;
		form.filter_order.value 	= order;
		form.filter_order_Dir.value	= dir;
		document.adminForm.submit( task );
	}

</script>

<script type="text/javascript">
function newPopup(url)
{
	popupWindow = window.open(url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
}
</script>
<form action="<?php echo $this->action; ?>" method="post" name="adminForm">
<table width="100%" border="0" cellspacing="3" cellpadding="3">
	<tfoot>
		<tr>
			<td colspan="2">
				<?php echo $this->pageNav->getListFooter(); ?>
			</td>
		</tr>
	</tfoot>
	<tbody>
	<tr>
		<td colspan="2">
			<div style="float: right;padding-right: 5px;border: 0px solid red;font-size: 9pt;text-align: right;">&nbsp;<a href="<?php echo $linksubscriber; ?>"><img src="<?php echo JURI::root()."administrator/components/com_ccnewsletter/assets/email_go.png"; ?>"> <?php echo JText::_( 'CC_SUBSCRIBE_COL'); ?></a></div>
		</td>
	</tr>
	<tr>
		<td style="background-color:#EFEFEF;" class="sectiontableheader" align="center" width="2%">
		<?php echo JText::_('Num'); ?>
		</td>
		<td style="background-color:#EFEFEF;" class="sectiontableheader" width="45%">
		<?php echo JHTML::_('grid.sort',  JText::_( 'CC_NEWSLETTER_NAME' ), 'n.name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
		</td>
	</tr>


	<?php
$params = array('size'=>array('x'=>100, 'y'=>100));
JHTML::_('behavior.modal', 'a.modal', $params);
	$k = 0;
	for ($i=0, $n=count( $this->items ); $i < $n; $i++)
	{
		$row = &$this->items[$i];
		$checked 	= JHTML::_('grid.id',   $i, $row->id );
		$link 		= JRoute::_( 'index.php?option=com_ccnewsletter&view=newsletterarchive&nid='. $row->id );

		?>
		<tr>
			<td  align="left" width="3%">&nbsp;
			<?php echo $i+1; ?>
			</td>

		 	<td align="left" width="45%">&nbsp;
			 	<a style="margin:0px 0px 0px 5px;text-decoration:none;" href="JavaScript:newPopup('index.php?option=com_ccnewsletter&task=viewNewsletter&id=<?php echo $row->id;?>');"><?php echo $row->name; ?></a>
			</td>
		</tr>
		<?php
		$k = 1 - $k;
	}
	?>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	</tbody>
</table>
<input type="hidden" name="option" value="com_ccnewsletter" />
<input type="hidden" name="task" value="" />
<!--<input type="hidden" name="controller" value="newsletterarchive" />-->
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
<input type="hidden" name="limitstart" value="0" />
</form>
