<?php
/* @var $this NewsletterController */
/* @var $model Newsletter */

$this->breadcrumbs=array(
	'Newsletters'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List Newsletter', 'url'=>array('index')),
	array('label'=>'Create Newsletter', 'url'=>array('create')),
);

?>
<div id="headlines" style="width: 99%; padding-left:2%;">
<img class="right5" width="12" height="7" src="images/admin/bg.png">
Manage Newsletters
</div>
<div id="communicationsbox" style="height:525px; background-color:#f7eee1;">
<?php
    foreach(Yii::app()->user->getFlashes() as $key => $message) {
        echo '<div class="flash-' . $key . '">' . $message . "</div>\n";
    }
?>
<div id="form_wrapper">
<div id="row">
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'newsletter-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array(
			'header'=>'Sl.No.',
			'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
			'htmlOptions'=>array('width'=>'5px'),
		),
		'title',
		//'news_letter_body',
		'created',
		array(
			  'htmlOptions'=>array('width'=>'150px'),
			'class'=>'CButtonColumn',
			'header'=>'Actions',
			'template'=>'{update}{sendtoall}{sendtostaff}{delete}',
			'buttons'=>array
				(
					'sendtoall' => array
					(
						'label'=>'send to all memebrs',
						'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/mail-send.png',
						'url'=>'Yii::app()->createUrl("newsletter/sendmail",array("id"=>$data->id,"to"=>"all"))',
					),
					'sendtostaff' => array
					(
						'label'=>'send to all staffs',
						'imageUrl'=>Yii::app()->request->baseUrl.'/images/admin/email_to_friend.png',
						'url'=>'Yii::app()->createUrl("newsletter/sendmail",array("id"=>$data->id,"to"=>"staff"))',
					),
				),
				//'style'=>'padding-left:10px;',
		),
	),
)); ?>
</div>
</div>
</div>