<?php echo $javascript->link('email_table'); ?>

<?php // if (!empty($emails)):?>

<div id="emailDiv">

    <table cellpadding = "0" cellspacing = "0" class="emailtable">
        <tr>
            <th><?php __('Email Date'); ?></th>
            <th><?php echo $html->image('attach.png'); ?></th>
            <th><?php __('From'); ?></th>
            <th><?php __('Subject'); ?></th>
         
            <th><?php __('To'); ?></th>
            
        </tr>
        <?php
        $i = 0;
        foreach ($emails as $email):
            $class = null;

            if ($i % 2 == 0) {
                $class = ' class="altrow"';
            }
            $i++;



            ?>

        <tr<?php echo $class;?>>

            <td><?php echo $email['Email']['date'];?></td>
            <td><?php if($email['Email']['email_attachment_count'] > 0) {
                        echo $html->image('attach.png');
                    }
                    ?>


            </td>
            <td><?php echo $email['Email']['from']; ?></td>
            <td><?php //echo $text->highlight($html->link($email['Email']['subject'], array('controller'=> 'emails', 'action'=>'frame/', $email['Email']['id'])), 'Quotation');
                      echo $text->highlight($html->link($email['Email']['subject'], '#', array('class'=>'viewLink', 'id'=>$email['Email']['id'])), 'Quotation');
            ?></td>

            
            <td><?php echo $email['Email']['to']; ?></td>
      

        </tr>
        <?php endforeach; ?>
    </table>
</div>
<?php //endif; ?>


<div id="ViewDialog">
  
</div>