cmc-sales/app/views/documents/index.ctp
2016-04-30 12:36:27 +10:00

83 lines
2.2 KiB
PHP
Executable file

<div class="documents index">
<h2><?php __('Documents');?></h2>
<p>
<?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $paginator->sort('created');?></th>
<th><?php echo $paginator->sort('user_id');?></th>
<th>Type</th>
<th>#Pages</th>
<th>PDF Filename</th>
<th>PDF Created</th>
<th>PDF Created By</th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($documents as $document):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td>
<?=$time->nice($document['Document']['created']); ?>
</td>
<td>
<?php echo $html->link($document['User']['username'], array('controller' => 'users', 'action' => 'view', $document['User']['id'])); ?>
</td>
<td>
<?=$document['Document']['type'];?>
</td>
<td>
<?=$document['Document']['doc_page_count'];?>
</td>
<td>
<?=$html->link($document['Document']['pdf_filename'], '/pdf/'.$document['Document']['pdf_filename']);?>
</td>
<td>
<?php
$pdf_created_at = $document['Document']['pdf_created_at'];
if($pdf_created_at != '0000-00-00 00:00:00') {
echo $time->nice($document['Document']['pdf_created_at']);
}
?>
</td>
<td>
<?php
if($document['Document']['pdf_created_by_user_id']) {
$pdf_user_id = $document['Document']['pdf_created_by_user_id'];
echo $html->link($users[$pdf_user_id], '/users/view/'.$pdf_user_id);
}
?>
</td>
<td class="actions">
<?php echo $html->link(__('View', true), array('action' => 'view', $document['Document']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $paginator->numbers();?>
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>
<?php debug($documents); ?>