Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

<head>
<style>
table, th, td {
    border: 1px solid black;
}
</style>
</head>
<div class="notificationCampaigns index">
        
        <h2><?php echo __('Notification Campaigns'); ?></h2>
        
        <table cellpadding="0" cellspacing="0" border="1" class="table table-striped" >
        <tr>
                        <th style="text-align:center"><?php echo $this->Paginator->sort('id'); ?></th>
                        <th style="text-align:center"><?php echo $this->Paginator->sort('name'); ?></th>
                        <th style="text-align:center"><?php echo $this->Paginator->sort('title'); ?></th>
                        <th style="text-align:center"><?php echo $this->Paginator->sort('created'); ?></th>
                        <th style="text-align:center"><?php echo $this->Paginator->sort('expiresat'); ?></th>
                        <th style="text-align:center">Total</th>
                        <th style="text-align:center">Success</th>
                        <th style="text-align:center">Failed</th>
                        <th style="text-align:center">Recieved</th>
                        <th style="text-align:center">Opened</th>
                        <th style="text-align:center">Referrer</th>
                        <th style="text-align:center">Login</th>
                        <th style="text-align:center">Expired</th>
                        <th style="text-align:center" class="actions"><?php echo __('Actions'); ?></th>
        
        </tr>

        <?php foreach ($notificationCampaigns as $notificationCampaign): ?>
        <?php 
        if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['sent']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['sent'])){
                $successSent=$notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['sent'];
        }else{
                $successSent=0;
        }
        if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['0']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['0'])){
                $successFailed=$notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['0'];
        }else{
                $successFailed=0;
        }
        ?>      
        <tr>

                <td align="center" width="4%"><?php echo h($notificationCampaign['NotificationCampaign']['id']); ?>&nbsp;</td>
                <td align="center"><?php echo h($notificationCampaign['NotificationCampaign']['name']); ?>&nbsp;</td>
                <td align="center"><?php echo h($notificationCampaign['NotificationCampaign']['title']); ?>&nbsp;</td>
                <!-- <td align="center"><?php echo h($notificationCampaign['NotificationCampaign']['message']); ?>&nbsp;</td> -->
                <td align="center"><?php echo h($notificationCampaign['NotificationCampaign']['created']); ?>&nbsp;</td>
                <td align="center"><?php echo h($notificationCampaign['NotificationCampaign']['expiresat']); ?>&nbsp;</td>
                <td> <?php echo h($successSent+ $successFailed) ?></td>
                <td align="center"><?php if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['sent']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['sent'])){echo
                $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['sent'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'sent',1)); } else {echo h('0');}?>&nbsp;</td>

                <td align="center"><?php if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['0']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['0'])){       echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['0'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'sent',0));} else {echo h('0');}?>&nbsp;</td>

                <td align="center"><?php if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['recieved']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['recieved'])){echo
                $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['recieved'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'recieved',1)); } else {echo h('0');}?>&nbsp;</td>
                

                <td align="center"><?php if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['opened']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['opened'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['opened'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'opened',1));  } else {echo h('0');}?>&nbsp;</td>
                <td align="center"><?php if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['referrer']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['referrer'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['referrer'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'referrer',1));  } else {echo h('0');}?>&nbsp;</td>
                <td align="center"><?php if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['login']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['login'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['login'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'login',1)); } else {echo h('0');}?>&nbsp;</td>
                <td align="center"><?php if(isset($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['expired']) && !empty($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['expired'])){echo $this->Html->link(__(h($notificationCampaignsCount[$notificationCampaign['NotificationCampaign']['id']]['expired'])), array('action' => 'show', $notificationCampaign['NotificationCampaign']['id'], 'expired',1)); } else {echo h('0');}?>&nbsp;</td>
                
                <td align="center" width="15%" class="actions">

                        <?php echo $this->Html->link(__('View'), array('action' => 'view', $notificationCampaign['NotificationCampaign']['id'])); ?>
                        &nbsp;
                        <?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $notificationCampaign['NotificationCampaign']['id'])); ?>
                        <!--<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $notificationCampaign['NotificationCampaign']['id']), null, __('Are you sure you want to delete # %s?', $notificationCampaign['NotificationCampaign']['id'])); ?> -->
                </td>
        </tr>
<?php endforeach; ?>
        </table>
        <p>
        <?php
        echo $this->Paginator->counter(array(
        'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
        ));
        ?>      </p>
        <div class="paging">
        <?php
                echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
                echo $this->Paginator->numbers(array('separator' => '  '));
                echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
        ?>
        </div>
</div>