Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $options = array('conditions'=>$final,'order'=>$order,'group'=>array('Project.id'),'joins'=>array(
- array(
- 'table'=>'project_categories',
- 'alias'=>'ProjectCategory',
- 'type' => 'LEFT',
- 'conditions'=>array('ProjectCategory.project_id = Project.id')
- ),
- array(
- 'table'=>'categories',
- 'alias'=>'Category',
- 'type' => 'LEFT',
- 'conditions'=>array('ProjectCategory.category_id = Category.id')
- ),
- ));
- $this->paginate = $options;
- //VIEW
- <div class="projects index">
- <h2><?php __('Projects');?></h2>
- <table cellpadding="0" cellspacing="0">
- <tr>
- <th><?php echo $this->Paginator->sort('id');?></th>
- <th><?php echo $this->Paginator->sort('user_id');?></th>
- <th><?php echo $this->Paginator->sort('status');?></th>
- <th><?php echo $this->Paginator->sort('approval_status');?></th>
- <th><?php echo $this->Paginator->sort('project_title');?></th>
- <th><?php echo $this->Paginator->sort('project_type');?></th>
- <th><?php echo $this->Paginator->sort('budget');?></th>
- <th><?php echo $this->Paginator->sort('delivery');?></th>
- <th><?php echo $this->Paginator->sort('created');?></th>
- <th><?php echo $this->Paginator->sort('favorite');?></th>
- <th><?php echo $this->Paginator->sort('top_employer');?></th>
- <th><?php echo $this->Paginator->sort('view_counter');?></th>
- <th class="actions"><?php __('Actions');?></th>
- </tr>
- <?php
- $i = 0;
- foreach ($projects as $project):
- $class = null;
- if ($i++ % 2 == 0) {
- $class = ' class="altrow"';
- }
- ?>
- <tr<?php echo $class;?>>
- <td><?php echo $project['Project']['id']; ?> </td>
- <td>
- <?php echo $this->Html->link($project['User']['username'], array('controller' => 'users', 'action' => 'view', $project['User']['id'])); ?>
- </td>
- <td><?php echo $project['Project']['status']; ?> </td>
- <td><?php echo $project['Project']['approval_status']; ?> </td>
- <td><?php echo $project['Project']['project_title']; ?> </td>
- <td><?php echo $project['ProjectType']['name']; ?> </td>
- <td><?php echo $project['Project']['budget']; ?> </td>
- <td><?php echo $project['Project']['delivery']; ?> </td>
- <td><?php echo $project['Project']['created']; ?> </td>
- <td><?php echo $project['Project']['favorite']; ?> </td>
- <td><?php echo $project['Project']['top_employer']; ?> </td>
- <td><?php echo $project['Project']['view_counter']; ?> </td>
- <td class="actions">
- <?php echo $this->Html->link(__('View', true), array('action' => 'view', $project['Project']['id'])); ?>
- <?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $project['Project']['id'])); ?>
- <?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $project['Project']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $project['Project']['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%', true)
- ));
- ?> </p>
- <div class="paging">
- <?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
- | <?php echo $this->Paginator->numbers();?>
- |
- <?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
- </div>
- </div>
- <div class="actions">
- <h3><?php __('Actions'); ?></h3>
- <ul>
- <li><?php echo $this->Html->link(__('New Project', true), array('action' => 'add')); ?></li>
- <li><?php echo $this->Html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
- <li><?php echo $this->Html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
- <li><?php echo $this->Html->link(__('List Categories', true), array('controller' => 'categories', 'action' => 'index')); ?> </li>
- <li><?php echo $this->Html->link(__('New Category', true), array('controller' => 'categories', 'action' => 'add')); ?> </li>
- </ul>
- </div>
- $projects = $this->paginate("Project");
- $this->set('projects',$projects);
Add Comment
Please, Sign In to add comment