<?php //$info = EmailContactAdditionalInfo::FindContactDetails($data->id); ?>
<?php if($index == 0) { ?>

<tr>
	<th>#</th>
	<th>First Name</th>
	<th>Last Name</th>
	<th>Email Address</th>
	<th>Title</th>
	<th>Company</th>
	<!-- <th>Phone No.</th> -->
	<th>Date</th>
</tr>

<?php } ?>

<?php 
	$emailContact = EmailContact::model()->find('email_address = "'.$data['email_address'].'"');
	$contactid = null;
	if( $emailContact )
		$contactid = $emailContact->id;

 ?>

<tr>
	<td><?php echo ++$index + ($pagination->currentPage * $pagination->pageSize); ?></td>
	<td><?php echo ($contactid)?CHtml::link($data['first_name'], ['contact/contactView', 'contactId' => $contactid ]):$data['first_name']; ?></td>
	<td><?php echo ($contactid)?CHtml::link($data['last_name'], ['contact/contactView', 'contactId' => $contactid ]):$data['last_name']; ?></td>
	<td><?php echo ($contactid)?CHtml::link($data['email_address'], ['contact/contactView', 'contactId' => $contactid ]):$data['email_address']; ?></td>
	<td><?php echo ((isset($data['position']))?$data['position']:null); ?></td>
	<td><?php echo ((isset($data['company']))?$data['company']:null); ?></td>
	<!-- <td><?php // echo ((isset($data['phone_number']))?$data['phone_number']:null); ?></td> -->
	<td>
		<?php 
			$date = MailerContent::model()->getSubmissionDate($data['id'],$data['mailer_content_link_var_id'], $data['mailer_id'] );
			echo (new DateTime($date))->format('M d, Y h:i A');
		?>
	</td>
</tr>